Struct diem_sdk::types::proof::AccountStateProof
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§
§impl AccountStateProof
impl AccountStateProof
pub fn new(
transaction_info_with_proof: TransactionInfoWithProof,
transaction_info_to_account_proof: SparseMerkleProof<AccountStateBlob>
) -> AccountStateProof
pub fn new( transaction_info_with_proof: TransactionInfoWithProof, transaction_info_to_account_proof: SparseMerkleProof<AccountStateBlob> ) -> AccountStateProof
Constructs a new AccountStateProof
using given ledger_info_to_transaction_info_proof
,
transaction_info
and transaction_info_to_account_proof
.
pub 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.
pub 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.
pub fn verify(
&self,
ledger_info: &LedgerInfo,
state_version: u64,
account_address_hash: HashValue,
account_state_blob: Option<&AccountStateBlob>
) -> Result<(), Error>
pub fn verify( &self, ledger_info: &LedgerInfo, state_version: u64, account_address_hash: HashValue, account_state_blob: Option<&AccountStateBlob> ) -> Result<(), Error>
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§
§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
.§fn arbitrary_with(
_top: <AccountStateProof as Arbitrary>::Parameters
) -> <AccountStateProof as Arbitrary>::Strategy
fn arbitrary_with( _top: <AccountStateProof as Arbitrary>::Parameters ) -> <AccountStateProof as Arbitrary>::Strategy
§impl Clone for AccountStateProof
impl Clone for AccountStateProof
§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 more§impl Debug for AccountStateProof
impl Debug for AccountStateProof
§impl<'de> Deserialize<'de> for AccountStateProof
impl<'de> Deserialize<'de> for AccountStateProof
§fn deserialize<__D>(
__deserializer: __D
) -> Result<AccountStateProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<AccountStateProof, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl PartialEq<AccountStateProof> for AccountStateProof
impl PartialEq<AccountStateProof> for AccountStateProof
§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 ==
.§impl Serialize for AccountStateProof
impl Serialize for AccountStateProof
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<&AccountStateProofView> for AccountStateProof
impl TryFrom<&AccountStateProofView> for AccountStateProof
§fn try_from(
account_state_proof_view: &AccountStateProofView
) -> Result<AccountStateProof, <AccountStateProof as TryFrom<&AccountStateProofView>>::Error>
fn try_from( account_state_proof_view: &AccountStateProofView ) -> Result<AccountStateProof, <AccountStateProof as TryFrom<&AccountStateProofView>>::Error>
Performs the conversion.
§impl TryFrom<AccountStateProof> for AccountStateProofView
impl TryFrom<AccountStateProof> for AccountStateProofView
§fn try_from(
account_state_proof: AccountStateProof
) -> Result<AccountStateProofView, Error>
fn try_from( account_state_proof: AccountStateProof ) -> Result<AccountStateProofView, Error>
Performs the conversion.
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.