This commit is contained in:
Xiliang Chen
2020-06-17 22:23:15 +12:00
committed by GitHub
parent 825b4b4b34
commit 43d99bf24b
3 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -29,6 +29,7 @@ use sp_consensus_babe::BabeApi;
use sc_client_api::light::{Fetcher, RemoteBlockchain};
use sc_consensus_babe::Epoch;
use sc_rpc::DenyUnsafe;
use sp_block_builder::BlockBuilder;
/// A type representing all RPC extensions.
pub type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
@@ -87,6 +88,7 @@ pub fn create_full<C, P, UE, SC>(deps: FullDeps<C, P, SC>) -> RpcExtension where
C::Api: frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance, UE>,
C::Api: BabeApi<Block>,
C::Api: BlockBuilder<Block>,
P: TransactionPool + Sync + Send + 'static,
UE: codec::Codec + Send + Sync + 'static,
SC: SelectChain<Block> + 'static,
@@ -116,7 +118,7 @@ pub fn create_full<C, P, UE, SC>(deps: FullDeps<C, P, SC>) -> RpcExtension where
} = grandpa;
io.extend_with(
SystemApi::to_delegate(FullSystem::new(client.clone(), pool))
SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))
);
io.extend_with(
TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))
@@ -164,7 +166,7 @@ pub fn create_light<C, P, F, UE>(deps: LightDeps<C, F, P>) -> RpcExtension
} = deps;
let mut io = jsonrpc_core::IoHandler::default();
io.extend_with(
SystemApi::<AccountId, Nonce>::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool))
SystemApi::<Hash, AccountId, Nonce>::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool))
);
io
}