From b8c957d31a68e395a5c5023a58b15ee4a1d22f7d Mon Sep 17 00:00:00 2001 From: Muharem Ismailov Date: Mon, 15 Aug 2022 14:39:01 +0200 Subject: [PATCH] Transaction payment runtime apis: query call info and fee details (#5871) --- runtime/kusama/src/lib.rs | 11 +++++++++++ runtime/polkadot/src/lib.rs | 11 +++++++++++ runtime/rococo/src/lib.rs | 11 +++++++++++ runtime/test-runtime/src/lib.rs | 11 +++++++++++ runtime/westend/src/lib.rs | 11 +++++++++++ 5 files changed, 55 insertions(+) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 32aaf386c089..511e7d1e69a8 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -1999,6 +1999,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl pallet_nomination_pools_runtime_api::NominationPoolsApi< Block, AccountId, diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index b3e8ec1a9ce8..9489df9f403c 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -1970,6 +1970,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (Weight, Weight) { diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 8a3b97159822..86582ea05a3d 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -1322,6 +1322,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index a27e8635100d..d18a2c9bb95c 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -1065,6 +1065,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl crate::GetLastTimestamp for Runtime { fn get_last_timestamp() -> u64 { Timestamp::now() diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index ce4df1846e30..788aede78092 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1561,6 +1561,17 @@ sp_api::impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: Call, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + } + impl pallet_nomination_pools_runtime_api::NominationPoolsApi< Block, AccountId,