Struct diem_types::transaction::TransactionListWithProof
source · pub struct TransactionListWithProof {
pub transactions: Vec<Transaction>,
pub events: Option<Vec<Vec<ContractEvent>>>,
pub first_transaction_version: Option<Version>,
pub proof: TransactionListProof,
}
Expand description
The list may have three states:
- The list is empty. Both proofs must be
None
. - The list has only 1 transaction/transaction_info. Then
proof_of_first_transaction
must exist andproof_of_last_transaction
must beNone
. - The list has 2+ transactions/transaction_infos. The both proofs must exist.
Fields§
§transactions: Vec<Transaction>
§events: Option<Vec<Vec<ContractEvent>>>
§first_transaction_version: Option<Version>
§proof: TransactionListProof
Implementations§
source§impl TransactionListWithProof
impl TransactionListWithProof
sourcepub fn new(
transactions: Vec<Transaction>,
events: Option<Vec<Vec<ContractEvent>>>,
first_transaction_version: Option<Version>,
proof: TransactionListProof
) -> Self
pub fn new( transactions: Vec<Transaction>, events: Option<Vec<Vec<ContractEvent>>>, first_transaction_version: Option<Version>, proof: TransactionListProof ) -> Self
Constructor.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
sourcepub fn verify(
&self,
ledger_info: &LedgerInfo,
first_transaction_version: Option<Version>
) -> Result<()>
pub fn verify( &self, ledger_info: &LedgerInfo, first_transaction_version: Option<Version> ) -> Result<()>
Verifies the transaction list with the proofs, both carried on self
.
Two things are ensured if no error is raised:
- All the transactions exist on the ledger represented by
ledger_info
. - And the transactions in the list has consecutive versions starting from
first_transaction_version
. Whenfirst_transaction_version
is None, ensures the list is empty.
Trait Implementations§
source§impl Arbitrary for TransactionListWithProof
impl Arbitrary for TransactionListWithProof
§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.source§fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
§type Strategy = BoxedStrategy<TransactionListWithProof>
type Strategy = BoxedStrategy<TransactionListWithProof>
The type of
Strategy
used to generate values of type Self
.source§impl Clone for TransactionListWithProof
impl Clone for TransactionListWithProof
source§fn clone(&self) -> TransactionListWithProof
fn clone(&self) -> TransactionListWithProof
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 TransactionListWithProof
impl Debug for TransactionListWithProof
source§impl<'de> Deserialize<'de> for TransactionListWithProof
impl<'de> Deserialize<'de> for TransactionListWithProof
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<TransactionListWithProof> for TransactionListWithProof
impl PartialEq<TransactionListWithProof> for TransactionListWithProof
source§fn eq(&self, other: &TransactionListWithProof) -> bool
fn eq(&self, other: &TransactionListWithProof) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TransactionListWithProof
impl Serialize for TransactionListWithProof
impl Eq for TransactionListWithProof
impl StructuralEq for TransactionListWithProof
impl StructuralPartialEq for TransactionListWithProof
Auto Trait Implementations§
impl RefUnwindSafe for TransactionListWithProof
impl Send for TransactionListWithProof
impl Sync for TransactionListWithProof
impl Unpin for TransactionListWithProof
impl UnwindSafe for TransactionListWithProof
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.