Transaction payment runtime api: query call info and fee details (#11819)

* Transaction payment RPC calls: query call info

* transaction payment pallet - runtime api - add query_call info and fee_details

* remove unused deps

* separate call runtime api

* undo fmt for unchanged code

* system config call bounded to GetDispatchInfo, drop Call generic for query call info/fee

* impl GetDispatchInfo for Extrinsics within runtime test-utils

* introduced runtime api methods accept encoded Call instead of Call type

* replace Bytes by Vec, docs for for new api, drop len argument, drop GetDispatchInfo bound from system_Config::Call

* clean up toml and extra impl for dropped bound

* panic if Call can not be decoded

* revert to d43ba2f

* fmt and docs

* rustfmt
This commit is contained in:
Muharem Ismailov
2022-08-10 12:36:16 +02:00
committed by GitHub
parent 85e2092d8f
commit e41b90910e
4 changed files with 103 additions and 0 deletions
@@ -31,4 +31,16 @@ sp_api::decl_runtime_apis! {
fn query_info(uxt: Block::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance>;
fn query_fee_details(uxt: Block::Extrinsic, len: u32) -> FeeDetails<Balance>;
}
pub trait TransactionPaymentCallApi<Balance, Call>
where
Balance: Codec + MaybeDisplay,
Call: Codec,
{
/// Query information of a dispatch class, weight, and fee of a given encoded `Call`.
fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo<Balance>;
/// Query fee details of a given encoded `Call`.
fn query_call_fee_details(call: Call, len: u32) -> FeeDetails<Balance>;
}
}