pub struct Fee<N>where
N: Network,{ /* private fields */ }
Implementations§
Source§impl<N> Fee<N>where
N: Network,
impl<N> Fee<N>where
N: Network,
Sourcepub fn from(
transition: Transition<N>,
global_state_root: <N as Network>::StateRoot,
proof: Option<Proof<N>>,
) -> Result<Fee<N>, Error>
pub fn from( transition: Transition<N>, global_state_root: <N as Network>::StateRoot, proof: Option<Proof<N>>, ) -> Result<Fee<N>, Error>
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 as Network>::StateRoot,
proof: Option<Proof<N>>,
) -> Fee<N>
pub const fn from_unchecked( transition: Transition<N>, global_state_root: <N as Network>::StateRoot, proof: Option<Proof<N>>, ) -> Fee<N>
Initializes a new Fee
instance with the given transition, global state root, and proof.
Source§impl<N> Fee<N>where
N: Network,
impl<N> Fee<N>where
N: Network,
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> Fee<N>where
N: Network,
impl<N> Fee<N>where
N: Network,
Sourcepub fn base_amount(&self) -> Result<Integer<N, u64>, Error>
pub fn base_amount(&self) -> Result<Integer<N, u64>, Error>
Returns the base amount (in microcredits).
Sourcepub fn priority_amount(&self) -> Result<Integer<N, u64>, Error>
pub fn priority_amount(&self) -> Result<Integer<N, u64>, Error>
Returns the base amount (in microcredits).
Sourcepub fn deployment_or_execution_id(&self) -> Result<Field<N>, Error>
pub fn deployment_or_execution_id(&self) -> Result<Field<N>, Error>
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 as Network>::TransitionID
pub fn transition_id(&self) -> &<N as Network>::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 as Network>::StateRoot
pub const fn global_state_root(&self) -> <N as Network>::StateRoot
Returns the global state root.
Methods from Deref<Target = Transition<N>>§
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.
Sourcepub fn to_leaf(
&self,
id: &Field<N>,
is_input: bool,
) -> Result<TransitionLeaf<N>, Error>
pub fn to_leaf( &self, id: &Field<N>, is_input: bool, ) -> Result<TransitionLeaf<N>, Error>
Returns the Merkle leaf for the given input or output ID in the transition.
Sourcepub fn to_tree(
&self,
) -> Result<MerkleTree<N, BHP<N, 8, 54>, BHP<N, 6, 43>, snarkvm_console_program::::state_path::configuration::TransitionTree::{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::TransitionTree::{constant#0}>, Error>
The Merkle tree of input and output IDs for the transition.
Sourcepub fn id(&self) -> &<N as Network>::TransitionID
pub fn id(&self) -> &<N as Network>::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_credits(&self) -> bool
pub fn is_credits(&self) -> bool
Returns true
if this is a credits.aleo/*
transition.
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 is_upgrade(&self) -> bool
pub fn is_upgrade(&self) -> bool
Returns true
if this is an upgrade
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
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.
Trait Implementations§
Source§impl<'de, N> Deserialize<'de> for Fee<N>where
N: Network,
impl<'de, N> Deserialize<'de> for Fee<N>where
N: Network,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Fee<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Fee<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserializes the fee from a string or bytes.
Source§impl<N> Serialize for Fee<N>where
N: Network,
impl<N> Serialize for Fee<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 fee into string or bytes.
impl<N> Eq for Fee<N>
impl<N> StructuralPartialEq for Fee<N>where
N: Network,
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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.