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) -> LinearFee
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 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>(&self, tx: &TransactionSlice<'_, P>) -> Valuewhere P: Payload,
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request