pub trait InfoT<T: Config>: Sealed {
Show 18 methods
// Provided methods
fn integrity_test() { ... }
fn next_fee_multiplier() -> FixedU128 { ... }
fn next_fee_multiplier_reciprocal() -> FixedU128 { ... }
fn tx_fee(_len: u32, _call: &<T as Config>::RuntimeCall) -> BalanceOf<T> { ... }
fn tx_fee_from_weight(_encoded_len: u32, _weight: &Weight) -> BalanceOf<T> { ... }
fn fixed_fee(_encoded_len: u32) -> BalanceOf<T> { ... }
fn ensure_not_overdrawn(
_fee: BalanceOf<T>,
result: DispatchResultWithPostInfo,
) -> DispatchResultWithPostInfo { ... }
fn dispatch_info(_call: &<T as Config>::RuntimeCall) -> DispatchInfo { ... }
fn base_dispatch_info(
_call: &mut <T as Config>::RuntimeCall,
) -> DispatchInfo { ... }
fn encoded_len(_eth_transact_call: <T as Config>::RuntimeCall) -> u32 { ... }
fn weight_to_fee(_weight: &Weight) -> BalanceOf<T> { ... }
fn weight_to_fee_average(_weight: &Weight) -> BalanceOf<T> { ... }
fn fee_to_weight(_fee: BalanceOf<T>) -> Weight { ... }
fn length_to_fee(_len: u32) -> BalanceOf<T> { ... }
fn deposit_txfee(
_credit: Credit<<T as Config>::AccountId, <T as Config>::Currency>,
) { ... }
fn withdraw_txfee(
_amount: BalanceOf<T>,
) -> Option<Credit<<T as Config>::AccountId, <T as Config>::Currency>> { ... }
fn remaining_txfee() -> BalanceOf<T> { ... }
fn compute_actual_fee(
_encoded_len: u32,
_info: &DispatchInfo,
_result: &DispatchResultWithPostInfo,
) -> BalanceOf<T> { ... }
}Expand description
A trait that exposes all the transaction payment details to pallet_revive.
This trait is sealed. Use Info.
Provided Methods§
Sourcefn integrity_test()
fn integrity_test()
Check that the fee configuration of the chain is valid.
This is being called by the pallets integrity_check.
Sourcefn next_fee_multiplier() -> FixedU128
fn next_fee_multiplier() -> FixedU128
Exposes the current fee multiplier of the chain.
Sourcefn next_fee_multiplier_reciprocal() -> FixedU128
fn next_fee_multiplier_reciprocal() -> FixedU128
The reciprocal of the next fee multiplier.
Needed when dividing a fee by the multiplier before presenting it to the eth wallet as gas. Needed because the wallet will multiply it with the gas_price which includes this multiplicator.
Sourcefn tx_fee(_len: u32, _call: &<T as Config>::RuntimeCall) -> BalanceOf<T>
fn tx_fee(_len: u32, _call: &<T as Config>::RuntimeCall) -> BalanceOf<T>
Calculate the fee of a transaction including the next fee multiplier adjustment.
Sourcefn tx_fee_from_weight(_encoded_len: u32, _weight: &Weight) -> BalanceOf<T>
fn tx_fee_from_weight(_encoded_len: u32, _weight: &Weight) -> BalanceOf<T>
Calculate the fee using the weight instead of a dispatch info.
Sourcefn ensure_not_overdrawn(
_fee: BalanceOf<T>,
result: DispatchResultWithPostInfo,
) -> DispatchResultWithPostInfo
fn ensure_not_overdrawn( _fee: BalanceOf<T>, result: DispatchResultWithPostInfo, ) -> DispatchResultWithPostInfo
Makes sure that not too much storage deposit was withdrawn.
Sourcefn dispatch_info(_call: &<T as Config>::RuntimeCall) -> DispatchInfo
fn dispatch_info(_call: &<T as Config>::RuntimeCall) -> DispatchInfo
Get the dispatch info of a call with the proper extension weight set.
Sourcefn base_dispatch_info(_call: &mut <T as Config>::RuntimeCall) -> DispatchInfo
fn base_dispatch_info(_call: &mut <T as Config>::RuntimeCall) -> DispatchInfo
The dispatch info with the weight argument set to 0.
Sourcefn encoded_len(_eth_transact_call: <T as Config>::RuntimeCall) -> u32
fn encoded_len(_eth_transact_call: <T as Config>::RuntimeCall) -> u32
Calculate the encoded length of a call.
Sourcefn weight_to_fee(_weight: &Weight) -> BalanceOf<T>
fn weight_to_fee(_weight: &Weight) -> BalanceOf<T>
Convert a weight to an unadjusted fee.
Sourcefn weight_to_fee_average(_weight: &Weight) -> BalanceOf<T>
fn weight_to_fee_average(_weight: &Weight) -> BalanceOf<T>
Convert a weight to an unadjusted fee using an average instead of maximum.
Sourcefn fee_to_weight(_fee: BalanceOf<T>) -> Weight
fn fee_to_weight(_fee: BalanceOf<T>) -> Weight
Convert an unadjusted fee back to a weight.
Sourcefn length_to_fee(_len: u32) -> BalanceOf<T>
fn length_to_fee(_len: u32) -> BalanceOf<T>
Convert the length of a transaction to an unadjusted weight.
Sourcefn deposit_txfee(
_credit: Credit<<T as Config>::AccountId, <T as Config>::Currency>,
)
fn deposit_txfee( _credit: Credit<<T as Config>::AccountId, <T as Config>::Currency>, )
Add some additional fee to the pallet_transaction_payment credit.
Sourcefn withdraw_txfee(
_amount: BalanceOf<T>,
) -> Option<Credit<<T as Config>::AccountId, <T as Config>::Currency>>
fn withdraw_txfee( _amount: BalanceOf<T>, ) -> Option<Credit<<T as Config>::AccountId, <T as Config>::Currency>>
Withdraw some fee to pay for storage deposits.
Sourcefn remaining_txfee() -> BalanceOf<T>
fn remaining_txfee() -> BalanceOf<T>
Return the remaining transaction fee.
Sourcefn compute_actual_fee(
_encoded_len: u32,
_info: &DispatchInfo,
_result: &DispatchResultWithPostInfo,
) -> BalanceOf<T>
fn compute_actual_fee( _encoded_len: u32, _info: &DispatchInfo, _result: &DispatchResultWithPostInfo, ) -> BalanceOf<T>
Compute the actual post_dispatch fee
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.