referrerpolicy=no-referrer-when-downgrade

EstimateFee

Trait EstimateFee 

Source
pub trait EstimateFee<Balance> {
    // Required method
    fn estimate_fee(len: u32, info: &DispatchInfo) -> Balance;
}
Expand description

Something that can estimate the fee of a (frame-based) call from its encoded length and dispatch info.

A fee depends on only those two things. EstimateCallFee takes the call itself and reads them off it, whereas here they are passed directly. That allows pricing a call that the caller does not have, such as one carrying a maximum-size payload that would be wasteful to build in memory just to measure it.

Required Methods§

Source

fn estimate_fee(len: u32, info: &DispatchInfo) -> Balance

Estimate the fee of a call with the given encoded length and dispatch info.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Balance: From<u32>, const T: u32> EstimateFee<Balance> for ConstU32<T>

Available on crate feature std only.
Source§

impl<Balance: From<u32>, const T: u64> EstimateFee<Balance> for ConstU64<T>

Available on crate feature std only.