Struct diem_sdk::types::transaction::TransactionListWithProof
pub struct TransactionListWithProof {
pub transactions: Vec<Transaction, Global>,
pub events: Option<Vec<Vec<ContractEvent, Global>, Global>>,
pub first_transaction_version: Option<u64>,
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, Global>
§events: Option<Vec<Vec<ContractEvent, Global>, Global>>
§first_transaction_version: Option<u64>
§proof: TransactionListProof
Implementations§
§impl TransactionListWithProof
impl TransactionListWithProof
pub fn new(
transactions: Vec<Transaction, Global>,
events: Option<Vec<Vec<ContractEvent, Global>, Global>>,
first_transaction_version: Option<u64>,
proof: TransactionListProof
) -> TransactionListWithProof
pub fn new( transactions: Vec<Transaction, Global>, events: Option<Vec<Vec<ContractEvent, Global>, Global>>, first_transaction_version: Option<u64>, proof: TransactionListProof ) -> TransactionListWithProof
Constructor.
pub fn new_empty() -> TransactionListWithProof
pub fn new_empty() -> TransactionListWithProof
Creates an empty transaction list.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn verify(
&self,
ledger_info: &LedgerInfo,
first_transaction_version: Option<u64>
) -> Result<(), Error>
pub fn verify( &self, ledger_info: &LedgerInfo, first_transaction_version: Option<u64> ) -> Result<(), Error>
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§
§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
.§fn arbitrary_with(
_args: <TransactionListWithProof as Arbitrary>::Parameters
) -> <TransactionListWithProof as Arbitrary>::Strategy
fn arbitrary_with( _args: <TransactionListWithProof as Arbitrary>::Parameters ) -> <TransactionListWithProof as Arbitrary>::Strategy
§type Strategy = BoxedStrategy<TransactionListWithProof>
type Strategy = BoxedStrategy<TransactionListWithProof>
The type of
Strategy
used to generate values of type Self
.§impl Clone for TransactionListWithProof
impl Clone for TransactionListWithProof
§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 more§impl Debug for TransactionListWithProof
impl Debug for TransactionListWithProof
§impl<'de> Deserialize<'de> for TransactionListWithProof
impl<'de> Deserialize<'de> for TransactionListWithProof
§fn deserialize<__D>(
__deserializer: __D
) -> Result<TransactionListWithProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<TransactionListWithProof, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl PartialEq<TransactionListWithProof> for TransactionListWithProof
impl PartialEq<TransactionListWithProof> for TransactionListWithProof
§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 ==
.§impl Serialize for TransactionListWithProof
impl Serialize for TransactionListWithProof
§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<&TransactionListWithProof> for TransactionsWithProofsView
impl TryFrom<&TransactionListWithProof> for TransactionsWithProofsView
§fn try_from(
txs: &TransactionListWithProof
) -> Result<TransactionsWithProofsView, <TransactionsWithProofsView as TryFrom<&TransactionListWithProof>>::Error>
fn try_from( txs: &TransactionListWithProof ) -> Result<TransactionsWithProofsView, <TransactionsWithProofsView as TryFrom<&TransactionListWithProof>>::Error>
Performs the conversion.
§impl TryFrom<TransactionListWithProof> for TransactionListView
impl TryFrom<TransactionListWithProof> for TransactionListView
§fn try_from(
txs: TransactionListWithProof
) -> Result<TransactionListView, <TransactionListView as TryFrom<TransactionListWithProof>>::Error>
fn try_from( txs: TransactionListWithProof ) -> Result<TransactionListView, <TransactionListView as TryFrom<TransactionListWithProof>>::Error>
Performs the conversion.
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> 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.