Calculate Fees
Goal
Use Cases
Steps
1. Write the LinearWeightToFee struct
LinearWeightToFee structpub struct LinearWeightToFee<C>(sp_std::marker::PhantomData<C>);
impl<C> WeightToFeePolynomial for LinearWeightToFee<C>
where
C: Get<Balance>,
{
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
let coefficient = WeightToFeeCoefficient {
coeff_integer: C::get(),
coeff_frac: Perbill::zero(),
negative: false,
degree: 1,
};
smallvec!(coefficient)
}
}2. Configure pallet_transaction_payment in your runtime
pallet_transaction_payment in your runtimeRelated material
Last updated