Struct snarkvm_ledger::Transition
source · pub struct Transition<N>where
N: Network,{ /* private fields */ }
Implementations§
source§impl<N> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
sourcepub fn to_root(&self) -> Result<Field<N>, Error>
pub fn to_root(&self) -> Result<Field<N>, Error>
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<MerklePath<N, snarkvm_console_program::::state_path::configuration::TransitionPath::{constant#0}>, Error>
pub fn to_path( &self, leaf: &TransitionLeaf<N>, ) -> Result<MerklePath<N, snarkvm_console_program::::state_path::configuration::TransitionPath::{constant#0}>, Error>
Returns the Merkle path for the transition leaf.
source§impl<N> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
source§impl<N> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
sourcepub const fn id(&self) -> &<N as Network>::TransitionID
pub const fn id(&self) -> &<N as Network>::TransitionID
Returns the transition ID.
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> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
sourcepub fn is_bond_public(&self) -> bool
pub fn is_bond_public(&self) -> bool
Returns true
if this is a bond_public
transition.
sourcepub fn is_bond_validator(&self) -> bool
pub fn is_bond_validator(&self) -> bool
Returns true
if this is a bond_validator
transition.
sourcepub fn is_unbond_public(&self) -> bool
pub fn is_unbond_public(&self) -> bool
Returns true
if this is an unbond_public
transition.
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> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
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> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
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> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
sourcepub fn input_ids(&self) -> impl ExactSizeIterator
pub fn input_ids(&self) -> impl ExactSizeIterator
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
pub fn output_ids(&self) -> impl ExactSizeIterator
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> Transition<N>where
N: Network,
impl<N> Transition<N>where
N: Network,
sourcepub fn into_id(self) -> <N as Network>::TransitionID
pub fn into_id(self) -> <N as Network>::TransitionID
Returns the transition ID, and consumes self
.
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 for Transition<N>
impl<N> Clone for Transition<N>
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> Debug for Transition<N>where
N: Network,
impl<N> Debug for Transition<N>where
N: Network,
source§impl<'de, N> Deserialize<'de> for Transition<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Transition<N>where
N: Network,
source§fn deserialize<D>(
deserializer: D,
) -> Result<Transition<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Transition<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the transition from a string or bytes.
source§impl<N> Display for Transition<N>where
N: Network,
impl<N> Display for Transition<N>where
N: Network,
source§impl<N> FromBytes for Transition<N>where
N: Network,
impl<N> FromBytes for Transition<N>where
N: Network,
source§impl<N> FromStr for Transition<N>where
N: Network,
impl<N> FromStr for Transition<N>where
N: Network,
source§impl<N> PartialEq for Transition<N>
impl<N> PartialEq for Transition<N>
source§impl<N> Serialize for Transition<N>where
N: Network,
impl<N> Serialize for Transition<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 transition into string or bytes.
source§impl<N> ToBytes for Transition<N>where
N: Network,
impl<N> ToBytes for Transition<N>where
N: Network,
impl<N> Eq for Transition<N>
impl<N> StructuralPartialEq for Transition<N>where
N: Network,
Auto Trait Implementations§
impl<N> Freeze for Transition<N>where
<N as Network>::TransitionID: Freeze,
<N as Environment>::Projective: Freeze,
<N as Environment>::Field: Freeze,
impl<N> RefUnwindSafe for Transition<N>where
<N as Network>::TransitionID: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Transition<N>
impl<N> Sync for Transition<N>
impl<N> Unpin for Transition<N>where
<N as Network>::TransitionID: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Field: Unpin,
<N as Environment>::Scalar: Unpin,
N: Unpin,
impl<N> UnwindSafe for Transition<N>where
<N as Network>::TransitionID: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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§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<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