pub struct Transactions<N: Network> { /* private fields */ }
Implementations§
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub fn to_finalize_root(
&self,
ratified_finalize_operations: Vec<FinalizeOperation<N>>,
) -> Result<Field<N>>
pub fn to_finalize_root( &self, ratified_finalize_operations: Vec<FinalizeOperation<N>>, ) -> Result<Field<N>>
Returns the finalize root of the transactions.
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub fn to_transactions_root(&self) -> Result<Field<N>>
pub fn to_transactions_root(&self) -> Result<Field<N>>
Returns the transactions root, by computing the root for a Merkle tree of the transaction IDs.
Sourcepub fn to_path(
&self,
transaction_id: N::TransactionID,
) -> Result<TransactionsPath<N>>
pub fn to_path( &self, transaction_id: N::TransactionID, ) -> Result<TransactionsPath<N>>
Returns the Merkle path for the transactions leaf.
Sourcepub fn to_tree(&self) -> Result<TransactionsTree<N>>
pub fn to_tree(&self) -> Result<TransactionsTree<N>>
The Merkle tree of transaction IDs for the block.
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub fn from(transactions: &[ConfirmedTransaction<N>]) -> Self
pub fn from(transactions: &[ConfirmedTransaction<N>]) -> Self
Initializes from a given transactions list.
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub fn get(
&self,
transaction_id: &N::TransactionID,
) -> Option<&ConfirmedTransaction<N>>
pub fn get( &self, transaction_id: &N::TransactionID, ) -> Option<&ConfirmedTransaction<N>>
Returns the transaction for the given transaction ID.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns ‘true’ if there are no accepted or rejected transactions.
Sourcepub fn num_accepted(&self) -> usize
pub fn num_accepted(&self) -> usize
Returns the number of accepted transactions.
Sourcepub fn num_rejected(&self) -> usize
pub fn num_rejected(&self) -> usize
Returns the number of rejected transactions.
Sourcepub fn num_finalize(&self) -> usize
pub fn num_finalize(&self) -> usize
Returns the number of finalize operations.
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub fn contains_transition(&self, transition_id: &N::TransitionID) -> bool
pub fn contains_transition(&self, transition_id: &N::TransitionID) -> bool
Returns true
if the transactions contains the given transition ID.
Sourcepub fn contains_serial_number(&self, serial_number: &Field<N>) -> bool
pub fn contains_serial_number(&self, serial_number: &Field<N>) -> bool
Returns true
if the transactions contains the given serial number.
Sourcepub fn contains_commitment(&self, commitment: &Field<N>) -> bool
pub fn contains_commitment(&self, commitment: &Field<N>) -> bool
Returns true
if the transactions contains the given commitment.
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub fn find_confirmed_transaction_for_unconfirmed_transaction_id(
&self,
unconfirmed_transaction_id: &N::TransactionID,
) -> Option<&ConfirmedTransaction<N>>
pub fn find_confirmed_transaction_for_unconfirmed_transaction_id( &self, unconfirmed_transaction_id: &N::TransactionID, ) -> Option<&ConfirmedTransaction<N>>
Returns the confirmed transaction for the given unconfirmed transaction ID, if it exists.
Sourcepub fn find_transaction_for_transition_id(
&self,
transition_id: &N::TransitionID,
) -> Option<&Transaction<N>>
pub fn find_transaction_for_transition_id( &self, transition_id: &N::TransitionID, ) -> Option<&Transaction<N>>
Returns the transaction with the given transition ID, if it exists.
Sourcepub fn find_transaction_for_serial_number(
&self,
serial_number: &Field<N>,
) -> Option<&Transaction<N>>
pub fn find_transaction_for_serial_number( &self, serial_number: &Field<N>, ) -> Option<&Transaction<N>>
Returns the transaction with the given serial number, if it exists.
Sourcepub fn find_transaction_for_commitment(
&self,
commitment: &Field<N>,
) -> Option<&Transaction<N>>
pub fn find_transaction_for_commitment( &self, commitment: &Field<N>, ) -> Option<&Transaction<N>>
Returns the transaction with the given commitment, if it exists.
Sourcepub fn find_transition(
&self,
transition_id: &N::TransitionID,
) -> Option<&Transition<N>>
pub fn find_transition( &self, transition_id: &N::TransitionID, ) -> Option<&Transition<N>>
Returns the transition with the corresponding transition ID, if it exists.
Sourcepub fn find_transition_for_serial_number(
&self,
serial_number: &Field<N>,
) -> Option<&Transition<N>>
pub fn find_transition_for_serial_number( &self, serial_number: &Field<N>, ) -> Option<&Transition<N>>
Returns the transition for the given serial number, if it exists.
Sourcepub fn find_transition_for_commitment(
&self,
commitment: &Field<N>,
) -> Option<&Transition<N>>
pub fn find_transition_for_commitment( &self, commitment: &Field<N>, ) -> Option<&Transition<N>>
Returns the transition for the given commitment, if it exists.
Sourcepub fn find_record(
&self,
commitment: &Field<N>,
) -> Option<&Record<N, Ciphertext<N>>>
pub fn find_record( &self, commitment: &Field<N>, ) -> Option<&Record<N, Ciphertext<N>>>
Returns the record with the corresponding commitment, if it exists.
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub const MAX_ABORTED_TRANSACTIONS: usize = _
pub const MAX_ABORTED_TRANSACTIONS: usize = _
The maximum number of aborted transactions allowed in a block.
Sourcepub const MAX_TRANSACTIONS: usize = 1_048_575usize
pub const MAX_TRANSACTIONS: usize = 1_048_575usize
The maximum number of transactions allowed in a block.
Sourcepub fn iter(
&self,
) -> impl '_ + ExactSizeIterator<Item = &ConfirmedTransaction<N>>
pub fn iter( &self, ) -> impl '_ + ExactSizeIterator<Item = &ConfirmedTransaction<N>>
Returns an iterator over all transactions, for all transactions in self
.
Sourcepub fn par_iter(
&self,
) -> impl '_ + IndexedParallelIterator<Item = &ConfirmedTransaction<N>>
pub fn par_iter( &self, ) -> impl '_ + IndexedParallelIterator<Item = &ConfirmedTransaction<N>>
Returns a parallel iterator over all transactions, for all transactions in self
.
Sourcepub fn transaction_ids(
&self,
) -> impl '_ + ExactSizeIterator<Item = &N::TransactionID>
pub fn transaction_ids( &self, ) -> impl '_ + ExactSizeIterator<Item = &N::TransactionID>
Returns an iterator over the transaction IDs, for all transactions in self
.
Sourcepub fn deployments(&self) -> impl '_ + Iterator<Item = &ConfirmedTransaction<N>>
pub fn deployments(&self) -> impl '_ + Iterator<Item = &ConfirmedTransaction<N>>
Returns an iterator over all transactions in self
that are accepted deploy transactions.
Sourcepub fn executions(&self) -> impl '_ + Iterator<Item = &ConfirmedTransaction<N>>
pub fn executions(&self) -> impl '_ + Iterator<Item = &ConfirmedTransaction<N>>
Returns an iterator over all transactions in self
that are accepted execute transactions.
Sourcepub fn transitions(&self) -> impl '_ + Iterator<Item = &Transition<N>>
pub fn transitions(&self) -> impl '_ + Iterator<Item = &Transition<N>>
Returns an iterator over all transitions.
Sourcepub fn transition_ids(&self) -> impl '_ + Iterator<Item = &N::TransitionID>
pub fn transition_ids(&self) -> impl '_ + Iterator<Item = &N::TransitionID>
Returns an iterator over the transition IDs, for all transitions.
Sourcepub fn transition_public_keys(&self) -> impl '_ + Iterator<Item = &Group<N>>
pub fn transition_public_keys(&self) -> impl '_ + Iterator<Item = &Group<N>>
Returns an iterator over the transition public keys, for all transactions.
Sourcepub fn transition_commitments(&self) -> impl '_ + Iterator<Item = &Field<N>>
pub fn transition_commitments(&self) -> impl '_ + Iterator<Item = &Field<N>>
Returns an iterator over the transition commitments, for all transactions.
Returns an iterator over the tags, for all transition inputs that are records.
Sourcepub fn input_ids(&self) -> impl '_ + Iterator<Item = &Field<N>>
pub fn input_ids(&self) -> impl '_ + Iterator<Item = &Field<N>>
Returns an iterator over the input IDs, for all transition inputs that are records.
Sourcepub fn serial_numbers(&self) -> impl '_ + Iterator<Item = &Field<N>>
pub fn serial_numbers(&self) -> impl '_ + Iterator<Item = &Field<N>>
Returns an iterator over the serial numbers, for all transition inputs that are records.
Sourcepub fn output_ids(&self) -> impl '_ + Iterator<Item = &Field<N>>
pub fn output_ids(&self) -> impl '_ + Iterator<Item = &Field<N>>
Returns an iterator over the output IDs, for all transition inputs that are records.
Sourcepub fn commitments(&self) -> impl '_ + Iterator<Item = &Field<N>>
pub fn commitments(&self) -> impl '_ + Iterator<Item = &Field<N>>
Returns an iterator over the commitments, for all transition outputs that are records.
Sourcepub fn records(
&self,
) -> impl '_ + Iterator<Item = (&Field<N>, &Record<N, Ciphertext<N>>)>
pub fn records( &self, ) -> impl '_ + Iterator<Item = (&Field<N>, &Record<N, Ciphertext<N>>)>
Returns an iterator over the records, for all transition outputs that are records.
Sourcepub fn nonces(&self) -> impl '_ + Iterator<Item = &Group<N>>
pub fn nonces(&self) -> impl '_ + Iterator<Item = &Group<N>>
Returns an iterator over the nonces, for all transition outputs that are records.
Sourcepub fn transaction_fee_amounts(
&self,
) -> impl '_ + Iterator<Item = Result<U64<N>>>
pub fn transaction_fee_amounts( &self, ) -> impl '_ + Iterator<Item = Result<U64<N>>>
Returns an iterator over the transaction fee amounts, for all transactions.
Sourcepub fn finalize_operations(
&self,
) -> impl '_ + Iterator<Item = &FinalizeOperation<N>>
pub fn finalize_operations( &self, ) -> impl '_ + Iterator<Item = &FinalizeOperation<N>>
Returns an iterator over the finalize operations, for all transactions.
Source§impl<N: Network> Transactions<N>
impl<N: Network> Transactions<N>
Sourcepub fn into_transaction_ids(
self,
) -> impl ExactSizeIterator<Item = N::TransactionID>
pub fn into_transaction_ids( self, ) -> impl ExactSizeIterator<Item = N::TransactionID>
Returns a consuming iterator over the transaction IDs, for all transactions in self
.
Sourcepub fn into_deployments(self) -> impl Iterator<Item = ConfirmedTransaction<N>>
pub fn into_deployments(self) -> impl Iterator<Item = ConfirmedTransaction<N>>
Returns a consuming iterator over all transactions in self
that are accepted deploy transactions.
Sourcepub fn into_executions(self) -> impl Iterator<Item = ConfirmedTransaction<N>>
pub fn into_executions(self) -> impl Iterator<Item = ConfirmedTransaction<N>>
Returns a consuming iterator over all transactions in self
that are accepted execute transactions.
Sourcepub fn into_transitions(self) -> impl Iterator<Item = Transition<N>>
pub fn into_transitions(self) -> impl Iterator<Item = Transition<N>>
Returns a consuming iterator over all transitions.
Sourcepub fn into_transition_ids(self) -> impl Iterator<Item = N::TransitionID>
pub fn into_transition_ids(self) -> impl Iterator<Item = N::TransitionID>
Returns a consuming iterator over the transition IDs, for all transitions.
Sourcepub fn into_transition_public_keys(self) -> impl Iterator<Item = Group<N>>
pub fn into_transition_public_keys(self) -> impl Iterator<Item = Group<N>>
Returns a consuming iterator over the transition public keys, for all transactions.
Returns a consuming iterator over the tags, for all transition inputs that are records.
Sourcepub fn into_serial_numbers(self) -> impl Iterator<Item = Field<N>>
pub fn into_serial_numbers(self) -> impl Iterator<Item = Field<N>>
Returns a consuming iterator over the serial numbers, for all transition inputs that are records.
Sourcepub fn into_commitments(self) -> impl Iterator<Item = Field<N>>
pub fn into_commitments(self) -> impl Iterator<Item = Field<N>>
Returns a consuming iterator over the commitments, for all transition outputs that are records.
Sourcepub fn into_records(
self,
) -> impl Iterator<Item = (Field<N>, Record<N, Ciphertext<N>>)>
pub fn into_records( self, ) -> impl Iterator<Item = (Field<N>, Record<N, Ciphertext<N>>)>
Returns a consuming iterator over the records, for all transition outputs that are records.
Sourcepub fn into_nonces(self) -> impl Iterator<Item = Group<N>>
pub fn into_nonces(self) -> impl Iterator<Item = Group<N>>
Returns a consuming iterator over the nonces, for all transition outputs that are records.
Trait Implementations§
Source§impl<N: Clone + Network> Clone for Transactions<N>where
N::TransactionID: Clone,
impl<N: Clone + Network> Clone for Transactions<N>where
N::TransactionID: Clone,
Source§fn clone(&self) -> Transactions<N>
fn clone(&self) -> Transactions<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<N: Network> Debug for Transactions<N>
impl<N: Network> Debug for Transactions<N>
Source§impl<'de, N: Network> Deserialize<'de> for Transactions<N>
impl<'de, N: Network> Deserialize<'de> for Transactions<N>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the transactions from a JSON-string or buffer.
Source§impl<N: Network> Display for Transactions<N>
impl<N: Network> Display for Transactions<N>
Source§impl<N: Network> FromBytes for Transactions<N>
impl<N: Network> FromBytes for Transactions<N>
Source§impl<'a, N: Network> FromIterator<&'a ConfirmedTransaction<N>> for Transactions<N>
impl<'a, N: Network> FromIterator<&'a ConfirmedTransaction<N>> for Transactions<N>
Source§fn from_iter<T: IntoIterator<Item = &'a ConfirmedTransaction<N>>>(
iter: T,
) -> Self
fn from_iter<T: IntoIterator<Item = &'a ConfirmedTransaction<N>>>( iter: T, ) -> Self
Initializes from an iterator of transactions.
Source§impl<N: Network> FromIterator<ConfirmedTransaction<N>> for Transactions<N>
impl<N: Network> FromIterator<ConfirmedTransaction<N>> for Transactions<N>
Source§fn from_iter<T: IntoIterator<Item = ConfirmedTransaction<N>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = ConfirmedTransaction<N>>>(iter: T) -> Self
Initializes from an iterator of transactions.
Source§impl<N: Network> FromStr for Transactions<N>
impl<N: Network> FromStr for Transactions<N>
Source§impl<N: Network> IntoIterator for Transactions<N>
impl<N: Network> IntoIterator for Transactions<N>
Source§fn into_iter(self) -> Self::IntoIter
fn into_iter(self) -> Self::IntoIter
Returns a consuming iterator over all transactions, for all transactions in self
.
Source§type IntoIter = IntoValues<<N as Network>::TransactionID, <Transactions<N> as IntoIterator>::Item>
type IntoIter = IntoValues<<N as Network>::TransactionID, <Transactions<N> as IntoIterator>::Item>
Source§type Item = ConfirmedTransaction<N>
type Item = ConfirmedTransaction<N>
Source§impl<N: PartialEq + Network> PartialEq for Transactions<N>where
N::TransactionID: PartialEq,
impl<N: PartialEq + Network> PartialEq for Transactions<N>where
N::TransactionID: PartialEq,
Source§impl<N: Network> Serialize for Transactions<N>
impl<N: Network> Serialize for Transactions<N>
Source§impl<N: Network> ToBytes for Transactions<N>
impl<N: Network> ToBytes for Transactions<N>
impl<N: Eq + Network> Eq for Transactions<N>where
N::TransactionID: Eq,
impl<N: Network> StructuralPartialEq for Transactions<N>
Auto Trait Implementations§
impl<N> Freeze for Transactions<N>
impl<N> RefUnwindSafe for Transactions<N>where
<N as Network>::TransactionID: RefUnwindSafe,
<N as Network>::StateRoot: RefUnwindSafe,
<N as Network>::TransitionID: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Transactions<N>
impl<N> Sync for Transactions<N>
impl<N> Unpin for Transactions<N>where
<N as Network>::TransactionID: Unpin,
<N as Network>::StateRoot: Unpin,
<N as Network>::TransitionID: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
<N as Environment>::Field: Unpin,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin,
N: Unpin,
impl<N> UnwindSafe for Transactions<N>where
<N as Network>::TransactionID: UnwindSafe,
<N as Network>::StateRoot: UnwindSafe,
<N as Network>::TransitionID: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: UnwindSafe + RefUnwindSafe,
N: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more