pub enum ConfirmedTransaction<N>where
N: Network,{
AcceptedDeploy(u32, Transaction<N>, Vec<FinalizeOperation<N>>),
AcceptedExecute(u32, Transaction<N>, Vec<FinalizeOperation<N>>),
RejectedDeploy(u32, Transaction<N>, Rejected<N>, Vec<FinalizeOperation<N>>),
RejectedExecute(u32, Transaction<N>, Rejected<N>, Vec<FinalizeOperation<N>>),
}Expand description
The confirmed transaction.
Variants§
AcceptedDeploy(u32, Transaction<N>, Vec<FinalizeOperation<N>>)
The accepted deploy transaction is composed of (index, deploy_transaction, finalize_operations).
AcceptedExecute(u32, Transaction<N>, Vec<FinalizeOperation<N>>)
The accepted execute transaction is composed of (index, execute_transaction, finalize_operations).
RejectedDeploy(u32, Transaction<N>, Rejected<N>, Vec<FinalizeOperation<N>>)
The rejected deploy transaction is composed of (index, fee_transaction, rejected_deployment, finalize_operations).
RejectedExecute(u32, Transaction<N>, Rejected<N>, Vec<FinalizeOperation<N>>)
The rejected execute transaction is composed of (index, fee_transaction, rejected_execution, finalize_operations).
Implementations§
Source§impl<N> ConfirmedTransaction<N>where
N: Network,
impl<N> ConfirmedTransaction<N>where
N: Network,
Sourcepub fn accepted_deploy(
index: u32,
transaction: Transaction<N>,
finalize_operations: Vec<FinalizeOperation<N>>,
) -> Result<ConfirmedTransaction<N>, Error>
pub fn accepted_deploy( index: u32, transaction: Transaction<N>, finalize_operations: Vec<FinalizeOperation<N>>, ) -> Result<ConfirmedTransaction<N>, Error>
Returns a new instance of an accepted deploy transaction.
Sourcepub fn accepted_execute(
index: u32,
transaction: Transaction<N>,
finalize_operations: Vec<FinalizeOperation<N>>,
) -> Result<ConfirmedTransaction<N>, Error>
pub fn accepted_execute( index: u32, transaction: Transaction<N>, finalize_operations: Vec<FinalizeOperation<N>>, ) -> Result<ConfirmedTransaction<N>, Error>
Returns a new instance of an accepted execute transaction.
Sourcepub fn rejected_deploy(
index: u32,
transaction: Transaction<N>,
rejected: Rejected<N>,
finalize_operations: Vec<FinalizeOperation<N>>,
) -> Result<ConfirmedTransaction<N>, Error>
pub fn rejected_deploy( index: u32, transaction: Transaction<N>, rejected: Rejected<N>, finalize_operations: Vec<FinalizeOperation<N>>, ) -> Result<ConfirmedTransaction<N>, Error>
Returns a new instance of a rejected deploy transaction.
Sourcepub fn rejected_execute(
index: u32,
transaction: Transaction<N>,
rejected: Rejected<N>,
finalize_operations: Vec<FinalizeOperation<N>>,
) -> Result<ConfirmedTransaction<N>, Error>
pub fn rejected_execute( index: u32, transaction: Transaction<N>, rejected: Rejected<N>, finalize_operations: Vec<FinalizeOperation<N>>, ) -> Result<ConfirmedTransaction<N>, Error>
Returns a new instance of a rejected execute transaction.
Source§impl<N> ConfirmedTransaction<N>where
N: Network,
impl<N> ConfirmedTransaction<N>where
N: Network,
Sourcepub const fn is_accepted(&self) -> bool
pub const fn is_accepted(&self) -> bool
Returns ‘true’ if the confirmed transaction is accepted.
Sourcepub const fn is_rejected(&self) -> bool
pub const fn is_rejected(&self) -> bool
Returns ‘true’ if the confirmed transaction is rejected.
Sourcepub fn contains_unconfirmed_transaction_id(
&self,
unconfirmed_transaction_id: &<N as Network>::TransactionID,
) -> bool
pub fn contains_unconfirmed_transaction_id( &self, unconfirmed_transaction_id: &<N as Network>::TransactionID, ) -> bool
Returns true if the confirmed transaction represents the given unconfirmed transaction ID.
Source§impl<N> ConfirmedTransaction<N>where
N: Network,
impl<N> ConfirmedTransaction<N>where
N: Network,
Sourcepub const fn variant(&self) -> &str
pub const fn variant(&self) -> &str
Returns the human-readable variant of the confirmed transaction.
Sourcepub const fn transaction(&self) -> &Transaction<N>
pub const fn transaction(&self) -> &Transaction<N>
Returns the transaction.
Sourcepub fn into_transaction(self) -> Transaction<N>
pub fn into_transaction(self) -> Transaction<N>
Returns the transaction.
Sourcepub fn num_finalize(&self) -> usize
pub fn num_finalize(&self) -> usize
Returns the number of finalize operations.
Sourcepub const fn finalize_operations(&self) -> &Vec<FinalizeOperation<N>>
pub const fn finalize_operations(&self) -> &Vec<FinalizeOperation<N>>
Returns the finalize operations for the confirmed transaction.
Sourcepub fn to_finalize_id(&self) -> Result<Field<N>, Error>
pub fn to_finalize_id(&self) -> Result<Field<N>, Error>
Returns the finalize ID, by computing the root of a (small) Merkle tree comprised of the ordered finalize operations for the transaction.
Sourcepub fn to_rejected_id(&self) -> Result<Option<Field<N>>, Error>
pub fn to_rejected_id(&self) -> Result<Option<Field<N>>, Error>
Returns the rejected ID, if the confirmed transaction is rejected.
Sourcepub fn to_rejected(&self) -> Option<&Rejected<N>>
pub fn to_rejected(&self) -> Option<&Rejected<N>>
Returns the rejected object, if the confirmed transaction is rejected.
Sourcepub fn to_unconfirmed_transaction_id(
&self,
) -> Result<<N as Network>::TransactionID, Error>
pub fn to_unconfirmed_transaction_id( &self, ) -> Result<<N as Network>::TransactionID, Error>
Returns the unconfirmed transaction ID, which is defined as the transaction ID prior to confirmation. When a transaction is rejected, its fee transition is used to construct the confirmed transaction ID, changing the original transaction ID.
Sourcepub fn to_unconfirmed_transaction(&self) -> Result<Transaction<N>, Error>
pub fn to_unconfirmed_transaction(&self) -> Result<Transaction<N>, Error>
Returns the unconfirmed transaction, which is defined as the transaction prior to confirmation. When a transaction is rejected, its fee transition is used to construct the confirmed transaction, changing the original transaction.
Methods from Deref<Target = Transaction<N>>§
pub const MAX_TRANSITIONS: usize = 32usize
Sourcepub fn to_root(&self) -> Result<Field<N>, Error>
pub fn to_root(&self) -> Result<Field<N>, Error>
Returns the transaction root, by computing the root for a Merkle tree of the transition IDs.
Sourcepub fn to_leaf(&self, id: &Field<N>) -> Result<TransactionLeaf<N>, Error>
pub fn to_leaf(&self, id: &Field<N>) -> Result<TransactionLeaf<N>, Error>
Returns the Merkle leaf for the given ID of a function or transition in the transaction.
Sourcepub fn to_path(
&self,
leaf: &TransactionLeaf<N>,
) -> Result<MerklePath<N, snarkvm_console_program::::state_path::configuration::TransactionPath::{constant#0}>, Error>
pub fn to_path( &self, leaf: &TransactionLeaf<N>, ) -> Result<MerklePath<N, snarkvm_console_program::::state_path::configuration::TransactionPath::{constant#0}>, Error>
Returns the Merkle path for the transaction leaf.
Sourcepub fn to_tree(
&self,
) -> Result<MerkleTree<N, BHP<N, 8, 54>, BHP<N, 6, 43>, snarkvm_console_program::::state_path::configuration::TransactionTree::{constant#0}>, Error>
pub fn to_tree( &self, ) -> Result<MerkleTree<N, BHP<N, 8, 54>, BHP<N, 6, 43>, snarkvm_console_program::::state_path::configuration::TransactionTree::{constant#0}>, Error>
The Merkle tree of transition IDs for the transaction.
Sourcepub fn is_execute(&self) -> bool
pub fn is_execute(&self) -> bool
Returns true if the transaction is an execute transaction.
Sourcepub fn contains_split(&self) -> bool
pub fn contains_split(&self) -> bool
Returns true if this transaction contains a call to credits.aleo/split.
Sourcepub fn owner(&self) -> Option<&ProgramOwner<N>>
pub fn owner(&self) -> Option<&ProgramOwner<N>>
Returns Some(owner) if the transaction is a deployment. Otherwise, returns None.
Sourcepub fn deployment(&self) -> Option<&Deployment<N>>
pub fn deployment(&self) -> Option<&Deployment<N>>
Returns Some(deployment) if the transaction is a deployment. Otherwise, returns None.
Sourcepub fn execution(&self) -> Option<&Execution<N>>
pub fn execution(&self) -> Option<&Execution<N>>
Returns Some(execution) if the transaction is an execution. Otherwise, returns None.
Sourcepub fn id(&self) -> <N as Network>::TransactionID
pub fn id(&self) -> <N as Network>::TransactionID
Returns the transaction ID.
Sourcepub fn base_fee_amount(&self) -> Result<Integer<N, u64>, Error>
pub fn base_fee_amount(&self) -> Result<Integer<N, u64>, Error>
Returns the transaction base fee.
Sourcepub fn priority_fee_amount(&self) -> Result<Integer<N, u64>, Error>
pub fn priority_fee_amount(&self) -> Result<Integer<N, u64>, Error>
Returns the transaction priority fee.
Sourcepub fn fee_transition(&self) -> Option<Fee<N>>
pub fn fee_transition(&self) -> Option<Fee<N>>
Returns the fee transition.
Sourcepub fn contains_transition(
&self,
transition_id: &<N as Network>::TransitionID,
) -> bool
pub fn contains_transition( &self, transition_id: &<N as Network>::TransitionID, ) -> bool
Returns true if the transaction 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 transaction 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 transaction contains the given commitment.
Sourcepub fn find_transition(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Option<&Transition<N>>
pub fn find_transition( &self, transition_id: &<N as Network>::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.
Sourcepub fn transition_ids(&self) -> impl DoubleEndedIterator
pub fn transition_ids(&self) -> impl DoubleEndedIterator
Returns an iterator over the transition IDs, for all transitions.
Sourcepub fn transitions(&self) -> impl DoubleEndedIterator
pub fn transitions(&self) -> impl DoubleEndedIterator
Returns an iterator over all transitions.
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.
Returns an iterator over the tags, 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 transition_public_keys(&self) -> impl DoubleEndedIterator
pub fn transition_public_keys(&self) -> impl DoubleEndedIterator
Returns an iterator over the transition public keys, for all transitions.
Sourcepub fn transition_commitments(&self) -> impl DoubleEndedIterator
pub fn transition_commitments(&self) -> impl DoubleEndedIterator
Returns an iterator over the transition commitments, for all transitions.
Trait Implementations§
Source§impl<N> Clone for ConfirmedTransaction<N>
impl<N> Clone for ConfirmedTransaction<N>
Source§fn clone(&self) -> ConfirmedTransaction<N>
fn clone(&self) -> ConfirmedTransaction<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<N> Debug for ConfirmedTransaction<N>where
N: Network,
impl<N> Debug for ConfirmedTransaction<N>where
N: Network,
Source§impl<N> Deref for ConfirmedTransaction<N>where
N: Network,
impl<N> Deref for ConfirmedTransaction<N>where
N: Network,
Source§fn deref(&self) -> &<ConfirmedTransaction<N> as Deref>::Target
fn deref(&self) -> &<ConfirmedTransaction<N> as Deref>::Target
Returns a reference to the valid transaction.
Source§type Target = Transaction<N>
type Target = Transaction<N>
Source§impl<'de, N> Deserialize<'de> for ConfirmedTransaction<N>where
N: Network,
impl<'de, N> Deserialize<'de> for ConfirmedTransaction<N>where
N: Network,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ConfirmedTransaction<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ConfirmedTransaction<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the confirmed transaction from a string or bytes.
Source§impl<N> Display for ConfirmedTransaction<N>where
N: Network,
impl<N> Display for ConfirmedTransaction<N>where
N: Network,
Source§impl<N> FromBytes for ConfirmedTransaction<N>where
N: Network,
impl<N> FromBytes for ConfirmedTransaction<N>where
N: Network,
Source§impl<'a, N> FromIterator<&'a ConfirmedTransaction<N>> for Transactions<N>where
N: Network,
impl<'a, N> FromIterator<&'a ConfirmedTransaction<N>> for Transactions<N>where
N: Network,
Source§fn from_iter<T>(iter: T) -> Transactions<N>where
T: IntoIterator<Item = &'a ConfirmedTransaction<N>>,
fn from_iter<T>(iter: T) -> Transactions<N>where
T: IntoIterator<Item = &'a ConfirmedTransaction<N>>,
Initializes from an iterator of transactions.
Source§impl<N> FromIterator<ConfirmedTransaction<N>> for Transactions<N>where
N: Network,
impl<N> FromIterator<ConfirmedTransaction<N>> for Transactions<N>where
N: Network,
Source§fn from_iter<T>(iter: T) -> Transactions<N>where
T: IntoIterator<Item = ConfirmedTransaction<N>>,
fn from_iter<T>(iter: T) -> Transactions<N>where
T: IntoIterator<Item = ConfirmedTransaction<N>>,
Initializes from an iterator of transactions.
Source§impl<N> FromStr for ConfirmedTransaction<N>where
N: Network,
impl<N> FromStr for ConfirmedTransaction<N>where
N: Network,
Source§impl<N> PartialEq for ConfirmedTransaction<N>
impl<N> PartialEq for ConfirmedTransaction<N>
Source§impl<N> Serialize for ConfirmedTransaction<N>where
N: Network,
impl<N> Serialize for ConfirmedTransaction<N>where
N: Network,
Source§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,
Serializes the confirmed transaction into string or bytes.
Source§impl<N> ToBytes for ConfirmedTransaction<N>where
N: Network,
impl<N> ToBytes for ConfirmedTransaction<N>where
N: Network,
impl<N> Eq for ConfirmedTransaction<N>
impl<N> StructuralPartialEq for ConfirmedTransaction<N>where
N: Network,
Auto Trait Implementations§
impl<N> Freeze for ConfirmedTransaction<N>where
<N as Network>::TransactionID: Freeze,
<N as Network>::StateRoot: Freeze,
<N as Network>::TransitionID: Freeze,
<N as Environment>::Projective: Freeze,
<N as Environment>::Scalar: Freeze,
<N as Environment>::Field: Freeze,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Freeze,
impl<N> RefUnwindSafe for ConfirmedTransaction<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 ConfirmedTransaction<N>
impl<N> Sync for ConfirmedTransaction<N>
impl<N> Unpin for ConfirmedTransaction<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 ConfirmedTransaction<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> 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>
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