Struct chain_impl_mockchain::fee::LinearFee
source · pub struct LinearFee {
pub constant: u64,
pub coefficient: u64,
pub certificate: u64,
pub per_certificate_fees: PerCertificateFee,
pub per_vote_certificate_fees: PerVoteCertificateFee,
}
Expand description
Linear fee using the basic affine formula
COEFFICIENT * bytes(COUNT(tx.inputs) + COUNT(tx.outputs)) + CONSTANT + CERTIFICATE*COUNT(certificates)
.
Fields§
§constant: u64
§coefficient: u64
§certificate: u64
§per_certificate_fees: PerCertificateFee
§per_vote_certificate_fees: PerVoteCertificateFee
Implementations§
source§impl LinearFee
impl LinearFee
pub fn new(constant: u64, coefficient: u64, certificate: u64) -> Self
pub fn per_certificate_fees(&mut self, per_certificate_fees: PerCertificateFee)
pub fn per_vote_certificate_fees( &mut self, per_vote_certificate_fees: PerVoteCertificateFee )
Trait Implementations§
source§impl ConfigParamVariant for LinearFee
impl ConfigParamVariant for LinearFee
source§impl FeeAlgorithm for LinearFee
impl FeeAlgorithm for LinearFee
fn baseline(&self) -> Value
fn fees_for_inputs_outputs(&self, inputs: u8, outputs: u8) -> Value
fn fees_for_certificate(&self, cert_slice: CertificateSlice<'_>) -> Value
fn calculate( &self, cert: Option<CertificateSlice<'_>>, inputs: u8, outputs: u8 ) -> Value
fn calculate_tx<P: Payload>(&self, tx: &TransactionSlice<'_, P>) -> Value
source§impl PartialEq<LinearFee> for LinearFee
impl PartialEq<LinearFee> for LinearFee
source§impl PartialOrd<LinearFee> for LinearFee
impl PartialOrd<LinearFee> for LinearFee
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for LinearFee
impl StructuralEq for LinearFee
impl StructuralPartialEq for LinearFee
Auto Trait Implementations§
impl RefUnwindSafe for LinearFee
impl Send for LinearFee
impl Sync for LinearFee
impl Unpin for LinearFee
impl UnwindSafe for LinearFee
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