mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 09:47:56 +00:00
RPC to query transaction fee + weight + info (#3876)
* initial version for testing * New version that compiles * optional at block parameter * Fix some more view grumbles. * Update srml/transaction-payment/src/lib.rs
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use node_primitives::{Block, AccountId, Index, Balance};
|
||||
use node_runtime::UncheckedExtrinsic;
|
||||
use sr_primitives::traits::ProvideRuntimeApi;
|
||||
use transaction_pool::txpool::{ChainApi, Pool};
|
||||
|
||||
@@ -42,18 +43,23 @@ pub fn create<C, P, M>(client: Arc<C>, pool: Arc<Pool<P>>) -> jsonrpc_core::IoHa
|
||||
C: Send + Sync + 'static,
|
||||
C::Api: srml_system_rpc::AccountNonceApi<Block, AccountId, Index>,
|
||||
C::Api: srml_contracts_rpc::ContractsRuntimeApi<Block, AccountId, Balance>,
|
||||
C::Api: srml_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance, UncheckedExtrinsic>,
|
||||
P: ChainApi + Sync + Send + 'static,
|
||||
M: jsonrpc_core::Metadata + Default,
|
||||
{
|
||||
use srml_system_rpc::{System, SystemApi};
|
||||
use srml_contracts_rpc::{Contracts, ContractsApi};
|
||||
use srml_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
|
||||
|
||||
let mut io = jsonrpc_core::IoHandler::default();
|
||||
io.extend_with(
|
||||
SystemApi::to_delegate(System::new(client.clone(), pool))
|
||||
);
|
||||
io.extend_with(
|
||||
ContractsApi::to_delegate(Contracts::new(client))
|
||||
ContractsApi::to_delegate(Contracts::new(client.clone()))
|
||||
);
|
||||
io.extend_with(
|
||||
TransactionPaymentApi::to_delegate(TransactionPayment::new(client))
|
||||
);
|
||||
io
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user