Struct diem_types::account_state_blob::AccountStateWithProof [−][src]
pub struct AccountStateWithProof<T> {
pub version: Version,
pub blob: Option<AccountStateBlob>,
pub proof: AccountStateProof<T>,
}
Fields
version: Version
The transaction version at which this account state is seen.
blob: Option<AccountStateBlob>
Blob value representing the account state. If this field is not set, it means the account does not exist.
proof: AccountStateProof<T>
The proof the client can use to authenticate the value.
Implementations
pub fn new(
version: Version,
blob: Option<AccountStateBlob>,
proof: AccountStateProof<T>
) -> Self
pub fn new(
version: Version,
blob: Option<AccountStateBlob>,
proof: AccountStateProof<T>
) -> Self
Constructor.
pub fn verify(
&self,
ledger_info: &LedgerInfo,
version: Version,
address: AccountAddress
) -> Result<()>
pub fn verify(
&self,
ledger_info: &LedgerInfo,
version: Version,
address: AccountAddress
) -> Result<()>
Verifies the the account state blob with the proof, both carried by self
.
Two things are ensured if no error is raised:
- This account state exists in the ledger represented by
ledger_info
. - It belongs to account of
address
and is seen at the time the transaction at versionstate_version
is just committed. To make sure this is the latest state, pass inledger_info.version()
asstate_version
.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<T> RefUnwindSafe for AccountStateWithProof<T> where
T: RefUnwindSafe,
impl<T> Send for AccountStateWithProof<T> where
T: Send,
impl<T> Sync for AccountStateWithProof<T> where
T: Sync,
impl<T> Unpin for AccountStateWithProof<T> where
T: Unpin,
impl<T> UnwindSafe for AccountStateWithProof<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Generates a hash used only for tests.