diff --git a/bridges/bin/millau/node/Cargo.toml b/bridges/bin/millau/node/Cargo.toml index e035bbd224..9684799f2f 100644 --- a/bridges/bin/millau/node/Cargo.toml +++ b/bridges/bin/millau/node/Cargo.toml @@ -27,6 +27,7 @@ pallet-message-lane-rpc = { path = "../../../modules/message-lane/rpc" } frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "master" } frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "master" } node-inspect = { git = "https://github.com/paritytech/substrate.git", branch = "master" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "master" } sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "master" } sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = "master", features = ["wasmtime"] } sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "master" } diff --git a/bridges/bin/millau/node/src/service.rs b/bridges/bin/millau/node/src/service.rs index 2f72e5717f..0729353af3 100644 --- a/bridges/bin/millau/node/src/service.rs +++ b/bridges/bin/millau/node/src/service.rs @@ -224,6 +224,7 @@ pub fn new_full(mut config: Configuration) -> Result } use pallet_message_lane_rpc::{MessageLaneApi, MessageLaneRpcHandler}; + use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; use sc_finality_grandpa_rpc::{GrandpaApi, GrandpaRpcHandler}; use sc_rpc::DenyUnsafe; use substrate_frame_rpc_system::{FullSystem, SystemApi}; @@ -246,6 +247,9 @@ pub fn new_full(mut config: Configuration) -> Result pool.clone(), DenyUnsafe::No, ))); + io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new( + client.clone(), + ))); io.extend_with(GrandpaApi::to_delegate(GrandpaRpcHandler::new( shared_authority_set.clone(), shared_voter_state.clone(), @@ -257,7 +261,6 @@ pub fn new_full(mut config: Configuration) -> Result backend.clone(), Arc::new(MillauMessageLaneKeys), ))); - io }) }; diff --git a/bridges/bin/millau/runtime/Cargo.toml b/bridges/bin/millau/runtime/Cargo.toml index 58ce4f127a..204beee998 100644 --- a/bridges/bin/millau/runtime/Cargo.toml +++ b/bridges/bin/millau/runtime/Cargo.toml @@ -40,6 +40,7 @@ pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false } sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } @@ -84,6 +85,7 @@ std = [ "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment/std", + "pallet-transaction-payment-rpc-runtime-api/std", "serde", "sp-api/std", "sp-block-builder/std", diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index 0add4f3235..d1ef18eb3c 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -37,6 +37,7 @@ use crate::rialto_messages::{ToRialtoMessagePayload, WithRialtoMessageBridge}; use bridge_runtime_common::messages::{source::estimate_message_dispatch_and_delivery_fee, MessageBridge}; use codec::Decode; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; +use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -494,6 +495,18 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< + Block, + Balance, + > for Runtime { + fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + fn query_fee_details(uxt: ::Extrinsic, len: u32) -> FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } + } + impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec { SessionKeys::generate(seed) diff --git a/bridges/bin/rialto/node/Cargo.toml b/bridges/bin/rialto/node/Cargo.toml index 9d3e3fc16c..e8095543ee 100644 --- a/bridges/bin/rialto/node/Cargo.toml +++ b/bridges/bin/rialto/node/Cargo.toml @@ -27,6 +27,7 @@ rialto-runtime = { path = "../runtime" } frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "master" } frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "master" } node-inspect = { git = "https://github.com/paritytech/substrate.git", branch = "master" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "master" } sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "master" } sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = "master", features = ["wasmtime"] } sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "master" } diff --git a/bridges/bin/rialto/node/src/service.rs b/bridges/bin/rialto/node/src/service.rs index 67ca185137..5c5ff92e88 100644 --- a/bridges/bin/rialto/node/src/service.rs +++ b/bridges/bin/rialto/node/src/service.rs @@ -224,6 +224,7 @@ pub fn new_full(mut config: Configuration) -> Result } use pallet_message_lane_rpc::{MessageLaneApi, MessageLaneRpcHandler}; + use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; use sc_finality_grandpa_rpc::{GrandpaApi, GrandpaRpcHandler}; use sc_rpc::DenyUnsafe; use substrate_frame_rpc_system::{FullSystem, SystemApi}; @@ -246,6 +247,9 @@ pub fn new_full(mut config: Configuration) -> Result pool.clone(), DenyUnsafe::No, ))); + io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new( + client.clone(), + ))); io.extend_with(GrandpaApi::to_delegate(GrandpaRpcHandler::new( shared_authority_set.clone(), shared_voter_state.clone(), diff --git a/bridges/bin/rialto/runtime/Cargo.toml b/bridges/bin/rialto/runtime/Cargo.toml index d69e241870..d93f5d2b0a 100644 --- a/bridges/bin/rialto/runtime/Cargo.toml +++ b/bridges/bin/rialto/runtime/Cargo.toml @@ -48,6 +48,7 @@ pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false } sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "master" , default-features = false } @@ -102,6 +103,7 @@ std = [ "pallet-sudo/std", "pallet-timestamp/std", "pallet-transaction-payment/std", + "pallet-transaction-payment-rpc-runtime-api/std", "serde", "sp-api/std", "sp-block-builder/std", diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index 18c88a1886..6410e82422 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -43,6 +43,7 @@ use crate::millau_messages::{ToMillauMessagePayload, WithMillauMessageBridge}; use bridge_runtime_common::messages::{source::estimate_message_dispatch_and_delivery_fee, MessageBridge}; use codec::Decode; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList}; +use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -691,6 +692,18 @@ impl_runtime_apis! { } } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< + Block, + Balance, + > for Runtime { + fn query_info(uxt: ::Extrinsic, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + fn query_fee_details(uxt: ::Extrinsic, len: u32) -> FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } + } + impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec { SessionKeys::generate(seed)