Struct grin_core::core::transaction::FeeFields
source · pub struct FeeFields(/* private fields */);
Expand description
Fee fields as in fix-fees RFC: { future_use: 20, fee_shift: 4, fee: 40 }
Implementations§
source§impl FeeFields
impl FeeFields
sourcepub const FEE_SHIFT_BITS: u32 = 4u32
pub const FEE_SHIFT_BITS: u32 = 4u32
Fee shifts are limited to 4 bits
sourcepub const FEE_SHIFT_MASK: u64 = 15u64
pub const FEE_SHIFT_MASK: u64 = 15u64
Used to extract fee_shift field
sourcepub fn new(fee_shift: u64, fee: u64) -> Result<Self, Error>
pub fn new(fee_shift: u64, fee: u64) -> Result<Self, Error>
Create a new FeeFields from the provided shift and fee Checks both are valid (in range)
Trait Implementations§
source§impl<'de> Deserialize<'de> for FeeFields
impl<'de> Deserialize<'de> for FeeFields
source§fn deserialize<D>(deserializer: D) -> Result<FeeFields, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<FeeFields, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<u32> for FeeFields
impl From<u32> for FeeFields
Conversion from a 32-bit fee to a FeeFields with 0 fee_shift For use exclusively in tests with constant fees
source§impl PartialEq for FeeFields
impl PartialEq for FeeFields
source§impl TryFrom<u64> for FeeFields
impl TryFrom<u64> for FeeFields
Conversion from a valid fee to a FeeFields with 0 fee_shift The valid fee range is 1..FEE_MASK
impl Copy for FeeFields
impl DefaultHashable for FeeFields
impl StructuralPartialEq for FeeFields
Auto Trait Implementations§
impl Freeze for FeeFields
impl RefUnwindSafe for FeeFields
impl Send for FeeFields
impl Sync for FeeFields
impl Unpin for FeeFields
impl UnwindSafe for FeeFields
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<D> Hashed for Dwhere
D: DefaultHashable,
impl<D> Hashed for Dwhere
D: DefaultHashable,
source§impl<T> PMMRIndexHashable for Twhere
T: DefaultHashable,
impl<T> PMMRIndexHashable for Twhere
T: DefaultHashable,
source§fn hash_with_index(&self, index: u64) -> Hash
fn hash_with_index(&self, index: u64) -> Hash
Hash with a given index
source§impl<H> ShortIdentifiable for Hwhere
H: Hashed,
impl<H> ShortIdentifiable for Hwhere
H: Hashed,
source§fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId
Generate a short_id via the following -
- extract k0/k1 from block_hash hashed with the nonce (first two u64
values) * initialize a siphasher24 with k0/k1
- self.hash() passing in the siphasher24 instance
- drop the 2 most significant bytes (to return a 6 byte short_id)