diff --git a/Cargo.lock b/Cargo.lock index 7a8a24bee5c7..5ae85763f2e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4296,6 +4296,7 @@ dependencies = [ "sc-keystore", "sc-rpc", "sp-api", + "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 8ec6bda43ecd..5ef64a3334ad 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -24,3 +24,4 @@ txpool-api = { package = "sp-transaction-pool", git = "https://github.com/parity frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" } codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/rpc/src/lib.rs b/rpc/src/lib.rs index c3608d6342a2..6bddc8ad8daf 100644 --- a/rpc/src/lib.rs +++ b/rpc/src/lib.rs @@ -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; @@ -87,6 +88,7 @@ pub fn create_full(deps: FullDeps) -> RpcExtension where C::Api: frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BabeApi, + C::Api: BlockBuilder, P: TransactionPool + Sync + Send + 'static, UE: codec::Codec + Send + Sync + 'static, SC: SelectChain + 'static, @@ -116,7 +118,7 @@ pub fn create_full(deps: FullDeps) -> 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(deps: LightDeps) -> RpcExtension } = deps; let mut io = jsonrpc_core::IoHandler::default(); io.extend_with( - SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool)) + SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool)) ); io }