add system_dryRun (#6300)

* add system_dryRun

* fix build error

* delete unneeded code

* return ApplyExtrinsicResult directly

* line width

* mark dry run unsafe

* line width

* fix test

* add test

* update comment
This commit is contained in:
Xiliang Chen
2020-06-17 08:51:03 +12:00
committed by GitHub
parent 0787b189fa
commit 7d30ae7ba8
6 changed files with 180 additions and 20 deletions
@@ -38,7 +38,7 @@ use sp_api::{ProvideRuntimeApi, BlockId};
use sp_runtime::traits::{Block as BlockT, Header as _};
use sp_consensus::{SelectChain, Error as ConsensusError};
use sp_blockchain::{HeaderBackend, HeaderMetadata, Error as BlockChainError};
use std::{collections::HashMap, fmt, sync::Arc};
use std::{collections::HashMap, sync::Arc};
type FutureResult<T> = Box<dyn rpc_future::Future<Item = T, Error = RpcError> + Send>;
@@ -93,7 +93,6 @@ impl<B, C, SC> BabeApi for BabeRpcHandler<B, C, SC>
B: BlockT,
C: ProvideRuntimeApi<B> + HeaderBackend<B> + HeaderMetadata<B, Error=BlockChainError> + 'static,
C::Api: BabeRuntimeApi<B>,
<C::Api as sp_api::ApiErrorExt>::Error: fmt::Debug,
SC: SelectChain<B> + Clone + 'static,
{
fn epoch_authorship(&self) -> FutureResult<HashMap<AuthorityId, EpochAuthorship>> {