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: u64The gas limit set for the fee
gas_price: u64the gas price set for the fee
Implementations§
source§impl Fee
impl Fee
sourcepub fn new<R: RngCore + CryptoRng>(
rng: &mut R,
gas_limit: u64,
gas_price: u64,
psk: &PublicSpendKey
) -> Self
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
sourcepub fn deterministic(
gas_limit: u64,
gas_price: u64,
r: &JubJubScalar,
psk: &PublicSpendKey
) -> Self
pub fn deterministic( gas_limit: u64, gas_price: u64, r: &JubJubScalar, psk: &PublicSpendKey ) -> Self
Create a new Fee without inner randomness
sourcepub fn hash(&self) -> BlsScalar
pub fn hash(&self) -> BlsScalar
Return a hash represented by H(gas_limit, gas_price, H([pskr]))
sourcepub fn gen_remainder(&self, gas_consumed: u64) -> Remainder
pub fn gen_remainder(&self, gas_consumed: u64) -> Remainder
Generates a remainder from the fee and the given gas consumed
Trait Implementations§
source§impl Ownable for Fee
impl Ownable for Fee
source§fn stealth_address(&self) -> &StealthAddress
fn stealth_address(&self) -> &StealthAddress
Returns the associated
StealthAddresssource§impl PartialEq<Fee> for Fee
impl PartialEq<Fee> for Fee
source§impl Serializable<{ 8 * 2 + StealthAddress::SIZE }> for Fee
impl Serializable<{ 8 * 2 + StealthAddress::SIZE }> for Fee
impl Copy for Fee
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> 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
Mutably borrows from an owned value. Read more
source§impl<T, const N: usize> DeserializableSlice<N> for Twhere
T: Serializable<N>,
impl<T, const N: usize> DeserializableSlice<N> for Twhere T: Serializable<N>,
source§impl<T, const N: usize> ParseHexStr<N> for Twhere
T: Serializable<N>,
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,
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 `