Migrate node (cli, executor, primitives and runtime) to the 2018 edition (#1589)

This commit is contained in:
Stanislav Tkach
2019-01-29 18:57:56 +02:00
committed by Gav Wood
parent d796e09f02
commit 473721f959
14 changed files with 94 additions and 170 deletions
+18 -17
View File
@@ -3,33 +3,34 @@ name = "node-executor"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Substrate node implementation in Rust."
edition = "2018"
[dependencies]
hex-literal = "0.1"
trie-root = "0.9"
parity-codec = "3.0"
sr-io = { path = "../../core/sr-io" }
substrate-state-machine = { path = "../../core/state-machine" }
runtime_io = { package = "sr-io", path = "../../core/sr-io" }
state_machine = { package = "substrate-state-machine", path = "../../core/state-machine" }
substrate-executor = { path = "../../core/executor" }
substrate-primitives = { path = "../../core/primitives" }
substrate-trie = { path = "../../core/trie" }
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
trie = { package = "substrate-trie", path = "../../core/trie" }
node-primitives = { path = "../primitives" }
node-runtime = { path = "../runtime" }
[dev-dependencies]
substrate-keyring = { path = "../../core/keyring" }
sr-primitives = { path = "../../core/sr-primitives" }
srml-support = { path = "../../srml/support" }
srml-balances = { path = "../../srml/balances" }
srml-session = { path = "../../srml/session" }
srml-staking = { path = "../../srml/staking" }
srml-system = { path = "../../srml/system" }
srml-consensus = { path = "../../srml/consensus" }
srml-timestamp = { path = "../../srml/timestamp" }
srml-treasury = { path = "../../srml/treasury" }
srml-contract = { path = "../../srml/contract" }
srml-grandpa = { path = "../../srml/grandpa" }
srml-indices = { path = "../../srml/indices" }
keyring = { package = "substrate-keyring", path = "../../core/keyring" }
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives" }
runtime_support = { package = "srml-support", path = "../../srml/support" }
balances = { package = "srml-balances", path = "../../srml/balances" }
session = { package = "srml-session", path = "../../srml/session" }
staking = { package = "srml-staking", path = "../../srml/staking" }
system = { package = "srml-system", path = "../../srml/system" }
consensus = { package = "srml-consensus", path = "../../srml/consensus" }
timestamp = { package = "srml-timestamp", path = "../../srml/timestamp" }
treasury = { package = "srml-treasury", path = "../../srml/treasury" }
contract = { package = "srml-contract", path = "../../srml/contract" }
grandpa = { package = "srml-grandpa", path = "../../srml/grandpa" }
indices = { package = "srml-indices", path = "../../srml/indices" }
wabt = "~0.7.4"
[features]
+4 -26
View File
@@ -19,34 +19,10 @@
#![cfg_attr(feature = "benchmarks", feature(test))]
extern crate node_runtime;
#[macro_use] extern crate substrate_executor;
#[cfg_attr(test, macro_use)] extern crate substrate_primitives as primitives;
#[cfg(feature = "benchmarks")] extern crate test;
#[cfg(test)] extern crate substrate_keyring as keyring;
#[cfg(test)] extern crate sr_primitives as runtime_primitives;
#[cfg(test)] extern crate srml_support as runtime_support;
#[cfg(test)] extern crate srml_balances as balances;
#[cfg(test)] extern crate srml_session as session;
#[cfg(test)] extern crate srml_staking as staking;
#[cfg(test)] extern crate srml_system as system;
#[cfg(test)] extern crate srml_consensus as consensus;
#[cfg(test)] extern crate srml_timestamp as timestamp;
#[cfg(test)] extern crate srml_treasury as treasury;
#[cfg(test)] extern crate srml_contract as contract;
#[cfg(test)] extern crate srml_grandpa as grandpa;
#[cfg(test)] extern crate srml_indices as indices;
#[cfg(test)] extern crate node_primitives;
#[cfg(test)] extern crate parity_codec as codec;
#[cfg(test)] extern crate sr_io as runtime_io;
#[cfg(test)] extern crate substrate_trie as trie;
#[cfg(test)] extern crate substrate_state_machine as state_machine;
#[cfg(test)] #[macro_use] extern crate hex_literal;
#[cfg(test)] extern crate wabt;
pub use substrate_executor::NativeExecutor;
use substrate_executor::native_executor_instance;
native_executor_instance!(pub Executor, node_runtime::api::dispatch, node_runtime::native_version, include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm"));
#[cfg(test)]
@@ -54,7 +30,7 @@ mod tests {
use runtime_io;
use super::Executor;
use substrate_executor::{WasmExecutor, NativeExecutionDispatch};
use codec::{Encode, Decode, Joiner};
use parity_codec::{Encode, Decode, Joiner};
use keyring::Keyring;
use runtime_support::{Hashable, StorageValue, StorageMap};
use state_machine::{CodeExecutor, Externalities, TestExternalities};
@@ -71,6 +47,8 @@ mod tests {
BuildStorage, GenesisConfig, BalancesConfig, SessionConfig, StakingConfig, System,
SystemConfig, GrandpaConfig, IndicesConfig, Event, Log};
use wabt;
use hex_literal::{hex, hex_impl};
use primitives::map;
const BLOATY_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.wasm");
const COMPACT_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm");