Skip to content

Commit 93797e8

Browse files
syan095Roy Yang
andauthored
Added a new RPC call for dev: get block stats (#2122)
Co-authored-by: Roy Yang <roy@laminar.one>
1 parent 84734f0 commit 93797e8

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

rpc/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
use primitives::{AccountId, Balance, Block, CurrencyId, DataProviderId, Hash, Nonce};
2424
use sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApi};
25-
pub use sc_rpc_api::DenyUnsafe;
25+
pub use sc_rpc::dev::Dev;
26+
pub use sc_rpc_api::{dev::DevApi, DenyUnsafe};
2627
use sc_transaction_pool_api::TransactionPool;
2728
use sp_api::ProvideRuntimeApi;
2829
use sp_block_builder::BlockBuilder;
@@ -51,7 +52,7 @@ pub struct FullDeps<C, P> {
5152
/// Instantiate all Full RPC extensions.
5253
pub fn create_full<C, P>(deps: FullDeps<C, P>) -> RpcExtension
5354
where
54-
C: ProvideRuntimeApi<Block>,
55+
C: ProvideRuntimeApi<Block> + sc_client_api::BlockBackend<Block>,
5556
C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,
5657
C: Send + Sync + 'static,
5758
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
@@ -88,7 +89,8 @@ where
8889
// These RPCs should use an asynchronous caller instead.
8990
io.extend_with(OracleApi::to_delegate(Oracle::new(client.clone())));
9091
io.extend_with(TokensApi::to_delegate(Tokens::new(client.clone())));
91-
io.extend_with(EVMApiServer::to_delegate(EVMApi::new(client, deny_unsafe)));
92+
io.extend_with(EVMApiServer::to_delegate(EVMApi::new(client.clone(), deny_unsafe)));
93+
io.extend_with(DevApi::to_delegate(Dev::new(client, deny_unsafe)));
9294

9395
if let Some(command_sink) = command_sink {
9496
io.extend_with(

0 commit comments

Comments
 (0)