pub type TransactionPayment = Pallet<Runtime>;
Expand description
Provides the ability to charge for extrinsic execution.
Aliased Type§
struct TransactionPayment(/* private fields */);
Implementations
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn next_fee_multiplier() -> FixedU128
pub fn next_fee_multiplier() -> FixedU128
Public function to access the next fee multiplier.
Sourcepub fn query_info<Extrinsic>(
unchecked_extrinsic: Extrinsic,
len: u32,
) -> RuntimeDispatchInfo<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>where
Extrinsic: ExtrinsicLike + GetDispatchInfo,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo>,
pub fn query_info<Extrinsic>(
unchecked_extrinsic: Extrinsic,
len: u32,
) -> RuntimeDispatchInfo<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>where
Extrinsic: ExtrinsicLike + GetDispatchInfo,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo>,
Query the data that we know about the fee of a given call
.
This pallet is not and cannot be aware of the internals of a signed extension, for example a tip. It only interprets the extrinsic as some encoded value and accounts for its weight and length, the runtime’s extrinsic base weight, and the current fee multiplier.
All dispatchables must be annotated with weight and will have some fee info. This function always returns.
Sourcepub fn query_fee_details<Extrinsic>(
unchecked_extrinsic: Extrinsic,
len: u32,
) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>where
Extrinsic: ExtrinsicLike + GetDispatchInfo,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo>,
pub fn query_fee_details<Extrinsic>(
unchecked_extrinsic: Extrinsic,
len: u32,
) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>where
Extrinsic: ExtrinsicLike + GetDispatchInfo,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo>,
Query the detailed fee of a given call
.
Sourcepub fn query_call_info(
call: <T as Config>::RuntimeCall,
len: u32,
) -> RuntimeDispatchInfo<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
pub fn query_call_info( call: <T as Config>::RuntimeCall, len: u32, ) -> RuntimeDispatchInfo<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
Query information of a dispatch class, weight, and fee of a given encoded Call
.
Sourcepub fn query_call_fee_details(
call: <T as Config>::RuntimeCall,
len: u32,
) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
pub fn query_call_fee_details( call: <T as Config>::RuntimeCall, len: u32, ) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
Query fee details of a given encoded Call
.
Sourcepub fn compute_fee(
len: u32,
info: &<<T as Config>::RuntimeCall as Dispatchable>::Info,
tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance,
) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
pub fn compute_fee( len: u32, info: &<<T as Config>::RuntimeCall as Dispatchable>::Info, tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance, ) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
Compute the final fee value for a particular transaction.
Sourcepub fn compute_fee_details(
len: u32,
info: &<<T as Config>::RuntimeCall as Dispatchable>::Info,
tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance,
) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
pub fn compute_fee_details( len: u32, info: &<<T as Config>::RuntimeCall as Dispatchable>::Info, tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance, ) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
Compute the fee details for a particular transaction.
Sourcepub fn compute_actual_fee(
len: u32,
info: &<<T as Config>::RuntimeCall as Dispatchable>::Info,
post_info: &<<T as Config>::RuntimeCall as Dispatchable>::PostInfo,
tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance,
) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
pub fn compute_actual_fee( len: u32, info: &<<T as Config>::RuntimeCall as Dispatchable>::Info, post_info: &<<T as Config>::RuntimeCall as Dispatchable>::PostInfo, tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance, ) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
Compute the actual post dispatch fee for a particular transaction.
Identical to compute_fee
with the only difference that the post dispatch corrected
weight is used for the weight fee calculation.
Sourcepub fn compute_actual_fee_details(
len: u32,
info: &<<T as Config>::RuntimeCall as Dispatchable>::Info,
post_info: &<<T as Config>::RuntimeCall as Dispatchable>::PostInfo,
tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance,
) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
pub fn compute_actual_fee_details( len: u32, info: &<<T as Config>::RuntimeCall as Dispatchable>::Info, post_info: &<<T as Config>::RuntimeCall as Dispatchable>::PostInfo, tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance, ) -> FeeDetails<<<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance>
Compute the actual post dispatch fee details for a particular transaction.
Sourcepub fn length_to_fee(
length: u32,
) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
pub fn length_to_fee( length: u32, ) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
Compute the length portion of a fee by invoking the configured LengthToFee
impl.
Sourcepub fn weight_to_fee(
weight: Weight,
) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
pub fn weight_to_fee( weight: Weight, ) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
Compute the unadjusted portion of the weight fee by invoking the configured WeightToFee
impl. Note that the input weight
is capped by the maximum block weight before computation.
Sourcepub fn deposit_fee_paid_event(
who: <T as Config>::AccountId,
actual_fee: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance,
tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance,
)
pub fn deposit_fee_paid_event( who: <T as Config>::AccountId, actual_fee: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance, tip: <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance, )
Deposit the Event::TransactionFeePaid
event.
Trait Implementations
Source§impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T> Benchmarking for Pallet<T>where
T: Config + Config,
<T as Config>::RuntimeOrigin: AsTransactionAuthorizedOrigin,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
impl<T> Benchmarking for Pallet<T>where
T: Config + Config,
<T as Config>::RuntimeOrigin: AsTransactionAuthorizedOrigin,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
Source§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T> Convert<Weight, <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance> for Pallet<T>where
T: Config,
impl<T> Convert<Weight, <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance> for Pallet<T>where
T: Config,
Source§fn convert(
weight: Weight,
) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
fn convert( weight: Weight, ) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
Compute the fee for the specified weight.
This fee is already adjusted by the per block fee adjustment factor and is therefore the share that the weight contributes to the overall fee of a transaction. It is mainly for informational purposes and not used in the actual fee calculation.
Source§impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T, AnyCall> EstimateCallFee<AnyCall, <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance> for Pallet<T>where
T: Config,
AnyCall: GetDispatchInfo + Encode,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
impl<T, AnyCall> EstimateCallFee<AnyCall, <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance> for Pallet<T>where
T: Config,
AnyCall: GetDispatchInfo + Encode,
<T as Config>::RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
Source§fn estimate_call_fee(
call: &AnyCall,
post_info: PostDispatchInfo,
) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
fn estimate_call_fee( call: &AnyCall, post_info: PostDispatchInfo, ) -> <<T as Config>::OnChargeTransaction as OnChargeTransaction<T>>::Balance
Source§impl<T> GetStorageVersion for Pallet<T>where
T: Config,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
Source§fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
instead. Read moreSource§impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_finalize(
_: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( _: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Source§fn integrity_test()
fn integrity_test()
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§impl<T> IntegrityTest for Pallet<T>where
T: Config,
impl<T> IntegrityTest for Pallet<T>where
T: Config,
Source§impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T> OnGenesis for Pallet<T>where
T: Config,
impl<T> OnGenesis for Pallet<T>where
T: Config,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
Source§impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.