diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index f0dbfeb3dd..ad1a095905 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -2927,7 +2927,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", @@ -2965,7 +2964,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", diff --git a/substrate/core/test-runtime/wasm/Cargo.lock b/substrate/core/test-runtime/wasm/Cargo.lock index a3e0483baa..b153621b36 100644 --- a/substrate/core/test-runtime/wasm/Cargo.lock +++ b/substrate/core/test-runtime/wasm/Cargo.lock @@ -1090,6 +1090,7 @@ dependencies = [ "mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm index ec7eee0ddd..1bd14ddad0 100644 Binary files a/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm and b/substrate/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm differ diff --git a/substrate/node/runtime/wasm/Cargo.lock b/substrate/node/runtime/wasm/Cargo.lock index 2ae5b0765e..1ac43403de 100644 --- a/substrate/node/runtime/wasm/Cargo.lock +++ b/substrate/node/runtime/wasm/Cargo.lock @@ -1165,16 +1165,13 @@ dependencies = [ "parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", - "srml-consensus 0.1.0", "srml-staking 0.1.0", "srml-support 0.1.0", "srml-system 0.1.0", "srml-timestamp 0.1.0", "substrate-inherents 0.1.0", - "substrate-primitives 0.1.0", ] [[package]] @@ -1183,16 +1180,13 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", "srml-support 0.1.0", "srml-system 0.1.0", "substrate-keyring 0.1.0", - "substrate-primitives 0.1.0", ] [[package]] @@ -1203,7 +1197,6 @@ dependencies = [ "parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", - "sr-io 0.1.0", "sr-primitives 0.1.0", "sr-std 0.1.0", "srml-support 0.1.0", @@ -1398,6 +1391,7 @@ dependencies = [ "mashup 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm index 151d49c6a3..eb785c6864 100644 Binary files a/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm and b/substrate/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm differ diff --git a/substrate/srml/assets/Cargo.toml b/substrate/srml/assets/Cargo.toml index 77684f7c63..5ee5f8c4f4 100644 --- a/substrate/srml/assets/Cargo.toml +++ b/substrate/srml/assets/Cargo.toml @@ -2,29 +2,30 @@ name = "srml-assets" version = "0.1.0" authors = ["Parity Technologies "] +edition = "2018" [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } parity-codec = { version = "3.0", default-features = false } -parity-codec-derive = { version = "3.0", default-features = false } +# Needed for various traits. In our case, `OnFinalise`. +primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } +# Needed for type-safe access to storage DB. +srml-support = { path = "../support", default-features = false } +# `system` module provides us with all sorts of useful stuff and macros depend on it being around. +system = { package = "srml-system", path = "../system", default-features = false } + +[dev-dependencies] substrate-primitives = { path = "../../core/primitives", default-features = false } sr-std = { path = "../../core/sr-std", default-features = false } -sr-io = { path = "../../core/sr-io", default-features = false } -sr-primitives = { path = "../../core/sr-primitives", default-features = false } -srml-support = { path = "../support", default-features = false } -srml-system = { path = "../system", default-features = false } +runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false } [features] default = ["std"] std = [ "serde/std", "parity-codec/std", - "parity-codec-derive/std", - "substrate-primitives/std", - "sr-std/std", - "sr-io/std", - "sr-primitives/std", + "primitives/std", "srml-support/std", - "srml-system/std", + "system/std", ] diff --git a/substrate/srml/assets/src/lib.rs b/substrate/srml/assets/src/lib.rs index 01a8c13cf0..42adc4d73d 100644 --- a/substrate/srml/assets/src/lib.rs +++ b/substrate/srml/assets/src/lib.rs @@ -19,32 +19,10 @@ // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -// Assert macros used in tests. -extern crate sr_std; - -// Needed for tests (`with_externalities`). -#[cfg(test)] -extern crate sr_io as runtime_io; - -// Needed for the set of mock primitives used in our tests. -#[cfg(test)] -extern crate substrate_primitives; - -// Needed for deriving `Encode` and `Decode` for `RawEvent`. -#[macro_use] -extern crate parity_codec_derive; -extern crate parity_codec as codec; - // Needed for type-safe access to storage DB. #[macro_use] extern crate srml_support as runtime_support; -// Needed for various traits. In our case, `OnFinalise`. -extern crate sr_primitives as primitives; -// `system` module provides us with all sorts of useful stuff and macros -// depend on it being around. -extern crate srml_system as system; - use runtime_support::{StorageValue, StorageMap, Parameter}; use primitives::traits::{Member, SimpleArithmetic, Zero, StaticLookup}; use system::ensure_signed; diff --git a/substrate/srml/aura/Cargo.toml b/substrate/srml/aura/Cargo.toml index 2ff609f2f0..44b2f84166 100644 --- a/substrate/srml/aura/Cargo.toml +++ b/substrate/srml/aura/Cargo.toml @@ -2,41 +2,38 @@ name = "srml-aura" version = "0.1.0" authors = ["Parity Technologies "] +edition = "2018" [dependencies] hex-literal = "0.1.0" parity-codec = { version = "3.0", default-features = false } parity-codec-derive = { version = "3.0", default-features = false } serde = { version = "1.0", default-features = false } -substrate-primitives = { path = "../../core/primitives", default-features = false } -substrate-inherents = { path = "../../core/inherents", default-features = false } -sr-std = { path = "../../core/sr-std", default-features = false } -sr-io = { path = "../../core/sr-io", default-features = false } -sr-primitives = { path = "../../core/sr-primitives", default-features = false } +inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false } +rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } +primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } srml-support = { path = "../support", default-features = false } -srml-system = { path = "../system", default-features = false } -srml-consensus = { path = "../consensus", default-features = false } -srml-timestamp = { path = "../timestamp", default-features = false } -srml-staking = { path = "../staking", default-features = false } +system = { package = "srml-system", path = "../system", default-features = false } +timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false } +staking = { package = "srml-staking", path = "../staking", default-features = false } [dev-dependencies] lazy_static = "1.0" parking_lot = "0.7.1" +substrate-primitives = { path = "../../core/primitives", default-features = false } +runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false } +consensus = { package = "srml-consensus", path = "../consensus", default-features = false } [features] default = ["std"] std = [ "serde/std", "parity-codec/std", - "parity-codec-derive/std", - "substrate-primitives/std", - "sr-std/std", - "sr-io/std", + "rstd/std", "srml-support/std", - "sr-primitives/std", - "srml-system/std", - "srml-consensus/std", - "srml-timestamp/std", - "srml-staking/std", - "substrate-inherents/std", + "primitives/std", + "system/std", + "timestamp/std", + "staking/std", + "inherents/std", ] diff --git a/substrate/srml/aura/src/lib.rs b/substrate/srml/aura/src/lib.rs index 273c3b27c5..36e285b5cb 100644 --- a/substrate/srml/aura/src/lib.rs +++ b/substrate/srml/aura/src/lib.rs @@ -18,34 +18,10 @@ #![cfg_attr(not(feature = "std"), no_std)] -extern crate sr_std as rstd; - -#[macro_use] -extern crate parity_codec_derive; -extern crate parity_codec; - #[macro_use] extern crate srml_support as runtime_support; -extern crate sr_primitives as primitives; -extern crate srml_system as system; -pub extern crate srml_timestamp as timestamp; -extern crate srml_staking as staking; -extern crate substrate_primitives; -extern crate substrate_inherents as inherents; - -#[cfg(test)] -extern crate srml_consensus as consensus; - -#[cfg(test)] -extern crate sr_io as runtime_io; - -#[cfg(test)] -#[macro_use] -extern crate lazy_static; - -#[cfg(test)] -extern crate parking_lot; +pub use timestamp; use rstd::{result, prelude::*}; use runtime_support::storage::StorageValue; @@ -55,6 +31,7 @@ use timestamp::OnTimestampSet; use timestamp::TimestampInherentData; #[cfg(feature = "std")] use parity_codec::Decode; +use parity_codec_derive::{Encode, Decode}; use inherents::{RuntimeString, InherentIdentifier, InherentData, ProvideInherent, MakeFatalError}; #[cfg(feature = "std")] use inherents::{InherentDataProviders, ProvideInherentData}; diff --git a/substrate/srml/aura/src/mock.rs b/substrate/srml/aura/src/mock.rs index 16d2b81280..a1b5a2e596 100644 --- a/substrate/srml/aura/src/mock.rs +++ b/substrate/srml/aura/src/mock.rs @@ -21,7 +21,7 @@ use primitives::{BuildStorage, traits::IdentityLookup, testing::{Digest, DigestItem, Header, UintAuthorityId}}; use runtime_io; use substrate_primitives::{H256, Blake2Hasher}; -use {Trait, Module, consensus, system, timestamp}; +use crate::{Trait, Module}; impl_outer_origin!{ pub enum Origin for Test {} diff --git a/substrate/srml/aura/src/tests.rs b/substrate/srml/aura/src/tests.rs index 6f215b8fe2..56a43652b8 100644 --- a/substrate/srml/aura/src/tests.rs +++ b/substrate/srml/aura/src/tests.rs @@ -18,11 +18,12 @@ #![cfg(test)] -use mock::{System, Aura, new_test_ext}; +use lazy_static::lazy_static; +use crate::mock::{System, Aura, new_test_ext}; use primitives::traits::Header; use runtime_io::with_externalities; use parking_lot::Mutex; -use {AuraReport, HandleReport}; +use crate::{AuraReport, HandleReport}; #[test] fn aura_report_gets_skipped_correctly() { diff --git a/substrate/srml/balances/Cargo.toml b/substrate/srml/balances/Cargo.toml index dbc1fd3e7d..be8ed7e07e 100644 --- a/substrate/srml/balances/Cargo.toml +++ b/substrate/srml/balances/Cargo.toml @@ -2,20 +2,22 @@ name = "srml-balances" version = "0.1.0" authors = ["Parity Technologies "] +edition = "2018" [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } safe-mix = { version = "1.0", default-features = false} parity-codec = { version = "3.0", default-features = false } -parity-codec-derive = { version = "3.0", default-features = false } substrate-keyring = { path = "../../core/keyring", optional = true } -substrate-primitives = { path = "../../core/primitives", default-features = false } -sr-std = { path = "../../core/sr-std", default-features = false } -sr-io = { path = "../../core/sr-io", default-features = false } -sr-primitives = { path = "../../core/sr-primitives", default-features = false } +rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } +primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } srml-support = { path = "../support", default-features = false } -srml-system = { path = "../system", default-features = false } +system = { package = "srml-system", path = "../system", default-features = false } + +[dev-dependencies] +runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false } +substrate-primitives = { path = "../../core/primitives", default-features = false } [features] default = ["std"] @@ -24,11 +26,8 @@ std = [ "safe-mix/std", "substrate-keyring", "parity-codec/std", - "parity-codec-derive/std", - "substrate-primitives/std", - "sr-std/std", - "sr-io/std", + "rstd/std", "srml-support/std", - "sr-primitives/std", - "srml-system/std", + "primitives/std", + "system/std", ] diff --git a/substrate/srml/balances/src/lib.rs b/substrate/srml/balances/src/lib.rs index 8f338e7b13..a023dd0d59 100644 --- a/substrate/srml/balances/src/lib.rs +++ b/substrate/srml/balances/src/lib.rs @@ -27,23 +27,9 @@ #[macro_use] extern crate srml_support as runtime_support; -extern crate sr_std as rstd; - -#[macro_use] -extern crate parity_codec_derive; - -extern crate parity_codec as codec; -extern crate sr_primitives as primitives; -extern crate srml_system as system; - -#[cfg(test)] -extern crate sr_io as runtime_io; -#[cfg(test)] -extern crate substrate_primitives; - use rstd::prelude::*; use rstd::{cmp, result}; -use codec::Codec; +use parity_codec::Codec; use runtime_support::{StorageValue, StorageMap, Parameter}; use runtime_support::dispatch::Result; use primitives::traits::{Zero, SimpleArithmetic, MakePayment, diff --git a/substrate/srml/balances/src/mock.rs b/substrate/srml/balances/src/mock.rs index 1ff7a03073..89524c1f10 100644 --- a/substrate/srml/balances/src/mock.rs +++ b/substrate/srml/balances/src/mock.rs @@ -22,7 +22,7 @@ use primitives::BuildStorage; use primitives::{traits::{IdentityLookup}, testing::{Digest, DigestItem, Header}}; use substrate_primitives::{H256, Blake2Hasher}; use runtime_io; -use {GenesisConfig, Module, Trait, system}; +use crate::{GenesisConfig, Module, Trait}; impl_outer_origin!{ pub enum Origin for Runtime {} diff --git a/substrate/srml/consensus/Cargo.toml b/substrate/srml/consensus/Cargo.toml index 0517c813c2..7775481b94 100644 --- a/substrate/srml/consensus/Cargo.toml +++ b/substrate/srml/consensus/Cargo.toml @@ -2,6 +2,7 @@ name = "srml-consensus" version = "0.1.0" authors = ["Parity Technologies "] +edition = "2018" [dependencies] hex-literal = "0.1.0" @@ -9,12 +10,14 @@ serde = { version = "1.0", default-features = false } parity-codec = { version = "3.0", default-features = false } parity-codec-derive = { version = "3.0", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } -substrate-inherents = { path = "../../core/inherents", default-features = false } -sr-std = { path = "../../core/sr-std", default-features = false } -sr-io = { path = "../../core/sr-io", default-features = false } -sr-primitives = { path = "../../core/sr-primitives", default-features = false } +inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false } +rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } +primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } srml-support = { path = "../support", default-features = false } -srml-system = { path = "../system", default-features = false } +system = { package = "srml-system", path = "../system", default-features = false } + +[dev-dependencies] +runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false } [features] default = ["std"] @@ -22,10 +25,9 @@ std = [ "serde/std", "parity-codec/std", "substrate-primitives/std", - "sr-std/std", - "sr-io/std", + "rstd/std", "srml-support/std", - "sr-primitives/std", - "srml-system/std", - "substrate-inherents/std", + "primitives/std", + "system/std", + "inherents/std", ] diff --git a/substrate/srml/consensus/src/lib.rs b/substrate/srml/consensus/src/lib.rs index bd4b564985..33c483ee9c 100644 --- a/substrate/srml/consensus/src/lib.rs +++ b/substrate/srml/consensus/src/lib.rs @@ -18,27 +18,13 @@ #![cfg_attr(not(feature = "std"), no_std)] -extern crate sr_std as rstd; - #[macro_use] extern crate srml_support as runtime_support; -extern crate parity_codec; -#[macro_use] -extern crate parity_codec_derive; - -extern crate sr_primitives as primitives; -extern crate parity_codec as codec; -extern crate srml_system as system; -extern crate substrate_primitives; - -#[cfg(test)] -extern crate sr_io as runtime_io; - -extern crate substrate_inherents as inherents; - use rstd::prelude::*; -use parity_codec::Encode; +use parity_codec as codec; +use codec::Encode; +use parity_codec_derive::{Encode, Decode}; use runtime_support::{storage, Parameter}; use runtime_support::storage::StorageValue; use runtime_support::storage::unhashed::StorageVec; diff --git a/substrate/srml/consensus/src/mock.rs b/substrate/srml/consensus/src/mock.rs index 454aa61c41..b948b62afb 100644 --- a/substrate/srml/consensus/src/mock.rs +++ b/substrate/srml/consensus/src/mock.rs @@ -21,7 +21,7 @@ use primitives::{BuildStorage, traits::IdentityLookup, testing::{Digest, DigestItem, Header, UintAuthorityId}}; use runtime_io; use substrate_primitives::{H256, Blake2Hasher}; -use {GenesisConfig, Trait, Module, system}; +use crate::{GenesisConfig, Trait, Module}; impl_outer_origin!{ pub enum Origin for Test {} @@ -33,7 +33,7 @@ pub struct Test; impl Trait for Test { type Log = DigestItem; type SessionKey = UintAuthorityId; - type InherentOfflineReport = ::InstantFinalityReportVec<()>; + type InherentOfflineReport = crate::InstantFinalityReportVec<()>; } impl system::Trait for Test { type Origin = Origin; diff --git a/substrate/srml/consensus/src/tests.rs b/substrate/srml/consensus/src/tests.rs index 53d5732173..d883a897f1 100644 --- a/substrate/srml/consensus/src/tests.rs +++ b/substrate/srml/consensus/src/tests.rs @@ -20,7 +20,7 @@ use primitives::{generic, testing::{self, UintAuthorityId}, traits::OnFinalise}; use runtime_io::with_externalities; -use mock::{Consensus, System, new_test_ext}; +use crate::mock::{Consensus, System, new_test_ext}; use inherents::{InherentData, ProvideInherent}; #[test]