mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 01:51:09 +00:00
Make chain && state RPCs async (#3480)
* chain+state RPCs are async now * wrapped too long lines * create full/light RPC impls from service * use ordering * post-merge fix
This commit is contained in:
committed by
Gavin Wood
parent
816e132cd7
commit
607ee0a4e4
@@ -231,8 +231,8 @@ impl<S, F, Block, H> ClientBackend<Block, H> for Backend<S, F, H> where
|
||||
impl<S, F, Block, H> RemoteBackend<Block, H> for Backend<S, F, H>
|
||||
where
|
||||
Block: BlockT,
|
||||
S: BlockchainStorage<Block>,
|
||||
F: Fetcher<Block>,
|
||||
S: BlockchainStorage<Block> + 'static,
|
||||
F: Fetcher<Block> + 'static,
|
||||
H: Hasher<Out=Block::Hash>,
|
||||
H::Out: Ord,
|
||||
{
|
||||
@@ -242,6 +242,10 @@ where
|
||||
.map(|num| num.is_zero())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
fn remote_blockchain(&self) -> Arc<dyn crate::light::blockchain::RemoteBlockchain<Block>> {
|
||||
self.blockchain.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl<S, F, Block, H> BlockImportOperation<Block, H> for ImportOperation<Block, S, F, H>
|
||||
@@ -358,7 +362,7 @@ where
|
||||
*self.cached_header.write() = Some(cached_header);
|
||||
}
|
||||
|
||||
futures::executor::block_on(
|
||||
futures03::executor::block_on(
|
||||
self.fetcher.upgrade().ok_or(ClientError::NotAvailableOnLightClient)?
|
||||
.remote_read(RemoteReadRequest {
|
||||
block: self.block,
|
||||
|
||||
Reference in New Issue
Block a user