referrerpolicy=no-referrer-when-downgrade

Trait InfoT

Source
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§

Source

fn integrity_test()

Check that the fee configuration of the chain is valid.

This is being called by the pallets integrity_check.

Source

fn next_fee_multiplier() -> FixedU128

Exposes the current fee multiplier of the chain.

Source

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.

Source

fn tx_fee(_len: u32, _call: &<T as Config>::RuntimeCall) -> BalanceOf<T>

Calculate the fee of a transaction including the next fee multiplier adjustment.

Source

fn tx_fee_from_weight(_encoded_len: u32, _weight: &Weight) -> BalanceOf<T>

Calculate the fee using the weight instead of a dispatch info.

Source

fn fixed_fee(_encoded_len: u32) -> BalanceOf<T>

The base extrinsic and len fee.

Source

fn ensure_not_overdrawn( _fee: BalanceOf<T>, result: DispatchResultWithPostInfo, ) -> DispatchResultWithPostInfo

Makes sure that not too much storage deposit was withdrawn.

Source

fn dispatch_info(_call: &<T as Config>::RuntimeCall) -> DispatchInfo

Get the dispatch info of a call with the proper extension weight set.

Source

fn base_dispatch_info(_call: &mut <T as Config>::RuntimeCall) -> DispatchInfo

The dispatch info with the weight argument set to 0.

Source

fn encoded_len(_eth_transact_call: <T as Config>::RuntimeCall) -> u32

Calculate the encoded length of a call.

Source

fn weight_to_fee(_weight: &Weight) -> BalanceOf<T>

Convert a weight to an unadjusted fee.

Source

fn weight_to_fee_average(_weight: &Weight) -> BalanceOf<T>

Convert a weight to an unadjusted fee using an average instead of maximum.

Source

fn fee_to_weight(_fee: BalanceOf<T>) -> Weight

Convert an unadjusted fee back to a weight.

Source

fn length_to_fee(_len: u32) -> BalanceOf<T>

Convert the length of a transaction to an unadjusted weight.

Source

fn deposit_txfee( _credit: Credit<<T as Config>::AccountId, <T as Config>::Currency>, )

Add some additional fee to the pallet_transaction_payment credit.

Source

fn withdraw_txfee( _amount: BalanceOf<T>, ) -> Option<Credit<<T as Config>::AccountId, <T as Config>::Currency>>

Withdraw some fee to pay for storage deposits.

Source

fn remaining_txfee() -> BalanceOf<T>

Return the remaining transaction fee.

Source

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.

Implementations on Foreign Types§

Source§

impl<T: Config> InfoT<T> for ()

Implementors§

Source§

impl<const P: u128, const Q: u128, Address, Signature, E: EthExtra> InfoT<<E as EthExtra>::Config> for Info<Address, Signature, E>
where E::Config: TxConfig<WeightToFee = BlockRatioFee<P, Q, E::Config>>, BalanceOf<E::Config>: From<<<E::Config as Config>::OnChargeTransaction as OnChargeTransaction<E::Config>>::Balance>, <E::Config as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>, <E::Config as Config>::RuntimeCall: SetWeightLimit, <<E::Config as SysConfig>::Block as BlockT>::Extrinsic: From<UncheckedExtrinsic<Address, <E::Config as Config>::RuntimeCall, Signature, E::Extension>>, <<E::Config as TxConfig>::OnChargeTransaction as TxCreditHold<E::Config>>::Credit: SuppressedDrop<Inner = Credit<<E::Config as Config>::AccountId, <E::Config as Config>::Currency>>,