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.
Sourcepub fn to_leaf(
&self,
id: &Field<N>,
is_input: bool,
) -> Result<TransitionLeaf<N>>
pub fn to_leaf( &self, id: &Field<N>, is_input: bool, ) -> Result<TransitionLeaf<N>>
Returns the Merkle leaf for the given input or output ID in the transition.
Sourcepub fn to_tree(&self) -> Result<TransitionTree<N>>
pub fn to_tree(&self) -> Result<TransitionTree<N>>
The Merkle tree of input and output IDs for the transition.
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 id(&self) -> &N::TransitionID
pub const fn id(&self) -> &N::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: Network> Transition<N>
impl<N: Network> Transition<N>
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: 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_id(self) -> N::TransitionID
pub fn into_id(self) -> N::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 + 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§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> StructuralPartialEq for Transition<N>
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§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