From 73fb64b7c6131ba24cd43fb3c95f9ca04d83fdeb Mon Sep 17 00:00:00 2001 From: Gav Date: Wed, 7 Feb 2018 23:53:27 +0100 Subject: [PATCH] Fit nits. --- substrate/polkadot-cli/src/lib.rs | 6 +++--- substrate/polkadot-executor/src/lib.rs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/substrate/polkadot-cli/src/lib.rs b/substrate/polkadot-cli/src/lib.rs index 5c087a48b2..1784ae17c8 100644 --- a/substrate/polkadot-cli/src/lib.rs +++ b/substrate/polkadot-cli/src/lib.rs @@ -25,7 +25,6 @@ extern crate substrate_codec as codec; extern crate substrate_state_machine as state_machine; extern crate substrate_client as client; extern crate substrate_primitives as primitives; -extern crate substrate_runtime_io as runtime_io; extern crate substrate_rpc_servers as rpc; extern crate polkadot_primitives; extern crate polkadot_executor; @@ -43,6 +42,9 @@ extern crate log; mod genesis; pub mod error; +use codec::Slicable; +use polkadot_runtime::genesismap::{additional_storage_with_genesis, GenesisConfig}; + /// Parse command line arguments and start the node. /// /// IANA unassigned port ranges that we could use: @@ -67,7 +69,6 @@ pub fn run(args: I) -> error::Result<()> where let mut storage = Default::default(); let god_key = hex!["3d866ec8a9190c8343c2fc593d21d8a6d0c5c4763aaab2349de3a6111d64d124"]; - use polkadot_runtime::genesismap::{additional_storage_with_genesis, GenesisConfig}; let genesis_config = GenesisConfig { validators: vec![god_key.clone()], authorities: vec![god_key.clone()], @@ -82,7 +83,6 @@ pub fn run(args: I) -> error::Result<()> where storage = genesis_config.genesis_map(); let block = genesis::construct_genesis_block(&storage); storage.extend(additional_storage_with_genesis(&block).into_iter()); - use codec::Slicable; (primitives::block::Header::from_slice(&mut block.header.to_vec().as_ref()).expect("to_vec() always gives a valid serialisation; qed"), storage.into_iter().collect()) }; let client = client::new_in_mem(executor, prepare_genesis)?; diff --git a/substrate/polkadot-executor/src/lib.rs b/substrate/polkadot-executor/src/lib.rs index 8680d7d4a6..e1f1603267 100644 --- a/substrate/polkadot-executor/src/lib.rs +++ b/substrate/polkadot-executor/src/lib.rs @@ -14,6 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . +//! A `CodeExecutor` specialisation which uses natively compiled runtime when the wasm to be +//! executed is equivalent to the natively compiled code. + extern crate polkadot_runtime; extern crate substrate_executor; extern crate substrate_codec as codec; @@ -29,6 +32,7 @@ extern crate hex_literal; use polkadot_runtime as runtime; use substrate_executor::{NativeExecutionDispatch, NativeExecutor}; +/// A null struct which implements `NativeExecutionDispatch` feeding in the hard-coded runtime. pub struct LocalNativeExecutionDispatch; impl NativeExecutionDispatch for LocalNativeExecutionDispatch {