13110 Companion: Add WeightToFee and LengthToFee Runtime API (#6536)

* Add WeightToFee runtime API impls

* Forgot a couple

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use master Cargo.lock

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Stephen Shelton
2023-01-27 10:03:08 -07:00
committed by GitHub
parent 781b90eb39
commit af74f43413
6 changed files with 240 additions and 186 deletions
+186 -186
View File
File diff suppressed because it is too large Load Diff
+12
View File
@@ -1891,6 +1891,12 @@ sp_api::impl_runtime_apis! {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> { fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len) 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> impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
@@ -1902,6 +1908,12 @@ sp_api::impl_runtime_apis! {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> { fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len) 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< impl pallet_nomination_pools_runtime_api::NominationPoolsApi<
+12
View File
@@ -2009,6 +2009,12 @@ sp_api::impl_runtime_apis! {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> { fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len) 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> impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
@@ -2020,6 +2026,12 @@ sp_api::impl_runtime_apis! {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> { fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len) 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")] #[cfg(feature = "try-runtime")]
+6
View File
@@ -1919,6 +1919,12 @@ sp_api::impl_runtime_apis! {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> { fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len) 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 beefy_merkle_tree::BeefyMmrApi<Block, Hash> for RuntimeApi { impl beefy_merkle_tree::BeefyMmrApi<Block, Hash> for RuntimeApi {
+12
View File
@@ -1028,6 +1028,12 @@ sp_api::impl_runtime_apis! {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> { fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len) 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> impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
@@ -1039,6 +1045,12 @@ sp_api::impl_runtime_apis! {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> { fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len) 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 crate::GetLastTimestamp<Block> for Runtime { impl crate::GetLastTimestamp<Block> for Runtime {
+12
View File
@@ -1636,6 +1636,12 @@ sp_api::impl_runtime_apis! {
fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> { fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_fee_details(uxt, len) 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> impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
@@ -1647,6 +1653,12 @@ sp_api::impl_runtime_apis! {
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> { fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len) 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< impl pallet_nomination_pools_runtime_api::NominationPoolsApi<