mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 06:11:07 +00:00
RpcHandlers Refactorings (#6846)
* allow access to the underlying Pubsub instance from RpcHandlers * bump Cargo.lock * no more Arc<RpcHandlers> * bump Cargo.lock * Debug,. * Arc<RpcHandlers> * RpcHandler * RpcHandlers::io_handler * remove chain spec from cli * address pr comments * remove stray newline Co-authored-by: Ashley <ashley.ruglys@gmail.com> Co-authored-by: Tomasz Drwięga <tomasz@parity.io> Co-authored-by: Ashley <ashley.ruglys@gmail.com>
This commit is contained in:
@@ -96,7 +96,8 @@ impl<T: MallocSizeOf> MallocSizeOfWasm for T {}
|
||||
impl<T> MallocSizeOfWasm for T {}
|
||||
|
||||
/// RPC handlers that can perform RPC queries.
|
||||
pub struct RpcHandlers(sc_rpc_server::RpcHandler<sc_rpc::Metadata>);
|
||||
#[derive(Clone)]
|
||||
pub struct RpcHandlers(Arc<jsonrpc_core::MetaIoHandler<sc_rpc::Metadata>>);
|
||||
|
||||
impl RpcHandlers {
|
||||
/// Starts an RPC query.
|
||||
@@ -115,6 +116,11 @@ impl RpcHandlers {
|
||||
.map(|res| res.expect("this should never fail"))
|
||||
.boxed()
|
||||
}
|
||||
|
||||
/// Provides access to the underlying `MetaIoHandler`
|
||||
pub fn io_handler(&self) -> Arc<jsonrpc_core::MetaIoHandler<sc_rpc::Metadata>> {
|
||||
self.0.clone()
|
||||
}
|
||||
}
|
||||
|
||||
/// Sinks to propagate network status updates.
|
||||
|
||||
Reference in New Issue
Block a user