diff --git a/Cargo.lock b/Cargo.lock index 10caf9a3d45ff..34309759af206 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3792,7 +3792,6 @@ dependencies = [ "srml-system 0.1.0", "substrate-client 0.1.0", "substrate-consensus-common 0.1.0", - "substrate-executor 0.1.0", "substrate-keyring 0.1.0", "substrate-primitives 0.1.0", "substrate-transaction-pool 0.1.0", diff --git a/Cargo.toml b/Cargo.toml index 0e53cd43292ae..3d27fa72d54e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,10 +7,11 @@ name = "substrate" version = "0.10.0" authors = ["Parity Technologies "] build = "build.rs" +edition = "2018" [dependencies] error-chain = "0.12" -node-cli = { path = "node/cli" } +cli = { package = "node-cli", path = "node/cli" } futures = "0.1" ctrlc = { version = "3.0", features = ["termination"] } diff --git a/build.rs b/build.rs index 82277bf7071fd..7dd666310f774 100644 --- a/build.rs +++ b/build.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -extern crate vergen; - use vergen::{ConstantsFlags, generate_cargo_keys}; const ERROR_MSG: &'static str = "Failed to generate metadata files"; diff --git a/core/client/Cargo.toml b/core/client/Cargo.toml index 6fd392d78c21e..bc2911a0ae295 100644 --- a/core/client/Cargo.toml +++ b/core/client/Cargo.toml @@ -20,7 +20,6 @@ trie = { package = "substrate-trie", path = "../trie", optional = true } substrate-telemetry = { path = "../telemetry", optional = true } hash-db = { version = "0.11", optional = true } kvdb = { git = "https://github.com/paritytech/parity-common", optional = true, rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" } - parity-codec = { version = "3.0", default-features = false } parity-codec-derive = { version = "3.0", default-features = false } primitives = { package = "substrate-primitives", path = "../primitives", default-features = false } diff --git a/core/client/src/block_builder/block_builder.rs b/core/client/src/block_builder/block_builder.rs index 64d1ff761ceae..1cc3e4c1a9ee1 100644 --- a/core/client/src/block_builder/block_builder.rs +++ b/core/client/src/block_builder/block_builder.rs @@ -16,7 +16,7 @@ use super::api::BlockBuilder as BlockBuilderApi; use std::vec::Vec; -use codec::Encode; +use parity_codec::Encode; use crate::blockchain::HeaderBackend; use runtime_primitives::traits::{ Header as HeaderT, Hash, Block as BlockT, One, HashFor, ProvideRuntimeApi, ApiRef diff --git a/core/client/src/call_executor.rs b/core/client/src/call_executor.rs index 9f13bb58d25c5..9e544604149ba 100644 --- a/core/client/src/call_executor.rs +++ b/core/client/src/call_executor.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use std::{sync::Arc, cmp::Ord, panic::UnwindSafe, result}; -use codec::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::Block as BlockT; use state_machine::{ diff --git a/core/client/src/client.rs b/core/client/src/client.rs index 4eef88fad05c6..9d55b24e98087 100644 --- a/core/client/src/client.rs +++ b/core/client/src/client.rs @@ -38,7 +38,7 @@ use crate::runtime_api::{CallRuntimeAt, ConstructRuntimeApi}; use primitives::{Blake2Hasher, H256, ChangesTrieConfiguration, convert_hash, NeverNativeValue}; use primitives::storage::{StorageKey, StorageData}; use primitives::storage::well_known_keys; -use codec::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use state_machine::{ DBValue, Backend as StateBackend, CodeExecutor, ChangesTrieAnchorBlockId, ExecutionStrategy, ExecutionManager, prove_read, diff --git a/core/client/src/genesis.rs b/core/client/src/genesis.rs index 41338eaaec0d4..2dc8df08aa91d 100644 --- a/core/client/src/genesis.rs +++ b/core/client/src/genesis.rs @@ -40,7 +40,7 @@ pub fn construct_genesis_block< #[cfg(test)] mod tests { use super::*; - use codec::{Encode, Decode, Joiner}; + use parity_codec::{Encode, Decode, Joiner}; use keyring::Keyring; use executor::{NativeExecutionDispatch, native_executor_instance}; use state_machine::{execute, OverlayedChanges, ExecutionStrategy, InMemoryChangesTrieStorage}; diff --git a/core/client/src/leaves.rs b/core/client/src/leaves.rs index 1fa4cb3122f8d..8374155621697 100644 --- a/core/client/src/leaves.rs +++ b/core/client/src/leaves.rs @@ -18,7 +18,7 @@ use std::collections::BTreeSet; use std::cmp::{Ord, Ordering}; use kvdb::{KeyValueDB, DBTransaction}; use runtime_primitives::traits::SimpleArithmetic; -use codec::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use crate::error; /// helper wrapper type to keep a list of block hashes ordered diff --git a/core/client/src/lib.rs b/core/client/src/lib.rs index 2362abc01347a..7472b358d0d72 100644 --- a/core/client/src/lib.rs +++ b/core/client/src/lib.rs @@ -20,8 +20,6 @@ #![warn(missing_docs)] #![recursion_limit="128"] -extern crate parity_codec as codec; - #[macro_use] pub mod runtime_api; #[cfg(feature = "std")] diff --git a/core/client/src/light/call_executor.rs b/core/client/src/light/call_executor.rs index 389318a4fc62c..c2857e07a08ac 100644 --- a/core/client/src/light/call_executor.rs +++ b/core/client/src/light/call_executor.rs @@ -20,7 +20,7 @@ use std::{collections::HashSet, sync::Arc, panic::UnwindSafe, result, marker::PhantomData}; use futures::{IntoFuture, Future}; -use codec::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use primitives::{H256, Blake2Hasher, convert_hash, NativeOrEncoded}; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{As, Block as BlockT, Header as HeaderT}; diff --git a/core/client/src/runtime_api.rs b/core/client/src/runtime_api.rs index 747ca0bd0b14f..024816246d200 100644 --- a/core/client/src/runtime_api.rs +++ b/core/client/src/runtime_api.rs @@ -33,7 +33,7 @@ pub use runtime_version::{ApiId, RuntimeVersion, ApisVec, create_apis_vec}; pub use rstd::{slice, mem}; #[cfg(feature = "std")] use rstd::result; -pub use codec::{Encode, Decode}; +pub use parity_codec::{Encode, Decode}; #[cfg(feature = "std")] use crate::error; use rstd::vec::Vec; diff --git a/core/consensus/aura/slots/Cargo.toml b/core/consensus/aura/slots/Cargo.toml index b8cb306c30f54..fce628161eb49 100644 --- a/core/consensus/aura/slots/Cargo.toml +++ b/core/consensus/aura/slots/Cargo.toml @@ -6,7 +6,7 @@ description = "Generic slots-based utilities for consensus" edition = "2018" [dependencies] -parity-codec = "3.0" +codec = { package = "parity-codec", version = "3.0" } client = { package = "substrate-client", path = "../../../client" } primitives = { package = "substrate-primitives", path = "../../../primitives" } runtime_primitives = { package = "sr-primitives", path = "../../../sr-primitives" } diff --git a/core/consensus/aura/slots/src/lib.rs b/core/consensus/aura/slots/src/lib.rs index b77fb1266c877..53394441301f1 100644 --- a/core/consensus/aura/slots/src/lib.rs +++ b/core/consensus/aura/slots/src/lib.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -extern crate parity_codec as codec; - mod slots; pub use slots::{Slots, SlotInfo}; @@ -220,7 +218,7 @@ impl SlotDuration { C: ProvideRuntimeApi, C::Api: AuraApi, { - use parity_codec::Decode; + use codec::Decode; const SLOT_KEY: &[u8] = b"aura_slot_duration"; match client.get_aux(SLOT_KEY)? { diff --git a/core/consensus/rhd/Cargo.toml b/core/consensus/rhd/Cargo.toml index 7507b14023b70..83edbe5e1d519 100644 --- a/core/consensus/rhd/Cargo.toml +++ b/core/consensus/rhd/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] futures = "0.1.17" -parity-codec = { version = "3.0" } +codec = { package = "parity-codec", version = "3.0" } parity-codec-derive = { version = "3.0" } primitives = { package = "substrate-primitives", path = "../../primitives" } consensus = { package = "substrate-consensus-common", path = "../common" } @@ -27,8 +27,7 @@ rhododendron = { version = "0.5.0", features = ["codec"] } exit-future = "0.1" [dev-dependencies] -substrate-keyring = { path = "../../keyring" } -substrate-executor = { path = "../../executor" } +keyring = { package = "substrate-keyring", path = "../../keyring" } [features] default = ["std"] diff --git a/core/consensus/rhd/src/lib.rs b/core/consensus/rhd/src/lib.rs index 71c34fd79b44d..020703ab205c0 100644 --- a/core/consensus/rhd/src/lib.rs +++ b/core/consensus/rhd/src/lib.rs @@ -1318,8 +1318,6 @@ mod tests { use primitives::H256; use self::keyring::Keyring; - extern crate substrate_keyring as keyring; - type TestBlock = GenericTestBlock<()>; struct FakeClient { diff --git a/core/network-libp2p/Cargo.toml b/core/network-libp2p/Cargo.toml index 3fae20f23a7a4..f336ef54bb801 100644 --- a/core/network-libp2p/Cargo.toml +++ b/core/network-libp2p/Cargo.toml @@ -1,11 +1,11 @@ [package] description = "libp2p implementation of the ethcore network library" -edition = "2018" homepage = "http://parity.io" license = "GPL-3.0" name = "substrate-network-libp2p" version = "0.1.0" authors = ["Parity Technologies "] +edition = "2018" [dependencies] bytes = "0.4" diff --git a/core/sr-api-macros/Cargo.toml b/core/sr-api-macros/Cargo.toml index 71533d4b0ab2f..e7f46129db6df 100644 --- a/core/sr-api-macros/Cargo.toml +++ b/core/sr-api-macros/Cargo.toml @@ -2,6 +2,7 @@ name = "sr-api-macros" version = "0.1.0" authors = ["Parity Technologies "] +edition = "2018" [lib] proc-macro = true @@ -14,10 +15,10 @@ blake2-rfc = "0.2" proc-macro-crate = "0.1.3" [dev-dependencies] -substrate-client = { path = "../client" } -substrate-test-client = { path = "../test-client" } -substrate-state-machine = { path = "../state-machine" } -sr-primitives = { path = "../sr-primitives" } +client = { package = "substrate-client", path = "../client" } +test_client = { package = "substrate-test-client", path = "../test-client" } +state_machine = { package = "substrate-state-machine", path = "../state-machine" } +runtime_primitives = { package = "sr-primitives", path = "../sr-primitives" } sr-version = { path = "../sr-version" } substrate-primitives = { path = "../primitives" } criterion = "0.2" diff --git a/core/sr-api-macros/benches/bench.rs b/core/sr-api-macros/benches/bench.rs index 0b829052e688b..85ea3d6f88dd3 100644 --- a/core/sr-api-macros/benches/bench.rs +++ b/core/sr-api-macros/benches/bench.rs @@ -14,12 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -#[macro_use] -extern crate criterion; -extern crate substrate_client; -extern crate substrate_test_client as test_client; -extern crate sr_primitives as runtime_primitives; - use criterion::Criterion; use test_client::runtime::TestAPI; use runtime_primitives::{generic::BlockId, traits::ProvideRuntimeApi}; diff --git a/core/sr-api-macros/src/compile_fail_tests.rs b/core/sr-api-macros/src/compile_fail_tests.rs index 195d46430f54b..4f92e541285f7 100644 --- a/core/sr-api-macros/src/compile_fail_tests.rs +++ b/core/sr-api-macros/src/compile_fail_tests.rs @@ -20,7 +20,7 @@ mod declaring_own_block { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate sr_primitives as runtime_primitives; use runtime_primitives::traits::Block as BlockT; @@ -40,7 +40,7 @@ mod declaring_own_block_with_different_name { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate sr_primitives as runtime_primitives; use runtime_primitives::traits::Block as BlockT; @@ -60,7 +60,7 @@ mod adding_self_parameter { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate sr_primitives as runtime_primitives; decl_runtime_apis! { @@ -78,7 +78,7 @@ mod adding_at_parameter { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate sr_primitives as runtime_primitives; decl_runtime_apis! { @@ -96,7 +96,7 @@ mod invalid_api_version { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate sr_primitives as runtime_primitives; decl_runtime_apis! { @@ -115,7 +115,7 @@ mod invalid_api_version_2 { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate sr_primitives as runtime_primitives; decl_runtime_apis! { @@ -134,7 +134,7 @@ mod invalid_api_version_3 { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate sr_primitives as runtime_primitives; decl_runtime_apis! { @@ -153,7 +153,7 @@ mod missing_block_generic_parameter { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate substrate_test_client as test_client; extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; @@ -191,7 +191,7 @@ mod missing_path_for_trait { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate substrate_test_client as test_client; extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; @@ -229,7 +229,7 @@ mod empty_impl_runtime_apis_call { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate substrate_test_client as test_client; extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; @@ -261,7 +261,7 @@ mod type_reference_in_impl_runtime_apis_call { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate substrate_test_client as test_client; extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; @@ -299,7 +299,7 @@ mod impl_incorrect_method_signature { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate substrate_test_client as test_client; extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; @@ -335,7 +335,7 @@ mod impl_two_traits_with_same_name { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate substrate_test_client as test_client; extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; @@ -383,7 +383,7 @@ mod changed_at_unknown_version { /*! ```compile_fail #[macro_use] - extern crate substrate_client; + extern crate client; extern crate substrate_test_client as test_client; extern crate sr_primitives as runtime_primitives; extern crate substrate_primitives as primitives; diff --git a/core/sr-api-macros/src/decl_runtime_apis.rs b/core/sr-api-macros/src/decl_runtime_apis.rs index f8357f1746832..b320f4e06d7f9 100644 --- a/core/sr-api-macros/src/decl_runtime_apis.rs +++ b/core/sr-api-macros/src/decl_runtime_apis.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use utils::{ +use crate::utils::{ generate_crate_access, generate_hidden_includes, generate_runtime_mod_name_for_trait, fold_fn_decl_for_client_side, unwrap_or_error, extract_parameter_names_types_and_borrows, generate_native_call_generator_fn_name, return_type_extract_type, @@ -241,7 +241,7 @@ fn generate_native_call_generators(decl: &ItemTrait) -> Result { let (impl_generics, ty_generics, where_clause) = decl.generics.split_for_impl(); // We need to parse them again, to get an easy access to the actual parameters. - let mut impl_generics: Generics = parse_quote!(#impl_generics); + let impl_generics: Generics = parse_quote!(#impl_generics); let impl_generics_params = impl_generics.params.iter().map(|p| { match p { GenericParam::Type(ref ty) => { @@ -614,7 +614,7 @@ fn generate_client_side_decls(decls: &[ItemTrait]) -> TokenStream { let mut result = Vec::new(); for decl in decls { - let mut decl = decl.clone(); + let decl = decl.clone(); let crate_ = generate_crate_access(HIDDEN_INCLUDES_ID); let block_id = quote!( #crate_::runtime_api::BlockId ); diff --git a/core/sr-api-macros/src/impl_runtime_apis.rs b/core/sr-api-macros/src/impl_runtime_apis.rs index ab4459598828e..c6fb28b8020e8 100644 --- a/core/sr-api-macros/src/impl_runtime_apis.rs +++ b/core/sr-api-macros/src/impl_runtime_apis.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use utils::{ +use crate::utils::{ unwrap_or_error, generate_crate_access, generate_hidden_includes, generate_runtime_mod_name_for_trait, generate_method_runtime_api_impl_name, extract_parameter_names_types_and_borrows, generate_native_call_generator_fn_name, diff --git a/core/sr-api-macros/src/lib.rs b/core/sr-api-macros/src/lib.rs index abefc07c8b791..7c042eef25034 100644 --- a/core/sr-api-macros/src/lib.rs +++ b/core/sr-api-macros/src/lib.rs @@ -18,11 +18,6 @@ #![recursion_limit = "512"] extern crate proc_macro; -extern crate proc_macro2; -extern crate quote; -extern crate syn; -extern crate blake2_rfc; -extern crate proc_macro_crate; use proc_macro::TokenStream; @@ -51,13 +46,13 @@ mod compile_fail_tests; /// /// ```rust /// #[macro_use] -/// extern crate substrate_client; +/// extern crate client; /// extern crate sr_version as version; /// /// use version::create_runtime_str; -/// # extern crate substrate_test_client as test_client; -/// # extern crate sr_primitives as runtime_primitives; -/// # extern crate substrate_primitives as primitives; +/// # extern crate test_client; +/// # extern crate runtime_primitives; +/// # extern crate substrate_primitives; /// # /// # use runtime_primitives::traits::GetNodeBlockType; /// # use test_client::runtime::Block; @@ -133,7 +128,7 @@ pub fn impl_runtime_apis(input: TokenStream) -> TokenStream { /// /// ```rust /// #[macro_use] -/// extern crate substrate_client; +/// extern crate client; /// /// decl_runtime_apis! { /// /// Declare the api trait. @@ -168,7 +163,7 @@ pub fn impl_runtime_apis(input: TokenStream) -> TokenStream { /// /// ```rust /// #[macro_use] -/// extern crate substrate_client; +/// extern crate client; /// /// decl_runtime_apis! { /// /// Declare the api trait. diff --git a/core/sr-api-macros/tests/decl_and_impl.rs b/core/sr-api-macros/tests/decl_and_impl.rs index 28c9d9d51ae13..c7226065591ed 100644 --- a/core/sr-api-macros/tests/decl_and_impl.rs +++ b/core/sr-api-macros/tests/decl_and_impl.rs @@ -1,13 +1,23 @@ -#[macro_use] -extern crate substrate_client as client; -extern crate sr_primitives as runtime_primitives; -extern crate substrate_primitives as primitives; -extern crate substrate_test_client as test_client; +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . use runtime_primitives::traits::{GetNodeBlockType, Block as BlockT, AuthorityIdFor}; use runtime_primitives::generic::BlockId; use client::runtime_api::{self, RuntimeApiInfo}; -use client::error::Result; +use client::{error::Result, decl_runtime_apis, impl_runtime_apis}; use test_client::runtime::Block; /// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType` diff --git a/core/sr-api-macros/tests/runtime_calls.rs b/core/sr-api-macros/tests/runtime_calls.rs index 98984be6bdeeb..92e7a389246a0 100644 --- a/core/sr-api-macros/tests/runtime_calls.rs +++ b/core/sr-api-macros/tests/runtime_calls.rs @@ -14,11 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -extern crate substrate_client; -extern crate substrate_test_client as test_client; -extern crate sr_primitives as runtime_primitives; -extern crate substrate_state_machine as state_machine; - use test_client::runtime::{TestAPI, DecodeFails}; use runtime_primitives::{generic::BlockId, traits::ProvideRuntimeApi}; use state_machine::ExecutionStrategy; diff --git a/core/sr-version/src/lib.rs b/core/sr-version/src/lib.rs index 7f1cd41ebafe4..6d16f2e47c151 100644 --- a/core/sr-version/src/lib.rs +++ b/core/sr-version/src/lib.rs @@ -158,12 +158,9 @@ impl NativeVersion { #[cfg(feature = "std")] mod apis_serialize { - extern crate impl_serde; - extern crate serde; - use super::*; - use self::impl_serde::serialize as bytes; - use self::serde::{Serializer, ser::SerializeTuple}; + use impl_serde::serialize as bytes; + use serde::{Serializer, ser::SerializeTuple}; #[derive(Serialize)] struct ApiId<'a>( diff --git a/core/test-runtime/Cargo.toml b/core/test-runtime/Cargo.toml index 5fdf54ba9b716..d64d21ae9cdb3 100644 --- a/core/test-runtime/Cargo.toml +++ b/core/test-runtime/Cargo.toml @@ -20,7 +20,7 @@ rstd = { package = "sr-std", path = "../sr-std", default-features = false } runtime_io = { package = "sr-io", path = "../sr-io", default-features = false } runtime_primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false } runtime_version = { package = "sr-version", path = "../sr-version", default-features = false } -srml-support = { path = "../../srml/support", default-features = false } +runtime_support = { package = "srml-support", path = "../../srml/support", default-features = false } cfg-if = "0.1.6" [dev-dependencies] @@ -38,7 +38,7 @@ std = [ "parity-codec/std", "rstd/std", "runtime_io/std", - "srml-support/std", + "runtime_support/std", "primitives/std", "inherents/std", "runtime_primitives/std", diff --git a/core/test-runtime/src/lib.rs b/core/test-runtime/src/lib.rs index bbba30972c4de..36de756c80036 100644 --- a/core/test-runtime/src/lib.rs +++ b/core/test-runtime/src/lib.rs @@ -18,9 +18,6 @@ #![cfg_attr(not(feature = "std"), no_std)] -#[macro_use] -extern crate srml_support as runtime_support; - #[cfg(feature = "std")] pub mod genesismap; pub mod system; diff --git a/core/test-runtime/src/system.rs b/core/test-runtime/src/system.rs index 9118a107d8153..110666a6e06a0 100644 --- a/core/test-runtime/src/system.rs +++ b/core/test-runtime/src/system.rs @@ -20,6 +20,7 @@ use rstd::prelude::*; use runtime_io::{storage_root, enumerated_trie_root, storage_changes_root, twox_128}; use runtime_support::storage::{self, StorageValue, StorageMap}; +use runtime_support::storage_items; use runtime_primitives::traits::{Hash as HashT, BlakeTwo256, Digest as DigestT}; use runtime_primitives::generic; use runtime_primitives::{ApplyError, ApplyOutcome, ApplyResult, transaction_validity::TransactionValidity}; diff --git a/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm index 9c87a2e56f621..f7f569548e0db 100644 Binary files a/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm and b/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm differ diff --git a/node-template/Cargo.toml b/node-template/Cargo.toml index 26afc361eb9fa..bb5396a884a00 100644 --- a/node-template/Cargo.toml +++ b/node-template/Cargo.toml @@ -28,7 +28,7 @@ substrate-executor = { path = "../core/executor" } substrate-service = { path = "../core/service" } inherents = { package = "substrate-inherents", path = "../core/inherents" } transaction-pool = { package = "substrate-transaction-pool", path = "../core/transaction-pool" } -substrate-network = { path = "../core/network" } +network = { package = "substrate-network", path = "../core/network" } consensus = { package = "substrate-consensus-aura", path = "../core/consensus/aura" } substrate-client = { path = "../core/client" } basic-authorship = { package = "substrate-basic-authorship", path = "../core/basic-authorship" } diff --git a/node-template/runtime/src/lib.rs b/node-template/runtime/src/lib.rs index a2721683f4cd8..b6deeddb872b7 100644 --- a/node-template/runtime/src/lib.rs +++ b/node-template/runtime/src/lib.rs @@ -6,12 +6,8 @@ #![recursion_limit="256"] #[cfg(feature = "std")] -#[macro_use] -extern crate serde_derive; - -#[macro_use] -extern crate parity_codec_derive; - +use serde_derive::{Serialize, Deserialize}; +use parity_codec_derive::{Encode, Decode}; use rstd::prelude::*; #[cfg(feature = "std")] use primitives::bytes; diff --git a/node-template/src/cli.rs b/node-template/src/cli.rs index 6abaca4edc026..698f0ce763213 100644 --- a/node-template/src/cli.rs +++ b/node-template/src/cli.rs @@ -7,6 +7,7 @@ use substrate_cli::{informant, parse_and_execute, NoCustom}; use substrate_service::{ServiceFactory, Roles as ServiceRoles}; use crate::chain_spec; use std::ops::Deref; +use log::info; /// Parse command line arguments into service configuration. pub fn run(args: I, exit: E, version: VersionInfo) -> error::Result<()> where diff --git a/node-template/src/main.rs b/node-template/src/main.rs index 0b78ccb6194fc..7d8c3076c6261 100644 --- a/node-template/src/main.rs +++ b/node-template/src/main.rs @@ -3,17 +3,6 @@ #![warn(missing_docs)] #![warn(unused_extern_crates)] -#[macro_use] -extern crate error_chain; -#[macro_use] -extern crate log; -#[macro_use] -extern crate substrate_network as network; -#[macro_use] -extern crate substrate_executor; -#[macro_use] -extern crate substrate_service; - mod chain_spec; mod service; mod cli; @@ -33,4 +22,4 @@ fn run() -> cli::error::Result<()> { cli::run(::std::env::args(), cli::Exit, version) } -quick_main!(run); +error_chain::quick_main!(run); diff --git a/node-template/src/service.rs b/node-template/src/service.rs index ad3138449c798..b1fb0faf7ffde 100644 --- a/node-template/src/service.rs +++ b/node-template/src/service.rs @@ -3,6 +3,7 @@ #![warn(unused_extern_crates)] use std::sync::Arc; +use log::info; use transaction_pool::{self, txpool::{Pool as TransactionPool}}; use node_template_runtime::{self, GenesisConfig, opaque::Block, RuntimeApi}; use substrate_service::{ @@ -16,6 +17,9 @@ use consensus::{import_queue, start_aura, AuraImportQueue, SlotDuration, Nothing use substrate_client as client; use primitives::ed25519::Pair; use inherents::InherentDataProviders; +use network::construct_simple_protocol; +use substrate_executor::native_executor_instance; +use substrate_service::construct_service_factory; pub use substrate_executor::NativeExecutor; // Our native executor instance. diff --git a/node/runtime/src/lib.rs b/node/runtime/src/lib.rs index fa1bbfb31455d..23526d9e8870e 100644 --- a/node/runtime/src/lib.rs +++ b/node/runtime/src/lib.rs @@ -20,9 +20,6 @@ // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. #![recursion_limit="256"] -#[macro_use] -extern crate runtime_primitives; - use rstd::prelude::*; use parity_codec_derive::{Encode, Decode}; #[cfg(feature = "std")] @@ -37,9 +34,8 @@ use client::{ block_builder::api::{self as block_builder_api, InherentData, CheckInherentsResult}, runtime_api as client_api, impl_runtime_apis }; -use runtime_primitives::ApplyResult; +use runtime_primitives::{ApplyResult, generic, create_runtime_str}; use runtime_primitives::transaction_validity::TransactionValidity; -use runtime_primitives::generic; use runtime_primitives::traits::{ Convert, BlakeTwo256, Block as BlockT, DigestFor, NumberFor, StaticLookup, }; diff --git a/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm b/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm index 68f3e5c98b51f..58d2541f73009 100644 Binary files a/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm and b/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm differ diff --git a/node/src/main.rs b/node/src/main.rs index 1c292b6c2b9ba..2df55bb852fda 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -18,13 +18,6 @@ #![warn(missing_docs)] -extern crate node_cli as cli; -extern crate ctrlc; -extern crate futures; - -#[macro_use] -extern crate error_chain; - use cli::VersionInfo; use futures::sync::oneshot; use futures::{future, Future}; @@ -50,7 +43,7 @@ impl cli::IntoExit for Exit { } } -quick_main!(run); +error_chain::quick_main!(run); fn run() -> cli::error::Result<()> { let version = VersionInfo {