pub struct Fee<N: Network> { /* private fields */ }
Implementations§
Source§impl<N: Network> Fee<N>
impl<N: Network> Fee<N>
Sourcepub fn from(
transition: Transition<N>,
global_state_root: N::StateRoot,
proof: Option<Proof<N>>,
) -> Result<Self>
pub fn from( transition: Transition<N>, global_state_root: N::StateRoot, proof: Option<Proof<N>>, ) -> Result<Self>
Initializes a new Fee
instance with the given transition, global state root, and proof.
Sourcepub const fn from_unchecked(
transition: Transition<N>,
global_state_root: N::StateRoot,
proof: Option<Proof<N>>,
) -> Self
pub const fn from_unchecked( transition: Transition<N>, global_state_root: N::StateRoot, proof: Option<Proof<N>>, ) -> Self
Initializes a new Fee
instance with the given transition, global state root, and proof.
Source§impl<N: Network> Fee<N>
impl<N: Network> Fee<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> Fee<N>
impl<N: Network> Fee<N>
Sourcepub fn base_amount(&self) -> Result<U64<N>>
pub fn base_amount(&self) -> Result<U64<N>>
Returns the base amount (in microcredits).
Sourcepub fn priority_amount(&self) -> Result<U64<N>>
pub fn priority_amount(&self) -> Result<U64<N>>
Returns the base amount (in microcredits).
Sourcepub fn deployment_or_execution_id(&self) -> Result<Field<N>>
pub fn deployment_or_execution_id(&self) -> Result<Field<N>>
Returns the deployment or execution ID.
Sourcepub fn num_finalize_operations(&self) -> usize
pub fn num_finalize_operations(&self) -> usize
Returns the number of finalize operations.
Sourcepub fn transition_id(&self) -> &N::TransitionID
pub fn transition_id(&self) -> &N::TransitionID
Returns the transition ID.
Sourcepub const fn transition(&self) -> &Transition<N>
pub const fn transition(&self) -> &Transition<N>
Returns the transition.
Sourcepub fn into_transition(self) -> Transition<N>
pub fn into_transition(self) -> Transition<N>
Returns the transition, consuming self in the process.
Sourcepub const fn global_state_root(&self) -> N::StateRoot
pub const fn global_state_root(&self) -> N::StateRoot
Returns the global state root.
Methods from Deref<Target = 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.
Sourcepub fn id(&self) -> &N::TransitionID
pub fn id(&self) -> &N::TransitionID
Returns the transition ID.
Sourcepub fn program_id(&self) -> &ProgramID<N>
pub fn program_id(&self) -> &ProgramID<N>
Returns the program ID.
Sourcepub fn function_name(&self) -> &Identifier<N>
pub fn function_name(&self) -> &Identifier<N>
Returns the function name.
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.
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.
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 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.
Trait Implementations§
Source§impl<'de, N: Network> Deserialize<'de> for Fee<N>
impl<'de, N: Network> Deserialize<'de> for Fee<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 fee from a string or bytes.
impl<N: Eq + Network> Eq for Fee<N>
impl<N: Network> StructuralPartialEq for Fee<N>
Auto Trait Implementations§
impl<N> Freeze for Fee<N>where
<N as Network>::StateRoot: Freeze,
<N as Network>::TransitionID: Freeze,
<N as Environment>::Projective: Freeze,
<N as Environment>::Field: Freeze,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Freeze,
impl<N> RefUnwindSafe for Fee<N>where
<N as Network>::StateRoot: RefUnwindSafe,
<N as Network>::TransitionID: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Fee<N>
impl<N> Sync for Fee<N>
impl<N> Unpin for Fee<N>where
<N as Network>::StateRoot: Unpin,
<N as Network>::TransitionID: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Field: Unpin,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: Unpin,
<N as Environment>::Scalar: Unpin,
N: Unpin,
impl<N> UnwindSafe for Fee<N>where
<N as Network>::StateRoot: UnwindSafe,
<N as Network>::TransitionID: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<<N as Environment>::PairingCurve as PairingEngine>::G1Affine: 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