Skip to content

Commit

Permalink
13110 Companion: Add WeightToFee and LengthToFee Runtime API (#6536)
Browse files Browse the repository at this point in the history
* Add WeightToFee runtime API impls

* Forgot a couple

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use master Cargo.lock

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
notlesh and ggwpez authored Jan 27, 2023
1 parent 1ee714a commit 28d98bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1891,6 +1891,12 @@ sp_api::impl_runtime_apis! {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, 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_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
Expand All @@ -1902,6 +1908,12 @@ sp_api::impl_runtime_apis! {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
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<
Expand Down
12 changes: 12 additions & 0 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,12 @@ sp_api::impl_runtime_apis! {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, 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_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
Expand All @@ -2020,6 +2026,12 @@ sp_api::impl_runtime_apis! {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
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)
}
}

#[cfg(feature = "try-runtime")]
Expand Down

0 comments on commit 28d98bf

Please sign in to comment.