Struct diem_sdk::types::proof::TransactionAccumulatorSummary [−][src]
pub struct TransactionAccumulatorSummary(_);
Expand description
An in-memory accumulator for storing a summary of the core transaction info accumulator. It is a summary in the sense that it only stores maximally frozen subtree nodes rather than storing all leaves and internal nodes.
Light clients and light nodes use this type to store their currently verified
view of the transaction accumulator. When verifying state proofs, these clients
attempt to extend their accumulator summary with an AccumulatorConsistencyProof
to verifiably ratchet their trusted view of the accumulator to a newer state.
Implementations
pub fn new(
accumulator: InMemoryAccumulator<TransactionAccumulatorHasher>
) -> Result<TransactionAccumulatorSummary, Error>
Verify that this accumulator summary is “consistent” with the given
LedgerInfo
, i.e., they both have the same version and accumulator
root hash.
pub fn try_from_genesis_proof(
genesis_proof: AccumulatorConsistencyProof,
target_version: u64
) -> Result<TransactionAccumulatorSummary, Error>
pub fn try_from_genesis_proof(
genesis_proof: AccumulatorConsistencyProof,
target_version: u64
) -> Result<TransactionAccumulatorSummary, Error>
Try to build an accumulator summary using a consistency proof starting from pre-genesis.
pub fn try_extend_with_proof(
&self,
consistency_proof: &AccumulatorConsistencyProof,
target_li: &LedgerInfo
) -> Result<TransactionAccumulatorSummary, Error>
pub fn try_extend_with_proof(
&self,
consistency_proof: &AccumulatorConsistencyProof,
target_li: &LedgerInfo
) -> Result<TransactionAccumulatorSummary, Error>
Try to extend an existing accumulator summary with a consistency proof
starting from our current version. Then validate that the resulting
accumulator summary is consistent with the given target LedgerInfo
.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<TransactionAccumulatorSummary, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<TransactionAccumulatorSummary, <__D as Deserializer<'de>>::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 !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub 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
Auto Trait Implementations
impl Send for TransactionAccumulatorSummary
impl Sync for TransactionAccumulatorSummary
impl Unpin for TransactionAccumulatorSummary
impl UnwindSafe for TransactionAccumulatorSummary
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generates a hash used only for tests.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more