Struct diem_types::proof::definition::AccountStateProof
source · pub struct AccountStateProof { /* private fields */ }Expand description
The complete proof used to authenticate the state of an account. This structure consists of the
AccumulatorProof from LedgerInfo to TransactionInfo, the TransactionInfo object and the
SparseMerkleProof from state root to the account.
Implementations§
source§impl AccountStateProof
impl AccountStateProof
sourcepub fn new(
transaction_info_with_proof: TransactionInfoWithProof,
transaction_info_to_account_proof: SparseMerkleProof<AccountStateBlob>
) -> Self
pub fn new( transaction_info_with_proof: TransactionInfoWithProof, transaction_info_to_account_proof: SparseMerkleProof<AccountStateBlob> ) -> Self
Constructs a new AccountStateProof using given ledger_info_to_transaction_info_proof,
transaction_info and transaction_info_to_account_proof.
sourcepub fn transaction_info_with_proof(&self) -> &TransactionInfoWithProof
pub fn transaction_info_with_proof(&self) -> &TransactionInfoWithProof
Returns the transaction_info_with_proof object in this proof.
sourcepub fn transaction_info_to_account_proof(
&self
) -> &SparseMerkleProof<AccountStateBlob>
pub fn transaction_info_to_account_proof( &self ) -> &SparseMerkleProof<AccountStateBlob>
Returns the transaction_info_to_account_proof object in this proof.
sourcepub fn verify(
&self,
ledger_info: &LedgerInfo,
state_version: Version,
account_address_hash: HashValue,
account_state_blob: Option<&AccountStateBlob>
) -> Result<()>
pub fn verify( &self, ledger_info: &LedgerInfo, state_version: Version, account_address_hash: HashValue, account_state_blob: Option<&AccountStateBlob> ) -> Result<()>
Verifies that the state of an account at version state_version is correct using the
provided proof. If account_state_blob is present, we expect the account to exist,
otherwise we expect the account to not exist.
Trait Implementations§
source§impl Arbitrary for AccountStateProof
impl Arbitrary for AccountStateProof
§type Parameters = (<TransactionInfoWithProof as Arbitrary>::Parameters, <SparseMerkleProof<AccountStateBlob> as Arbitrary>::Parameters)
type Parameters = (<TransactionInfoWithProof as Arbitrary>::Parameters, <SparseMerkleProof<AccountStateBlob> as Arbitrary>::Parameters)
The type of parameters that
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.§type Strategy = Map<(<TransactionInfoWithProof as Arbitrary>::Strategy, <SparseMerkleProof<AccountStateBlob> as Arbitrary>::Strategy), fn(_: (TransactionInfoWithProof, SparseMerkleProof<AccountStateBlob>)) -> AccountStateProof>
type Strategy = Map<(<TransactionInfoWithProof as Arbitrary>::Strategy, <SparseMerkleProof<AccountStateBlob> as Arbitrary>::Strategy), fn(_: (TransactionInfoWithProof, SparseMerkleProof<AccountStateBlob>)) -> AccountStateProof>
The type of
Strategy used to generate values of type Self.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Clone for AccountStateProof
impl Clone for AccountStateProof
source§fn clone(&self) -> AccountStateProof
fn clone(&self) -> AccountStateProof
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for AccountStateProof
impl Debug for AccountStateProof
source§impl<'de> Deserialize<'de> for AccountStateProof
impl<'de> Deserialize<'de> for AccountStateProof
source§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
source§impl PartialEq<AccountStateProof> for AccountStateProof
impl PartialEq<AccountStateProof> for AccountStateProof
source§fn eq(&self, other: &AccountStateProof) -> bool
fn eq(&self, other: &AccountStateProof) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for AccountStateProof
impl Serialize for AccountStateProof
impl Eq for AccountStateProof
impl StructuralEq for AccountStateProof
impl StructuralPartialEq for AccountStateProof
Auto Trait Implementations§
impl RefUnwindSafe for AccountStateProof
impl Send for AccountStateProof
impl Sync for AccountStateProof
impl Unpin for AccountStateProof
impl UnwindSafe for AccountStateProof
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.