Struct phoenix_core::fee::Fee

source ·
pub struct Fee {
    pub gas_limit: u64,
    pub gas_price: u64,
    /* private fields */
}
Expand description

The Fee structure

Fields§

§gas_limit: u64

The gas limit set for the fee

§gas_price: u64

the gas price set for the fee

Implementations§

source§

impl Fee

source

pub fn new<R: RngCore + CryptoRng>( rng: &mut R, gas_limit: u64, gas_price: u64, psk: &PublicSpendKey ) -> Self

Create a new Fee with inner randomness

source

pub fn deterministic( gas_limit: u64, gas_price: u64, r: &JubJubScalar, psk: &PublicSpendKey ) -> Self

Create a new Fee without inner randomness

source

pub fn hash(&self) -> BlsScalar

Return a hash represented by H(gas_limit, gas_price, H([pskr]))

source

pub fn gen_remainder(&self, gas_consumed: u64) -> Remainder

Generates a remainder from the fee and the given gas consumed

Trait Implementations§

source§

impl Clone for Fee

source§

fn clone(&self) -> Fee

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Fee

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ownable for Fee

source§

fn stealth_address(&self) -> &StealthAddress

Returns the associated StealthAddress
source§

impl PartialEq<Fee> for Fee

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serializable<{ 8 * 2 + StealthAddress::SIZE }> for Fee

source§

fn to_bytes(&self) -> [u8; 80]

Converts a Fee into it’s byte representation

source§

fn from_bytes(bytes: &[u8; 80]) -> Result<Self, Self::Error>

Attempts to convert a byte representation of a note into a Note, failing if the input is invalid

§

type Error = Error

The type returned in the event of a conversion error.
source§

const SIZE: usize = N

The size of
source§

impl Copy for Fee

source§

impl Eq for Fee

Auto Trait Implementations§

§

impl RefUnwindSafe for Fee

§

impl Send for Fee

§

impl Sync for Fee

§

impl Unpin for Fee

§

impl UnwindSafe for Fee

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, const N: usize> DeserializableSlice<N> for Twhere T: Serializable<N>,

source§

fn from_slice(buf: &[u8]) -> Result<Self, Self::Error>where Self: Sized, Self::Error: BadLength,

Deserialize a slice of u8 into Self
source§

fn from_reader<R>(buf: &mut R) -> Result<Self, Self::Error>where R: Read, Self: Sized, Self::Error: BadLength,

Deserialize the type reading the bytes from a reader. The bytes read are removed from the reader.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, const N: usize> ParseHexStr<N> for Twhere T: Serializable<N>,

source§

fn from_hex_str(s: &str) -> Result<Self, Self::Error>where Self: Sized, Self::Error: BadLength + InvalidChar,

Parse a string slice as bytes hex representation and returns `
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.