Struct diem_types::proof::definition::AccountStateProof [−][src]
pub struct AccountStateProof<T> { /* fields omitted */ }
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
pub fn new(
transaction_info_with_proof: TransactionInfoWithProof<T>,
transaction_info_to_account_proof: SparseMerkleProof<AccountStateBlob>
) -> Self
pub fn new(
transaction_info_with_proof: TransactionInfoWithProof<T>,
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
.
Returns the transaction_info_with_proof
object in this proof.
Returns the transaction_info_to_account_proof
object in this proof.
pub 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
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 AccountStateProof<T> where
T: RefUnwindSafe,
impl<T> Send for AccountStateProof<T> where
T: Send,
impl<T> Sync for AccountStateProof<T> where
T: Sync,
impl<T> Unpin for AccountStateProof<T> where
T: Unpin,
impl<T> UnwindSafe for AccountStateProof<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Generates a hash used only for tests.