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:
Svyatoslav Nikolsky
2019-09-01 03:20:10 +03:00
committed by Gavin Wood
parent 816e132cd7
commit 607ee0a4e4
26 changed files with 1859 additions and 721 deletions
+7 -3
View File
@@ -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,