Struct snarkvm_ledger_block::transition::Transition
source · pub struct Transition<N: Network> { /* private fields */ }
Implementations§
source§impl<N: Network> Transition<N>
impl<N: Network> Transition<N>
sourcepub fn to_root(&self) -> Result<Field<N>>
pub fn to_root(&self) -> Result<Field<N>>
Returns the transition root, by computing the root for a Merkle tree of the input and output IDs.
sourcepub fn to_path(&self, leaf: &TransitionLeaf<N>) -> Result<TransitionPath<N>>
pub fn to_path(&self, leaf: &TransitionLeaf<N>) -> Result<TransitionPath<N>>
Returns the Merkle path for the transition leaf.
source§impl<N: Network> Transition<N>
impl<N: Network> Transition<N>
source§impl<N: Network> Transition<N>
impl<N: Network> Transition<N>
sourcepub const fn program_id(&self) -> &ProgramID<N>
pub const fn program_id(&self) -> &ProgramID<N>
Returns the program ID.
sourcepub const fn function_name(&self) -> &Identifier<N>
pub const fn function_name(&self) -> &Identifier<N>
Returns the function name.
source§impl<N: Network> Transition<N>
impl<N: Network> Transition<N>
sourcepub fn is_fee_private(&self) -> bool
pub fn is_fee_private(&self) -> bool
Returns true
if this is a fee_private
transition.
sourcepub fn is_fee_public(&self) -> bool
pub fn is_fee_public(&self) -> bool
Returns true
if this is a fee_public
transition.
source§impl<N: Network> Transition<N>
impl<N: Network> Transition<N>
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 transition 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 transition contains the given commitment.
source§impl<N: Network> Transition<N>
impl<N: Network> Transition<N>
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> Transition<N>
impl<N: Network> Transition<N>
sourcepub fn input_ids(&self) -> impl '_ + ExactSizeIterator<Item = &Field<N>>
pub fn input_ids(&self) -> impl '_ + ExactSizeIterator<Item = &Field<N>>
Returns the input IDs.
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 inputs that are records.
Returns an iterator over the tags, for inputs that are records.
sourcepub fn output_ids(&self) -> impl '_ + ExactSizeIterator<Item = &Field<N>>
pub fn output_ids(&self) -> impl '_ + ExactSizeIterator<Item = &Field<N>>
Returns the output IDs.
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 outputs that are records.
source§impl<N: Network> Transition<N>
impl<N: Network> Transition<N>
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 inputs that are records.
Returns a consuming iterator over the tags, for 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 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 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 output records, as a tuple of (commitment, record)
.
Trait Implementations§
source§impl<N: Clone + Network> Clone for Transition<N>where
N::TransitionID: Clone,
impl<N: Clone + Network> Clone for Transition<N>where N::TransitionID: Clone,
source§fn clone(&self) -> Transition<N>
fn clone(&self) -> Transition<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 Transition<N>
impl<N: Network> Debug for Transition<N>
source§impl<'de, N: Network> Deserialize<'de> for Transition<N>
impl<'de, N: Network> Deserialize<'de> for Transition<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 transition from a string or bytes.
source§impl<N: Network> Display for Transition<N>
impl<N: Network> Display for Transition<N>
source§impl<N: Network> FromBytes for Transition<N>
impl<N: Network> FromBytes for Transition<N>
source§impl<N: Network> FromStr for Transition<N>
impl<N: Network> FromStr for Transition<N>
source§impl<N: PartialEq + Network> PartialEq for Transition<N>where
N::TransitionID: PartialEq,
impl<N: PartialEq + Network> PartialEq for Transition<N>where N::TransitionID: PartialEq,
source§fn eq(&self, other: &Transition<N>) -> bool
fn eq(&self, other: &Transition<N>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<N: Network> Serialize for Transition<N>
impl<N: Network> Serialize for Transition<N>
source§impl<N: Network> ToBytes for Transition<N>
impl<N: Network> ToBytes for Transition<N>
impl<N: Eq + Network> Eq for Transition<N>where N::TransitionID: Eq,
impl<N: Network> StructuralEq for Transition<N>
impl<N: Network> StructuralPartialEq for Transition<N>
Auto Trait Implementations§
impl<N> RefUnwindSafe for Transition<N>where N: RefUnwindSafe, <N as Environment>::Field: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe, <N as Network>::TransitionID: RefUnwindSafe,
impl<N> Send for Transition<N>
impl<N> Sync for Transition<N>
impl<N> Unpin for Transition<N>where N: Unpin, <N as Environment>::Field: Unpin, <N as Environment>::Projective: Unpin, <N as Environment>::Scalar: Unpin, <N as Network>::TransitionID: Unpin,
impl<N> UnwindSafe for Transition<N>where N: UnwindSafe, <N as Environment>::Field: UnwindSafe, <N as Environment>::Projective: UnwindSafe, <N as Environment>::Scalar: UnwindSafe, <N as Network>::TransitionID: 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
§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>,
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.