From 77d537ff25d36899ddb0ae50a42f285e5bc9478d Mon Sep 17 00:00:00 2001 From: Vadim Smirnov Date: Mon, 9 Oct 2023 10:44:41 +0500 Subject: [PATCH] feat(vara): add TransactionPaymentCallApi (#3393) --- runtime/vara/src/lib.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/runtime/vara/src/lib.rs b/runtime/vara/src/lib.rs index e3d33b36656..76635c44a70 100644 --- a/runtime/vara/src/lib.rs +++ b/runtime/vara/src/lib.rs @@ -63,7 +63,9 @@ use pallet_grandpa::{ use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use pallet_session::historical::{self as pallet_session_historical}; pub use pallet_timestamp::Call as TimestampCall; -pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier}; +pub use pallet_transaction_payment::{ + CurrencyAdapter, FeeDetails, Multiplier, RuntimeDispatchInfo, +}; use runtime_common::constants::BANK_ADDRESS; pub use runtime_common::{ constants::{ @@ -1356,6 +1358,23 @@ impl_runtime_apis_plus_common! { } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi + for Runtime + { + fn query_call_info(call: RuntimeCall, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_call_info(call, len) + } + fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails { + TransactionPayment::query_call_fee_details(call, len) + } + fn query_weight_to_fee(weight: Weight) -> Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> Balance { + TransactionPayment::length_to_fee(length) + } + } + impl pallet_nomination_pools_runtime_api::NominationPoolsApi< Block, AccountId,