Make runtime api calls native when possible (#1302)

* Add simple benchmark for the runtime api

* Make the executor support native calls

* Some documentation

* Hide behind `feature = "std"`

* Rework the native calls

* Make all tests compile again

* Make every parameter using the Block serialized/deserialized in the native call

* Forward `UnwindSafe` requirement

* Remove debug stuff

* Add some documentation

* Fixes warnings

* Fixes errors after master rebase

* Fixes compilation after master rebase

* Fixes compilation after rebase
This commit is contained in:
Bastian Köcher
2019-01-21 14:32:53 +01:00
committed by Gav Wood
parent f0dbcf5401
commit 010e63116f
37 changed files with 1152 additions and 363 deletions
+3 -11
View File
@@ -181,10 +181,7 @@ impl<F: ServiceFactory> TestNet<F> {
}
}
pub fn connectivity<F: ServiceFactory, Inherent>(spec: FactoryChainSpec<F>) where
<F as ServiceFactory>::RuntimeApi:
client::block_builder::api::BlockBuilder<<F as service::ServiceFactory>::Block, Inherent>
{
pub fn connectivity<F: ServiceFactory, Inherent>(spec: FactoryChainSpec<F>) {
const NUM_NODES: u32 = 10;
{
let temp = TempDir::new("substrate-connectivity-test").expect("Error creating test dir");
@@ -228,9 +225,6 @@ where
F: ServiceFactory,
B: Fn(&F::FullService) -> ImportBlock<F::Block>,
E: Fn(&F::FullService) -> FactoryExtrinsic<F>,
<F as ServiceFactory>::RuntimeApi:
client::block_builder::api::BlockBuilder<<F as service::ServiceFactory>::Block, ()> +
client::runtime_api::TaggedTransactionQueue<<F as service::ServiceFactory>::Block>
{
const NUM_NODES: u32 = 10;
const NUM_BLOCKS: usize = 512;
@@ -265,10 +259,8 @@ where
}
pub fn consensus<F>(spec: FactoryChainSpec<F>, authorities: Vec<String>)
where
F: ServiceFactory,
<F as ServiceFactory>::RuntimeApi:
client::block_builder::api::BlockBuilder<<F as service::ServiceFactory>::Block, ()>
where
F: ServiceFactory,
{
const NUM_NODES: u32 = 20;
const NUM_BLOCKS: u64 = 200;