diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index fa169c393b..00d2eb47ef 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -794,7 +794,6 @@ name = "fork-tree" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1927,7 +1926,6 @@ dependencies = [ "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "node-primitives 0.1.0", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (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.87 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1994,7 +1992,6 @@ name = "node-template-runtime" version = "0.9.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2132,6 +2129,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2991,7 +2989,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3026,7 +3023,6 @@ version = "0.1.0" dependencies = [ "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", @@ -3055,7 +3051,6 @@ dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -3077,7 +3072,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -3095,7 +3089,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -3114,7 +3107,6 @@ dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3158,7 +3150,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3226,7 +3217,6 @@ name = "srml-grandpa" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -3263,7 +3253,6 @@ name = "srml-metadata" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 0.1.0", @@ -3295,7 +3284,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -3335,7 +3323,6 @@ dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3385,7 +3372,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3402,7 +3388,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", "sr-primitives 0.1.0", @@ -3420,7 +3405,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -3623,7 +3607,6 @@ dependencies = [ "kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 0.1.0", "sr-primitives 0.1.0", @@ -3652,7 +3635,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "substrate-client 0.1.0", @@ -3748,7 +3730,6 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rhododendron 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -3802,7 +3783,6 @@ dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", @@ -3823,7 +3803,6 @@ name = "substrate-finality-grandpa-primitives" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", "substrate-client 0.1.0", @@ -3835,7 +3814,6 @@ name = "substrate-inherents" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -3881,7 +3859,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3941,7 +3918,6 @@ dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4067,7 +4043,6 @@ dependencies = [ "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", ] @@ -4131,7 +4106,6 @@ dependencies = [ "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", diff --git a/substrate/core/client/Cargo.toml b/substrate/core/client/Cargo.toml index 99191f02aa..495b11b61d 100644 --- a/substrate/core/client/Cargo.toml +++ b/substrate/core/client/Cargo.toml @@ -20,8 +20,7 @@ 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.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } primitives = { package = "substrate-primitives", path = "../primitives", 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 } @@ -37,7 +36,6 @@ kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b031 default = ["std"] std = [ "parity-codec/std", - "parity-codec-derive/std", "consensus", "primitives/std", "inherents/std", diff --git a/substrate/core/client/db/Cargo.toml b/substrate/core/client/db/Cargo.toml index 19bed5daa6..8828eefa4f 100644 --- a/substrate/core/client/db/Cargo.toml +++ b/substrate/core/client/db/Cargo.toml @@ -17,8 +17,7 @@ primitives = { package = "substrate-primitives", path = "../../primitives" } runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" } client = { package = "substrate-client", path = "../../client" } state-machine = { package = "substrate-state-machine", path = "../../state-machine" } -parity-codec = "3.1" -parity-codec-derive = "3.1" +parity-codec = { version = "3.1", features = ["derive"] } executor = { package = "substrate-executor", path = "../../executor" } state_db = { package = "substrate-state-db", path = "../../state-db" } trie = { package = "substrate-trie", path = "../../trie" } diff --git a/substrate/core/client/db/src/cache/list_entry.rs b/substrate/core/client/db/src/cache/list_entry.rs index b54094fa00..d2d88ab12f 100644 --- a/substrate/core/client/db/src/cache/list_entry.rs +++ b/substrate/core/client/db/src/cache/list_entry.rs @@ -18,7 +18,7 @@ use client::error::Result as ClientResult; use runtime_primitives::traits::{Block as BlockT, NumberFor}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use crate::cache::{CacheItemT, ComplexBlockId}; use crate::cache::list_storage::{Storage}; diff --git a/substrate/core/client/db/src/cache/mod.rs b/substrate/core/client/db/src/cache/mod.rs index 8df8e42518..12f8c5e519 100644 --- a/substrate/core/client/db/src/cache/mod.rs +++ b/substrate/core/client/db/src/cache/mod.rs @@ -24,7 +24,6 @@ use kvdb::{KeyValueDB, DBTransaction}; use client::blockchain::Cache as BlockchainCache; use client::error::Result as ClientResult; use parity_codec::{Encode, Decode}; -use parity_codec_derive::{Encode, Decode}; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor, As, AuthorityIdFor}; use crate::utils::{self, COLUMN_META}; diff --git a/substrate/core/client/src/block_builder/api.rs b/substrate/core/client/src/block_builder/api.rs index f0f9a23122..9096b8f469 100644 --- a/substrate/core/client/src/block_builder/api.rs +++ b/substrate/core/client/src/block_builder/api.rs @@ -20,7 +20,7 @@ use runtime_primitives::{traits::Block as BlockT, ApplyResult, RuntimeString}; use rstd::vec::Vec; use sr_api_macros::decl_runtime_apis; pub use inherents::{InherentData, CheckInherentsResult}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; /// The old representation of the inherent data. #[doc(hide)] diff --git a/substrate/core/consensus/rhd/Cargo.toml b/substrate/core/consensus/rhd/Cargo.toml index e18180514e..22d847e80e 100644 --- a/substrate/core/consensus/rhd/Cargo.toml +++ b/substrate/core/consensus/rhd/Cargo.toml @@ -7,8 +7,7 @@ edition = "2018" [dependencies] futures = "0.1.17" -codec = { package = "parity-codec", version = "3.0" } -parity-codec-derive = { version = "3.1" } +codec = { package = "parity-codec", version = "3.1", features = ["derive"] } primitives = { package = "substrate-primitives", path = "../../primitives" } consensus = { package = "substrate-consensus-common", path = "../common" } client = { package = "substrate-client", path = "../../client" } diff --git a/substrate/core/consensus/rhd/src/lib.rs b/substrate/core/consensus/rhd/src/lib.rs index 020703ab20..a2a06fec90 100644 --- a/substrate/core/consensus/rhd/src/lib.rs +++ b/substrate/core/consensus/rhd/src/lib.rs @@ -38,7 +38,6 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::time::{self, Instant, Duration}; use parity_codec::{Decode, Encode}; -use parity_codec_derive::{Decode, Encode}; use consensus::offline_tracker::OfflineTracker; use consensus::error::{ErrorKind as CommonErrorKind}; use consensus::{Authorities, BlockImport, Environment, Proposer as BaseProposer}; diff --git a/substrate/core/executor/wasm/Cargo.lock b/substrate/core/executor/wasm/Cargo.lock index 4b7b54ebc6..27c80a723e 100644 --- a/substrate/core/executor/wasm/Cargo.lock +++ b/substrate/core/executor/wasm/Cargo.lock @@ -58,6 +58,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -186,7 +187,6 @@ dependencies = [ "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/substrate/core/finality-grandpa/Cargo.toml b/substrate/core/finality-grandpa/Cargo.toml index 64d1a1f874..9c17a5a770 100644 --- a/substrate/core/finality-grandpa/Cargo.toml +++ b/substrate/core/finality-grandpa/Cargo.toml @@ -11,8 +11,7 @@ log = "0.4" parking_lot = "0.7.1" tokio = "0.1.7" rand = "0.6" -parity-codec = "3.1" -parity-codec-derive = "3.1" +parity-codec = { version = "3.1", features = ["derive"] } runtime_primitives = { package = "sr-primitives", path = "../sr-primitives" } consensus_common = { package = "substrate-consensus-common", path = "../consensus/common" } substrate-primitives = { path = "../primitives" } diff --git a/substrate/core/finality-grandpa/primitives/Cargo.toml b/substrate/core/finality-grandpa/primitives/Cargo.toml index acb509b6b5..3891db8f01 100644 --- a/substrate/core/finality-grandpa/primitives/Cargo.toml +++ b/substrate/core/finality-grandpa/primitives/Cargo.toml @@ -7,8 +7,7 @@ edition = "2018" [dependencies] client = { package = "substrate-client", path = "../../client", default-features = false } substrate-primitives = { path = "../../primitives", default-features = false } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } sr-primitives = { path = "../../sr-primitives", default-features = false } rstd = { package = "sr-std", path = "../../sr-std", default-features = false } @@ -18,7 +17,6 @@ std = [ "substrate-primitives/std", "client/std", "parity-codec/std", - "parity-codec-derive/std", "sr-primitives/std", "rstd/std", ] diff --git a/substrate/core/finality-grandpa/primitives/src/lib.rs b/substrate/core/finality-grandpa/primitives/src/lib.rs index 9055156ca3..4878b79efb 100644 --- a/substrate/core/finality-grandpa/primitives/src/lib.rs +++ b/substrate/core/finality-grandpa/primitives/src/lib.rs @@ -22,7 +22,7 @@ #[cfg(not(feature = "std"))] extern crate alloc; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use substrate_primitives::Ed25519AuthorityId; use sr_primitives::traits::{DigestFor, NumberFor}; use client::decl_runtime_apis; diff --git a/substrate/core/finality-grandpa/src/authorities.rs b/substrate/core/finality-grandpa/src/authorities.rs index d8849acc36..b6cc1baed3 100644 --- a/substrate/core/finality-grandpa/src/authorities.rs +++ b/substrate/core/finality-grandpa/src/authorities.rs @@ -20,7 +20,7 @@ use fork_tree::ForkTree; use parking_lot::RwLock; use substrate_primitives::Ed25519AuthorityId; use grandpa::VoterSet; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use log::{debug, info}; use std::cmp::Ord; diff --git a/substrate/core/finality-grandpa/src/consensus_changes.rs b/substrate/core/finality-grandpa/src/consensus_changes.rs index 3e891e8b30..9d701152dd 100644 --- a/substrate/core/finality-grandpa/src/consensus_changes.rs +++ b/substrate/core/finality-grandpa/src/consensus_changes.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . use std::sync::Arc; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; /// Consensus-related data changes tracker. #[derive(Clone, Debug, Encode, Decode)] diff --git a/substrate/core/finality-grandpa/src/finality_proof.rs b/substrate/core/finality-grandpa/src/finality_proof.rs index efce7aa1cb..14f011a10c 100644 --- a/substrate/core/finality-grandpa/src/finality_proof.rs +++ b/substrate/core/finality-grandpa/src/finality_proof.rs @@ -37,7 +37,6 @@ use client::{ light::fetcher::RemoteCallRequest, }; use parity_codec::{Encode, Decode}; -use parity_codec_derive::{Encode, Decode}; use grandpa::BlockNumberOps; use runtime_primitives::generic::BlockId; use runtime_primitives::traits::{ diff --git a/substrate/core/finality-grandpa/src/justification.rs b/substrate/core/finality-grandpa/src/justification.rs index 563840bc17..52ce9006e1 100644 --- a/substrate/core/finality-grandpa/src/justification.rs +++ b/substrate/core/finality-grandpa/src/justification.rs @@ -20,8 +20,7 @@ use client::{CallExecutor, Client}; use client::backend::Backend; use client::blockchain::HeaderBackend; use client::error::{Error as ClientError, ErrorKind as ClientErrorKind}; -use parity_codec::Decode; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use grandpa::VoterSet; use grandpa::{Error as GrandpaError}; use runtime_primitives::generic::BlockId; diff --git a/substrate/core/finality-grandpa/src/lib.rs b/substrate/core/finality-grandpa/src/lib.rs index 64e36a46e4..806fc6cfaa 100644 --- a/substrate/core/finality-grandpa/src/lib.rs +++ b/substrate/core/finality-grandpa/src/lib.rs @@ -61,7 +61,6 @@ use client::{ }; use client::blockchain::HeaderBackend; use parity_codec::{Encode, Decode}; -use parity_codec_derive::{Encode, Decode}; use runtime_primitives::traits::{ NumberFor, Block as BlockT, Header as HeaderT, DigestFor, ProvideRuntimeApi, Hash as HashT, DigestItemFor, DigestItem, diff --git a/substrate/core/inherents/Cargo.toml b/substrate/core/inherents/Cargo.toml index 9258f28790..2ea3c69a76 100644 --- a/substrate/core/inherents/Cargo.toml +++ b/substrate/core/inherents/Cargo.toml @@ -7,8 +7,7 @@ edition = "2018" [dependencies] parking_lot = { version = "0.7", optional = true } rstd = { package = "sr-std", path = "../sr-std", default-features = false } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } runtime_primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false } [features] diff --git a/substrate/core/inherents/src/lib.rs b/substrate/core/inherents/src/lib.rs index becd99e481..4f9c8b8006 100644 --- a/substrate/core/inherents/src/lib.rs +++ b/substrate/core/inherents/src/lib.rs @@ -33,7 +33,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use parity_codec as codec; -use parity_codec_derive::{Encode, Decode}; +use codec::{Encode, Decode}; use rstd::{collections::btree_map::{BTreeMap, IntoIter, Entry}, vec::Vec}; diff --git a/substrate/core/network/Cargo.toml b/substrate/core/network/Cargo.toml index 206998e799..4d78eeb602 100644 --- a/substrate/core/network/Cargo.toml +++ b/substrate/core/network/Cargo.toml @@ -25,8 +25,7 @@ primitives = { package = "substrate-primitives", path = "../../core/primitives" consensus = { package = "substrate-consensus-common", path = "../../core/consensus/common" } client = { package = "substrate-client", path = "../../core/client" } runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives" } -parity-codec = "3.1" -parity-codec-derive = "3.1" +parity-codec = { version = "3.1", features = ["derive"] } network_libp2p = { package = "substrate-network-libp2p", path = "../../core/network-libp2p" } tokio = "0.1.11" keyring = { package = "substrate-keyring", path = "../../core/keyring", optional = true } diff --git a/substrate/core/network/src/message.rs b/substrate/core/network/src/message.rs index 416574e387..98860cae88 100644 --- a/substrate/core/network/src/message.rs +++ b/substrate/core/network/src/message.rs @@ -19,7 +19,6 @@ use bitflags::bitflags; use runtime_primitives::traits::{Block as BlockT, Header as HeaderT}; use parity_codec::{Encode, Decode, Input, Output}; -use parity_codec_derive::{Encode, Decode}; pub use self::generic::{ BlockAnnounce, RemoteCallRequest, RemoteReadRequest, RemoteHeaderRequest, RemoteHeaderResponse, @@ -131,7 +130,6 @@ pub mod generic { use parity_codec::{Encode, Decode}; use network_libp2p::{CustomMessage, CustomMessageId}; use runtime_primitives::Justification; - use parity_codec_derive::{Encode, Decode}; use crate::config::Roles; use super::{ BlockAttributes, RemoteCallResponse, RemoteReadResponse, diff --git a/substrate/core/primitives/Cargo.toml b/substrate/core/primitives/Cargo.toml index 0582614a1e..ad42502ddc 100644 --- a/substrate/core/primitives/Cargo.toml +++ b/substrate/core/primitives/Cargo.toml @@ -6,8 +6,7 @@ edition = "2018" [dependencies] rstd = { package = "sr-std", path = "../sr-std", default-features = false } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } rustc-hex = { version = "2.0", default-features = false } serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } diff --git a/substrate/core/primitives/src/authority_id.rs b/substrate/core/primitives/src/authority_id.rs index c7f8fd6958..5f2c84fd06 100644 --- a/substrate/core/primitives/src/authority_id.rs +++ b/substrate/core/primitives/src/authority_id.rs @@ -16,7 +16,7 @@ #[cfg(feature = "std")] use serde::{Serialize, Serializer, Deserialize, Deserializer}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use crate::H256; /// An identifier for an authority in the consensus algorithm. The same size as ed25519::Public. diff --git a/substrate/core/primitives/src/changes_trie.rs b/substrate/core/primitives/src/changes_trie.rs index 8ccd3eb4c0..f06bf49a8e 100644 --- a/substrate/core/primitives/src/changes_trie.rs +++ b/substrate/core/primitives/src/changes_trie.rs @@ -18,7 +18,7 @@ #[cfg(any(feature = "std", test))] use serde_derive::{Serialize, Deserialize}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; /// Substrate changes trie configuration. #[cfg_attr(any(feature = "std", test), derive(Serialize, Deserialize))] diff --git a/substrate/core/primitives/src/ed25519.rs b/substrate/core/primitives/src/ed25519.rs index 313952ed2f..dcf95b21e6 100644 --- a/substrate/core/primitives/src/ed25519.rs +++ b/substrate/core/primitives/src/ed25519.rs @@ -23,7 +23,7 @@ use blake2_rfc; use ring::{rand, signature, signature::KeyPair}; use crate::{hash::H512, Ed25519AuthorityId}; use base58::{ToBase58, FromBase58}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; #[cfg(feature = "std")] use serde::{de, Serializer, Deserializer, Deserialize}; diff --git a/substrate/core/primitives/src/lib.rs b/substrate/core/primitives/src/lib.rs index cb1f722043..3eff7059f4 100644 --- a/substrate/core/primitives/src/lib.rs +++ b/substrate/core/primitives/src/lib.rs @@ -34,7 +34,7 @@ macro_rules! map { use rstd::prelude::*; use rstd::ops::Deref; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; #[cfg(feature = "std")] use std::borrow::Cow; #[cfg(feature = "std")] diff --git a/substrate/core/primitives/src/sandbox.rs b/substrate/core/primitives/src/sandbox.rs index 71f9199cf5..01bfd4143d 100644 --- a/substrate/core/primitives/src/sandbox.rs +++ b/substrate/core/primitives/src/sandbox.rs @@ -16,9 +16,7 @@ //! Definition of a sandbox environment. -#[cfg(test)] -use parity_codec::Encode; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use rstd::vec::Vec; /// Error error that can be returned from host function. diff --git a/substrate/core/primitives/src/sr25519.rs b/substrate/core/primitives/src/sr25519.rs index 842de7c682..729b8790f9 100644 --- a/substrate/core/primitives/src/sr25519.rs +++ b/substrate/core/primitives/src/sr25519.rs @@ -23,7 +23,7 @@ use blake2_rfc; use rand::rngs::OsRng; use schnorrkel::{signing_context, Keypair, MiniSecretKey, PublicKey}; use sha2::Sha512; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use crate::hash::H512; #[cfg(feature = "std")] diff --git a/substrate/core/sr-primitives/Cargo.toml b/substrate/core/sr-primitives/Cargo.toml index bd18b40b80..2a971c3941 100644 --- a/substrate/core/sr-primitives/Cargo.toml +++ b/substrate/core/sr-primitives/Cargo.toml @@ -9,8 +9,7 @@ num-traits = { version = "0.2", default-features = false } integer-sqrt = { version = "0.1.2" } serde = { version = "1.0", optional = true } serde_derive = { version = "1.0", optional = true } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } substrate-primitives = { path = "../primitives", default-features = false } rstd = { package = "sr-std", path = "../sr-std", default-features = false } runtime_io = { package = "sr-io", path = "../sr-io", default-features = false } diff --git a/substrate/core/sr-primitives/src/generic/block.rs b/substrate/core/sr-primitives/src/generic/block.rs index 951e5cbfbb..1e6255c681 100644 --- a/substrate/core/sr-primitives/src/generic/block.rs +++ b/substrate/core/sr-primitives/src/generic/block.rs @@ -23,8 +23,7 @@ use std::fmt; use serde_derive::Serialize; use rstd::prelude::*; -use parity_codec_derive::{Encode, Decode}; -use crate::codec::Codec; +use crate::codec::{Codec, Encode, Decode}; use crate::traits::{self, Member, Block as BlockT, Header as HeaderT, MaybeSerialize}; use crate::Justification; diff --git a/substrate/core/sr-primitives/src/generic/digest.rs b/substrate/core/sr-primitives/src/generic/digest.rs index 64bc0396fd..243cf05164 100644 --- a/substrate/core/sr-primitives/src/generic/digest.rs +++ b/substrate/core/sr-primitives/src/generic/digest.rs @@ -20,7 +20,6 @@ use serde_derive::Serialize; use rstd::prelude::*; -use parity_codec_derive::{Encode, Decode}; use crate::codec::{Decode, Encode, Codec, Input}; use crate::traits::{self, Member, DigestItem as DigestItemT, MaybeHash}; diff --git a/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs b/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs index 25661031e6..a0800fe502 100644 --- a/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs +++ b/substrate/core/sr-primitives/src/generic/unchecked_extrinsic.rs @@ -20,7 +20,6 @@ use std::fmt; use rstd::prelude::*; -use parity_codec_derive::{Encode, Decode}; use crate::codec::{Decode, Encode, Codec, Input, HasCompact}; use crate::traits::{self, Member, SimpleArithmetic, MaybeDisplay, Lookup, Extrinsic}; use super::CheckedExtrinsic; diff --git a/substrate/core/sr-primitives/src/generic/unchecked_mortal_compact_extrinsic.rs b/substrate/core/sr-primitives/src/generic/unchecked_mortal_compact_extrinsic.rs index 3ffe7fae40..9c74995d0a 100644 --- a/substrate/core/sr-primitives/src/generic/unchecked_mortal_compact_extrinsic.rs +++ b/substrate/core/sr-primitives/src/generic/unchecked_mortal_compact_extrinsic.rs @@ -190,7 +190,7 @@ impl fmt::Debug for UncheckedMortalCompactExtri mod tests { use super::*; use runtime_io::blake2_256; - use parity_codec_derive::{Encode, Decode}; + use crate::codec::{Encode, Decode}; use serde_derive::{Serialize, Deserialize}; struct TestContext; diff --git a/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs b/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs index 06c9003e33..e7d104a1da 100644 --- a/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs +++ b/substrate/core/sr-primitives/src/generic/unchecked_mortal_extrinsic.rs @@ -189,7 +189,7 @@ impl fmt::Debug for UncheckedMortalExtrinsic = RawLog<::AuthorityId>; @@ -611,7 +610,7 @@ mod tests { mod b { use super::RuntimeT; - use parity_codec_derive::{Encode, Decode}; + use crate::codec::{Encode, Decode}; use serde_derive::Serialize; pub type Log = RawLog<::AuthorityId>; @@ -630,24 +629,24 @@ mod tests { // encode/decode regular item let b1: Log = b::RawLog::B1::(777).into(); let encoded_b1 = b1.encode(); - let decoded_b1: Log = DecodeHidden::decode(&mut &encoded_b1[..]).unwrap(); + let decoded_b1: Log = Decode::decode(&mut &encoded_b1[..]).unwrap(); assert_eq!(b1, decoded_b1); // encode/decode system item let auth_change: Log = a::RawLog::AuthoritiesChange::(vec![100, 200, 300]).into(); let encoded_auth_change = auth_change.encode(); - let decoded_auth_change: Log = DecodeHidden::decode(&mut &encoded_auth_change[..]).unwrap(); + let decoded_auth_change: Log = Decode::decode(&mut &encoded_auth_change[..]).unwrap(); assert_eq!(auth_change, decoded_auth_change); // interpret regular item using `generic::DigestItem` - let generic_b1: super::generic::DigestItem = DecodeHidden::decode(&mut &encoded_b1[..]).unwrap(); + let generic_b1: super::generic::DigestItem = Decode::decode(&mut &encoded_b1[..]).unwrap(); match generic_b1 { super::generic::DigestItem::Other(_) => (), _ => panic!("unexpected generic_b1: {:?}", generic_b1), } // interpret system item using `generic::DigestItem` - let generic_auth_change: super::generic::DigestItem = DecodeHidden::decode(&mut &encoded_auth_change[..]).unwrap(); + let generic_auth_change: super::generic::DigestItem = Decode::decode(&mut &encoded_auth_change[..]).unwrap(); match generic_auth_change { super::generic::DigestItem::AuthoritiesChange::(authorities) => assert_eq!(authorities, vec![100, 200, 300]), _ => panic!("unexpected generic_auth_change: {:?}", generic_auth_change), diff --git a/substrate/core/sr-primitives/src/testing.rs b/substrate/core/sr-primitives/src/testing.rs index b854ca317a..a1c05aa7d7 100644 --- a/substrate/core/sr-primitives/src/testing.rs +++ b/substrate/core/sr-primitives/src/testing.rs @@ -24,13 +24,12 @@ use std::{fmt::Debug, ops::Deref, fmt}; use crate::codec::{Codec, Encode, Decode}; use crate::traits::{self, Checkable, Applyable, BlakeTwo256, Convert}; use crate::generic::DigestItem as GenDigestItem; -use parity_codec_derive::{Encode, Decode}; pub use substrate_primitives::{H256, Ed25519AuthorityId}; use substrate_primitives::U256; /// Authority Id -#[derive(Default, PartialEq, Eq, Clone, Decode, Encode, Debug)] +#[derive(Default, PartialEq, Eq, Clone, Encode, Decode, Debug)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub struct UintAuthorityId(pub u64); impl Into for UintAuthorityId { diff --git a/substrate/core/sr-primitives/src/transaction_validity.rs b/substrate/core/sr-primitives/src/transaction_validity.rs index 472cc198fd..8cdd419278 100644 --- a/substrate/core/sr-primitives/src/transaction_validity.rs +++ b/substrate/core/sr-primitives/src/transaction_validity.rs @@ -17,7 +17,7 @@ //! Transaction validity interface. use rstd::prelude::*; -use parity_codec_derive::{Encode, Decode}; +use crate::codec::{Encode, Decode}; /// Priority for a transaction. Additive. Higher is better. pub type TransactionPriority = u64; diff --git a/substrate/core/sr-version/Cargo.toml b/substrate/core/sr-version/Cargo.toml index f4a0d8111f..3ad1ac299e 100644 --- a/substrate/core/sr-version/Cargo.toml +++ b/substrate/core/sr-version/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" impl-serde = { version = "0.1", optional = true } serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } rstd = { package = "sr-std", path = "../sr-std", default-features = false } runtime_primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false } diff --git a/substrate/core/sr-version/src/lib.rs b/substrate/core/sr-version/src/lib.rs index 6d16f2e47c..67c151cbeb 100644 --- a/substrate/core/sr-version/src/lib.rs +++ b/substrate/core/sr-version/src/lib.rs @@ -27,6 +27,9 @@ use std::collections::HashSet; #[cfg(feature = "std")] use runtime_primitives::traits::RuntimeApiInfo; +use parity_codec::Encode; +#[cfg(feature = "std")] +use parity_codec::Decode; use runtime_primitives::RuntimeString; pub use runtime_primitives::create_runtime_str; @@ -59,8 +62,8 @@ macro_rules! create_apis_vec { /// This triplet have different semantics and mis-interpretation could cause problems. /// In particular: bug fixes should result in an increment of `spec_version` and possibly `authoring_version`, /// absolutely not `impl_version` since they change the semantics of the runtime. -#[derive(Clone, PartialEq, Eq, parity_codec_derive::Encode)] -#[cfg_attr(feature = "std", derive(Debug, Serialize, parity_codec_derive::Decode))] +#[derive(Clone, PartialEq, Eq, Encode)] +#[cfg_attr(feature = "std", derive(Debug, Serialize, Decode))] #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] pub struct RuntimeVersion { /// Identifies the different Substrate runtimes. There'll be at least polkadot and node. diff --git a/substrate/core/state-db/Cargo.toml b/substrate/core/state-db/Cargo.toml index 8b867c837e..17cd633518 100644 --- a/substrate/core/state-db/Cargo.toml +++ b/substrate/core/state-db/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" parking_lot = "0.7.1" log = "0.4" primitives = { package = "substrate-primitives", path = "../../core/primitives" } -parity-codec = "3.1" -parity-codec-derive = "3.1" +parity-codec = { version = "3.1", features = ["derive"] } [dev-dependencies] env_logger = "0.6" diff --git a/substrate/core/state-db/src/noncanonical.rs b/substrate/core/state-db/src/noncanonical.rs index 78a958b066..c11fcd74c3 100644 --- a/substrate/core/state-db/src/noncanonical.rs +++ b/substrate/core/state-db/src/noncanonical.rs @@ -23,8 +23,7 @@ use std::fmt; use std::collections::{HashMap, VecDeque, hash_map::Entry}; use super::{Error, DBValue, ChangeSet, CommitSet, MetaDb, Hash, to_meta_key}; -use crate::codec::{Decode, Encode}; -use parity_codec_derive::{Decode, Encode}; +use crate::codec::{Encode, Decode}; use log::trace; const NON_CANONICAL_JOURNAL: &[u8] = b"noncanonical_journal"; diff --git a/substrate/core/state-db/src/pruning.rs b/substrate/core/state-db/src/pruning.rs index 83cd51b70b..95af8c553f 100644 --- a/substrate/core/state-db/src/pruning.rs +++ b/substrate/core/state-db/src/pruning.rs @@ -26,7 +26,6 @@ use std::collections::{HashMap, HashSet, VecDeque}; use std::mem; use crate::codec::{Encode, Decode}; use crate::{CommitSet, Error, MetaDb, to_meta_key, Hash}; -use parity_codec_derive::{Encode, Decode}; use log::{trace, warn}; const LAST_PRUNED: &[u8] = b"last_pruned"; diff --git a/substrate/core/test-runtime/Cargo.toml b/substrate/core/test-runtime/Cargo.toml index 67396ee96a..a3e413e5e6 100644 --- a/substrate/core/test-runtime/Cargo.toml +++ b/substrate/core/test-runtime/Cargo.toml @@ -9,8 +9,7 @@ log = { version = "0.4", optional = true } hex-literal = { version = "0.1.0", optional = true } serde = { version = "1.0", optional = true } serde_derive = { version = "1.0", optional = true } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } keyring = { package = "substrate-keyring", path = "../keyring", optional = true } substrate-client = { path = "../client", default-features = false } primitives = { package = "substrate-primitives", path = "../primitives", default-features = false } diff --git a/substrate/core/test-runtime/src/lib.rs b/substrate/core/test-runtime/src/lib.rs index 36de756c80..1aa172fd60 100644 --- a/substrate/core/test-runtime/src/lib.rs +++ b/substrate/core/test-runtime/src/lib.rs @@ -23,7 +23,6 @@ pub mod system; use rstd::{prelude::*, marker::PhantomData}; use parity_codec::{Encode, Decode, Input}; -use parity_codec_derive::{Encode, Decode}; use substrate_client::{ runtime_api as client_api, block_builder::api as block_builder_api, decl_runtime_apis, diff --git a/substrate/core/test-runtime/wasm/Cargo.lock b/substrate/core/test-runtime/wasm/Cargo.lock index 3be629da2d..1dae80fcba 100644 --- a/substrate/core/test-runtime/wasm/Cargo.lock +++ b/substrate/core/test-runtime/wasm/Cargo.lock @@ -704,6 +704,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1179,7 +1180,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-io 0.1.0", @@ -1200,7 +1200,6 @@ version = "0.1.0" dependencies = [ "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-primitives 0.1.0", @@ -1212,7 +1211,6 @@ name = "srml-metadata" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-std 0.1.0", @@ -1226,7 +1224,6 @@ dependencies = [ "hex-literal 0.1.1 (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.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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)", @@ -1292,7 +1289,6 @@ dependencies = [ "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 0.1.0", "sr-primitives 0.1.0", @@ -1361,7 +1357,6 @@ name = "substrate-inherents" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -1396,7 +1391,6 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1461,7 +1455,6 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-io 0.1.0", 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 d35194b45d..f4a22553c1 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/core/util/fork-tree/Cargo.toml b/substrate/core/util/fork-tree/Cargo.toml index b751a8cf85..7dfd82991f 100644 --- a/substrate/core/util/fork-tree/Cargo.toml +++ b/substrate/core/util/fork-tree/Cargo.toml @@ -5,5 +5,4 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -parity-codec = "3.1" -parity-codec-derive = "3.1" +parity-codec = { version = "3.1", features = ["derive"] } diff --git a/substrate/core/util/fork-tree/src/lib.rs b/substrate/core/util/fork-tree/src/lib.rs index ee347b940c..caed51adf6 100644 --- a/substrate/core/util/fork-tree/src/lib.rs +++ b/substrate/core/util/fork-tree/src/lib.rs @@ -20,7 +20,7 @@ #![warn(missing_docs)] use std::fmt; -use parity_codec_derive::{Decode, Encode}; +use parity_codec::{Decode, Encode}; /// Error occured when interating with the tree. #[derive(Clone, Debug, PartialEq)] diff --git a/substrate/node-template/runtime/Cargo.toml b/substrate/node-template/runtime/Cargo.toml index 24f9ab7ad9..986b12ce94 100644 --- a/substrate/node-template/runtime/Cargo.toml +++ b/substrate/node-template/runtime/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } rstd = { package = "sr-std", path = "../../core/sr-std", default_features = false } runtime-io = { package = "sr-io", path = "../../core/sr-io", default_features = false } version = { package = "sr-version", path = "../../core/sr-version", default_features = false } @@ -32,7 +31,6 @@ consensus-aura = { package = "substrate-consensus-aura-primitives", path = "../. default = ["std"] std = [ "parity-codec/std", - "parity-codec-derive/std", "primitives/std", "client/std", "rstd/std", diff --git a/substrate/node-template/runtime/src/lib.rs b/substrate/node-template/runtime/src/lib.rs index 7c68046707..9caef856fd 100644 --- a/substrate/node-template/runtime/src/lib.rs +++ b/substrate/node-template/runtime/src/lib.rs @@ -7,7 +7,7 @@ #[cfg(feature = "std")] use serde_derive::{Serialize, Deserialize}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use rstd::prelude::*; #[cfg(feature = "std")] use primitives::bytes; diff --git a/substrate/node-template/runtime/wasm/Cargo.lock b/substrate/node-template/runtime/wasm/Cargo.lock index 0354ebd8ce..f1b317903e 100644 --- a/substrate/node-template/runtime/wasm/Cargo.lock +++ b/substrate/node-template/runtime/wasm/Cargo.lock @@ -643,7 +643,6 @@ name = "node-template-runtime" version = "0.9.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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)", "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", @@ -752,6 +751,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1244,7 +1244,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 0.1.0", @@ -1265,7 +1264,6 @@ version = "0.1.0" dependencies = [ "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", @@ -1278,7 +1276,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -1296,7 +1293,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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-primitives 0.1.0", @@ -1312,7 +1308,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", @@ -1375,7 +1370,6 @@ name = "srml-metadata" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 0.1.0", @@ -1405,7 +1399,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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-primitives 0.1.0", @@ -1439,7 +1432,6 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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.85 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1488,7 +1480,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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)", "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1505,7 +1496,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -1538,7 +1528,6 @@ dependencies = [ "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 0.1.0", "sr-primitives 0.1.0", @@ -1607,7 +1596,6 @@ name = "substrate-inherents" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -1642,7 +1630,6 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/substrate/node/runtime/Cargo.toml b/substrate/node/runtime/Cargo.toml index 8c2e24ffb3..ac220ab7a8 100644 --- a/substrate/node/runtime/Cargo.toml +++ b/substrate/node/runtime/Cargo.toml @@ -7,8 +7,7 @@ edition = "2018" [dependencies] integer-sqrt = { version = "0.1.2" } safe-mix = { version = "1.0", default-features = false } -parity-codec-derive = { version = "3.1" } -parity-codec = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } substrate-primitives = { path = "../../core/primitives", default-features = false } client = { package = "substrate-client", path = "../../core/client", default-features = false } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } diff --git a/substrate/node/runtime/src/lib.rs b/substrate/node/runtime/src/lib.rs index ad4403da0d..ecbdbf691e 100644 --- a/substrate/node/runtime/src/lib.rs +++ b/substrate/node/runtime/src/lib.rs @@ -21,7 +21,7 @@ #![recursion_limit="256"] use rstd::prelude::*; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; #[cfg(feature = "std")] use support::{Serialize, Deserialize}; use support::construct_runtime; diff --git a/substrate/node/runtime/wasm/Cargo.lock b/substrate/node/runtime/wasm/Cargo.lock index 316675d085..c4b1e60dc3 100644 --- a/substrate/node/runtime/wasm/Cargo.lock +++ b/substrate/node/runtime/wasm/Cargo.lock @@ -646,7 +646,6 @@ dependencies = [ "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "node-primitives 0.1.0", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (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)", @@ -763,6 +762,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1256,7 +1256,6 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-io 0.1.0", @@ -1288,7 +1287,6 @@ version = "0.1.0" dependencies = [ "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-primitives 0.1.0", @@ -1301,7 +1299,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -1319,7 +1316,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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-primitives 0.1.0", @@ -1335,7 +1331,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-primitives 0.1.0", @@ -1351,7 +1346,6 @@ name = "srml-contract" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1391,7 +1385,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1436,7 +1429,6 @@ name = "srml-grandpa" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-primitives 0.1.0", @@ -1471,7 +1463,6 @@ name = "srml-metadata" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-std 0.1.0", @@ -1501,7 +1492,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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-primitives 0.1.0", @@ -1535,7 +1525,6 @@ dependencies = [ "hex-literal 0.1.1 (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.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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)", @@ -1584,7 +1573,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.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)", "serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1601,7 +1589,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -1617,7 +1604,6 @@ version = "0.1.0" dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (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)", "sr-primitives 0.1.0", @@ -1663,7 +1649,6 @@ dependencies = [ "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 0.1.0", "sr-primitives 0.1.0", @@ -1732,7 +1717,6 @@ name = "substrate-finality-grandpa-primitives" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", "substrate-client 0.1.0", @@ -1744,7 +1728,6 @@ name = "substrate-inherents" version = "0.1.0" dependencies = [ "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 0.1.0", "sr-std 0.1.0", @@ -1779,7 +1762,6 @@ dependencies = [ "hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "ring 0.14.5 (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 565063ef79..b86fbdea66 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/aura/Cargo.toml b/substrate/srml/aura/Cargo.toml index edf7743a4d..49c371cd45 100644 --- a/substrate/srml/aura/Cargo.toml +++ b/substrate/srml/aura/Cargo.toml @@ -6,8 +6,7 @@ edition = "2018" [dependencies] hex-literal = "0.1.0" -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } serde = { version = "1.0", default-features = false } inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } diff --git a/substrate/srml/aura/src/lib.rs b/substrate/srml/aura/src/lib.rs index 9c49dcb0b4..26cfaf4299 100644 --- a/substrate/srml/aura/src/lib.rs +++ b/substrate/srml/aura/src/lib.rs @@ -27,9 +27,7 @@ use primitives::traits::{As, Zero}; use timestamp::OnTimestampSet; #[cfg(feature = "std")] use timestamp::TimestampInherentData; -#[cfg(feature = "std")] -use parity_codec::Decode; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use inherents::{RuntimeString, InherentIdentifier, InherentData, ProvideInherent, MakeFatalError}; #[cfg(feature = "std")] use inherents::{InherentDataProviders, ProvideInherentData}; diff --git a/substrate/srml/balances/Cargo.toml b/substrate/srml/balances/Cargo.toml index 237a88a4df..1cb75c94ed 100644 --- a/substrate/srml/balances/Cargo.toml +++ b/substrate/srml/balances/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } safe-mix = { version = "1.0", default-features = false} -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } substrate-keyring = { path = "../../core/keyring", optional = true } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } @@ -27,7 +26,6 @@ std = [ "safe-mix/std", "substrate-keyring", "parity-codec/std", - "parity-codec-derive/std", "rstd/std", "srml-support/std", "primitives/std", diff --git a/substrate/srml/balances/src/lib.rs b/substrate/srml/balances/src/lib.rs index 9a593e7ee1..f5168240a7 100644 --- a/substrate/srml/balances/src/lib.rs +++ b/substrate/srml/balances/src/lib.rs @@ -26,8 +26,7 @@ use rstd::prelude::*; use rstd::{cmp, result}; -use parity_codec::Codec; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Codec, Encode, Decode}; use srml_support::{StorageValue, StorageMap, Parameter, decl_event, decl_storage, decl_module, ensure}; use srml_support::traits::{ UpdateBalanceOutcome, Currency, EnsureAccountLiquid, OnFreeBalanceZero, TransferAsset, WithdrawReason, ArithmeticType diff --git a/substrate/srml/consensus/Cargo.toml b/substrate/srml/consensus/Cargo.toml index 8035b71635..075980fc5f 100644 --- a/substrate/srml/consensus/Cargo.toml +++ b/substrate/srml/consensus/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } substrate-primitives = { path = "../../core/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 } diff --git a/substrate/srml/consensus/src/lib.rs b/substrate/srml/consensus/src/lib.rs index aacda64997..a99a370642 100644 --- a/substrate/srml/consensus/src/lib.rs +++ b/substrate/srml/consensus/src/lib.rs @@ -22,8 +22,7 @@ use serde_derive::Serialize; use rstd::prelude::*; use parity_codec as codec; -use codec::Encode; -use parity_codec_derive::{Encode, Decode}; +use codec::{Encode, Decode}; use srml_support::{storage, Parameter, decl_storage, decl_module}; use srml_support::storage::StorageValue; use srml_support::storage::unhashed::StorageVec; diff --git a/substrate/srml/contract/Cargo.toml b/substrate/srml/contract/Cargo.toml index e3f1bcdaaa..05d9a8e616 100644 --- a/substrate/srml/contract/Cargo.toml +++ b/substrate/srml/contract/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } pwasm-utils = { version = "0.6.1", default-features = false } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } parity-wasm = { version = "0.31", default-features = false } substrate-primitives = { path = "../../core/primitives", default-features = false } runtime-primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } @@ -34,7 +33,6 @@ std = [ "serde/std", "serde_derive", "parity-codec/std", - "parity-codec-derive/std", "substrate-primitives/std", "runtime-primitives/std", "runtime-io/std", diff --git a/substrate/srml/contract/src/lib.rs b/substrate/srml/contract/src/lib.rs index 90cccfce79..0fa88400e6 100644 --- a/substrate/srml/contract/src/lib.rs +++ b/substrate/srml/contract/src/lib.rs @@ -69,8 +69,7 @@ use crate::account_db::AccountDb; use serde_derive::{Serialize, Deserialize}; use rstd::prelude::*; use rstd::marker::PhantomData; -use parity_codec::{Codec, Encode}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Codec, Encode, Decode}; use runtime_primitives::traits::{Hash, As, SimpleArithmetic,Bounded, StaticLookup}; use srml_support::dispatch::{Result, Dispatchable}; use srml_support::{Parameter, StorageMap, StorageValue, StorageDoubleMap, decl_module, decl_event, decl_storage}; diff --git a/substrate/srml/contract/src/wasm/mod.rs b/substrate/srml/contract/src/wasm/mod.rs index 5348df1ad3..4b4df900ac 100644 --- a/substrate/srml/contract/src/wasm/mod.rs +++ b/substrate/srml/contract/src/wasm/mod.rs @@ -23,7 +23,7 @@ use crate::exec::{Ext, EmptyOutputBuf, VmExecResult}; use crate::gas::GasMeter; use rstd::prelude::*; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use sandbox; #[macro_use] diff --git a/substrate/srml/democracy/Cargo.toml b/substrate/srml/democracy/Cargo.toml index 8bd1968041..23ca4221cf 100644 --- a/substrate/srml/democracy/Cargo.toml +++ b/substrate/srml/democracy/Cargo.toml @@ -9,8 +9,7 @@ hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false } primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } diff --git a/substrate/srml/democracy/src/lib.rs b/substrate/srml/democracy/src/lib.rs index aa4b076a7c..e421fdeb0a 100644 --- a/substrate/srml/democracy/src/lib.rs +++ b/substrate/srml/democracy/src/lib.rs @@ -21,7 +21,7 @@ use rstd::prelude::*; use rstd::result; use primitives::traits::{Zero, As}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use srml_support::{StorageValue, StorageMap, Parameter, Dispatchable, IsSubType}; use srml_support::{decl_module, decl_storage, decl_event, ensure}; use srml_support::traits::{Currency, OnFreeBalanceZero, EnsureAccountLiquid, WithdrawReason, ArithmeticType}; diff --git a/substrate/srml/democracy/src/vote_threshold.rs b/substrate/srml/democracy/src/vote_threshold.rs index 9a730fc52a..2166b8dd06 100644 --- a/substrate/srml/democracy/src/vote_threshold.rs +++ b/substrate/srml/democracy/src/vote_threshold.rs @@ -18,7 +18,7 @@ #[cfg(feature = "std")] use serde_derive::{Serialize, Deserialize}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use primitives::traits::{Zero, IntegerSquareRoot}; use rstd::ops::{Add, Mul, Div, Rem}; diff --git a/substrate/srml/grandpa/Cargo.toml b/substrate/srml/grandpa/Cargo.toml index d1e50c7a29..c9faeadb5b 100644 --- a/substrate/srml/grandpa/Cargo.toml +++ b/substrate/srml/grandpa/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" #hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } substrate-primitives = { path = "../../core/primitives", default-features = false } substrate-finality-grandpa-primitives = { path = "../../core/finality-grandpa/primitives", default-features = false } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } diff --git a/substrate/srml/grandpa/src/lib.rs b/substrate/srml/grandpa/src/lib.rs index 9b586fe10d..16e73540d6 100644 --- a/substrate/srml/grandpa/src/lib.rs +++ b/substrate/srml/grandpa/src/lib.rs @@ -34,7 +34,7 @@ pub use substrate_finality_grandpa_primitives as fg_primitives; use serde_derive::Serialize; use rstd::prelude::*; use parity_codec as codec; -use parity_codec_derive::{Encode, Decode}; +use codec::{Encode, Decode}; use fg_primitives::ScheduledChange; use srml_support::{Parameter, decl_event, decl_storage, decl_module}; use srml_support::dispatch::Result; diff --git a/substrate/srml/grandpa/src/mock.rs b/substrate/srml/grandpa/src/mock.rs index 7123e784cc..ca5744b19b 100644 --- a/substrate/srml/grandpa/src/mock.rs +++ b/substrate/srml/grandpa/src/mock.rs @@ -23,8 +23,7 @@ use primitives::generic::DigestItem as GenDigestItem; use runtime_io; use srml_support::{impl_outer_origin, impl_outer_event}; use substrate_primitives::{H256, Blake2Hasher}; -use parity_codec::Encode; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use crate::{GenesisConfig, Trait, Module, RawLog}; impl_outer_origin!{ diff --git a/substrate/srml/metadata/Cargo.toml b/substrate/srml/metadata/Cargo.toml index 300a0b2a1e..1bbb8a77df 100644 --- a/substrate/srml/metadata/Cargo.toml +++ b/substrate/srml/metadata/Cargo.toml @@ -5,8 +5,7 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } serde = { version = "1.0", optional = true } serde_derive = { version = "1.0", optional = true } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } @@ -16,7 +15,6 @@ primitives = { package = "substrate-primitives", path = "../../core/primitives", default = ["std"] std = [ "parity-codec/std", - "parity-codec-derive/std", "rstd/std", "primitives/std", "serde", diff --git a/substrate/srml/metadata/src/lib.rs b/substrate/srml/metadata/src/lib.rs index 6b67b5adb5..f47843c871 100644 --- a/substrate/srml/metadata/src/lib.rs +++ b/substrate/srml/metadata/src/lib.rs @@ -26,10 +26,7 @@ use serde_derive::Serialize; #[cfg(feature = "std")] use parity_codec::{Decode, Input}; -#[cfg(feature = "std")] -use parity_codec_derive::Decode; use parity_codec::{Encode, Output}; -use parity_codec_derive::Encode; use rstd::vec::Vec; #[cfg(feature = "std")] diff --git a/substrate/srml/staking/Cargo.toml b/substrate/srml/staking/Cargo.toml index eead2b3ea5..5fc70e27ea 100644 --- a/substrate/srml/staking/Cargo.toml +++ b/substrate/srml/staking/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } safe-mix = { version = "1.0", default-features = false} -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } substrate-keyring = { path = "../../core/keyring", optional = true } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } @@ -31,7 +30,6 @@ std = [ "safe-mix/std", "substrate-keyring", "parity-codec/std", - "parity-codec-derive/std", "rstd/std", "srml-support/std", "primitives/std", diff --git a/substrate/srml/staking/src/lib.rs b/substrate/srml/staking/src/lib.rs index 180eb68fb3..71a7f27ce1 100644 --- a/substrate/srml/staking/src/lib.rs +++ b/substrate/srml/staking/src/lib.rs @@ -21,8 +21,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use rstd::{prelude::*, result}; -use parity_codec::HasCompact; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{HasCompact, Encode, Decode}; use srml_support::{StorageValue, StorageMap, EnumerableStorageMap, dispatch::Result}; use srml_support::{decl_module, decl_event, decl_storage, ensure}; use srml_support::traits::{ diff --git a/substrate/srml/support/Cargo.toml b/substrate/srml/support/Cargo.toml index 07dbc9b626..cda9aaa904 100644 --- a/substrate/srml/support/Cargo.toml +++ b/substrate/srml/support/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" hex-literal = { version = "0.1.0", optional = true } serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } srml-metadata = { path = "../metadata", default-features = false } sr-std = { path = "../../core/sr-std", default-features = false } runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false } diff --git a/substrate/srml/support/procedural/src/storage/impls.rs b/substrate/srml/support/procedural/src/storage/impls.rs index e008c81f83..0f953967d8 100644 --- a/substrate/srml/support/procedural/src/storage/impls.rs +++ b/substrate/srml/support/procedural/src/storage/impls.rs @@ -217,7 +217,7 @@ impl<'a> Impls<'a> { // generator for linked map let helpers = quote! { /// Linkage data of an element (it's successor and predecessor) - #[derive(#scrate::parity_codec_derive::Encode, #scrate::parity_codec_derive::Decode)] + #[derive(#scrate::codec::Encode, #scrate::codec::Decode)] pub(crate) struct #linkage { /// Previous element key in storage (None for the first element) pub previous: Option, diff --git a/substrate/srml/support/src/event.rs b/substrate/srml/support/src/event.rs index 093effc2e4..6d00e6b10b 100644 --- a/substrate/srml/support/src/event.rs +++ b/substrate/srml/support/src/event.rs @@ -26,9 +26,8 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn /// ```rust /// #[macro_use] /// extern crate srml_support; -/// extern crate parity_codec as codec; /// #[macro_use] -/// extern crate parity_codec_derive; +/// extern crate parity_codec as codec; /// #[macro_use] /// extern crate serde_derive; /// @@ -48,7 +47,7 @@ pub use srml_metadata::{EventMetadata, DecodeDifferent, OuterEventMetadata, FnEn /// extern crate srml_support; /// extern crate parity_codec as codec; /// #[macro_use] -/// extern crate parity_codec_derive; +/// extern crate parity_codec; /// #[macro_use] /// extern crate serde_derive; /// @@ -111,7 +110,7 @@ macro_rules! decl_event { } ) => { // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. - #[derive(Clone, PartialEq, Eq, $crate::parity_codec_derive::Encode, $crate::parity_codec_derive::Decode)] + #[derive(Clone, PartialEq, Eq, $crate::codec::Encode, $crate::codec::Decode)] #[cfg_attr(feature = "std", derive(Debug))] $(#[$attr])* pub enum Event { @@ -230,7 +229,7 @@ macro_rules! __decl_generic_event { ) => { pub type Event<$event_generic_param> = RawEvent<$( $generic_type ),*>; // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. - #[derive(Clone, PartialEq, Eq, $crate::parity_codec_derive::Encode, $crate::parity_codec_derive::Decode)] + #[derive(Clone, PartialEq, Eq, $crate::codec::Encode, $crate::codec::Decode)] #[cfg_attr(feature = "std", derive(Debug))] $(#[$attr])* pub enum RawEvent<$( $generic_param ),*> { @@ -373,7 +372,7 @@ macro_rules! impl_outer_event { $( $module_name:ident::Event $( <$generic_param:ident> )*, )*; ) => { // Workaround for https://github.com/rust-lang/rust/issues/26925 . Remove when sorted. - #[derive(Clone, PartialEq, Eq, $crate::parity_codec_derive::Encode, $crate::parity_codec_derive::Decode)] + #[derive(Clone, PartialEq, Eq, $crate::codec::Encode, $crate::codec::Decode)] #[cfg_attr(feature = "std", derive(Debug))] $(#[$attr])* #[allow(non_camel_case_types)] @@ -452,7 +451,7 @@ macro_rules! __impl_outer_event_json_metadata { mod tests { use super::*; use serde_derive::Serialize; - use parity_codec_derive::{Encode, Decode}; + use parity_codec::{Encode, Decode}; mod system { pub trait Trait { diff --git a/substrate/srml/support/src/lib.rs b/substrate/srml/support/src/lib.rs index 5980f5ddad..a7bbf32938 100644 --- a/substrate/srml/support/src/lib.rs +++ b/substrate/srml/support/src/lib.rs @@ -25,8 +25,6 @@ pub use serde; pub use sr_std as rstd; #[doc(hidden)] pub use parity_codec as codec; -#[doc(hidden)] -pub use parity_codec_derive; #[cfg(feature = "std")] #[doc(hidden)] pub use once_cell; diff --git a/substrate/srml/support/src/metadata.rs b/substrate/srml/support/src/metadata.rs index d9750975ee..229f132ac9 100644 --- a/substrate/srml/support/src/metadata.rs +++ b/substrate/srml/support/src/metadata.rs @@ -239,8 +239,6 @@ mod tests { ModuleMetadata, RuntimeMetadataPrefixed }; use crate::codec::{Encode, Decode}; - use parity_codec_derive::{Decode, Encode}; - mod system { pub trait Trait { diff --git a/substrate/srml/system/Cargo.toml b/substrate/srml/system/Cargo.toml index 8cb2822da2..f1f3692aa3 100644 --- a/substrate/srml/system/Cargo.toml +++ b/substrate/srml/system/Cargo.toml @@ -9,8 +9,7 @@ hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } safe-mix = { version = "1.0", default-features = false} -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } substrate-primitives = { path = "../../core/primitives", default-features = false } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false } @@ -24,7 +23,6 @@ std = [ "serde_derive", "safe-mix/std", "parity-codec/std", - "parity-codec-derive/std", "substrate-primitives/std", "rstd/std", "runtime_io/std", diff --git a/substrate/srml/system/src/lib.rs b/substrate/srml/system/src/lib.rs index d8070c2bb8..0a0cf624e7 100644 --- a/substrate/srml/system/src/lib.rs +++ b/substrate/srml/system/src/lib.rs @@ -30,10 +30,7 @@ use primitives::traits::{self, CheckEqual, SimpleArithmetic, SimpleBitOps, Zero, use substrate_primitives::storage::well_known_keys; use srml_support::{storage, StorageValue, StorageMap, Parameter, decl_module, decl_event, decl_storage}; use safe_mix::TripletMix; -use parity_codec_derive::{Encode, Decode}; - -#[cfg(any(feature = "std", test))] -use parity_codec::Encode; +use parity_codec::{Encode, Decode}; #[cfg(any(feature = "std", test))] use runtime_io::{twox_128, TestExternalities, Blake2Hasher}; diff --git a/substrate/srml/timestamp/Cargo.toml b/substrate/srml/timestamp/Cargo.toml index 56000c0363..d2133daebb 100644 --- a/substrate/srml/timestamp/Cargo.toml +++ b/substrate/srml/timestamp/Cargo.toml @@ -7,8 +7,7 @@ edition = "2018" [dependencies] hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false } @@ -29,7 +28,6 @@ std = [ "consensus/std", "serde/std", "parity-codec/std", - "parity-codec-derive/std", "system/std", "inherents/std", ] diff --git a/substrate/srml/timestamp/src/lib.rs b/substrate/srml/timestamp/src/lib.rs index d1d1f9f54e..a7fa9e9663 100644 --- a/substrate/srml/timestamp/src/lib.rs +++ b/substrate/srml/timestamp/src/lib.rs @@ -33,8 +33,8 @@ #![cfg_attr(not(feature = "std"), no_std)] #[cfg(feature = "std")] -use parity_codec_derive::Decode; -use parity_codec_derive::Encode; +use parity_codec::Decode; +use parity_codec::Encode; use srml_support::{StorageValue, Parameter, decl_storage, decl_module}; use srml_support::for_each_tuple; use runtime_primitives::traits::{As, SimpleArithmetic, Zero}; diff --git a/substrate/srml/treasury/Cargo.toml b/substrate/srml/treasury/Cargo.toml index 4e695375e5..d417a0e7e2 100644 --- a/substrate/srml/treasury/Cargo.toml +++ b/substrate/srml/treasury/Cargo.toml @@ -8,8 +8,7 @@ edition = "2018" hex-literal = "0.1.0" serde = { version = "1.0", default-features = false } serde_derive = { version = "1.0", optional = true } -parity-codec = { version = "3.1", default-features = false } -parity-codec-derive = { version = "3.1", default-features = false } +parity-codec = { version = "3.1", default-features = false, features = ["derive"] } rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false } runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false } srml-support = { path = "../support", default-features = false } @@ -26,7 +25,6 @@ std = [ "serde/std", "serde_derive", "parity-codec/std", - "parity-codec-derive/std", "rstd/std", "runtime_primitives/std", "srml-support/std", diff --git a/substrate/srml/treasury/src/lib.rs b/substrate/srml/treasury/src/lib.rs index 4a8913bc4d..2087846233 100644 --- a/substrate/srml/treasury/src/lib.rs +++ b/substrate/srml/treasury/src/lib.rs @@ -24,7 +24,7 @@ use rstd::prelude::*; use srml_support::{StorageValue, StorageMap, decl_module, decl_storage, decl_event, ensure}; use srml_support::traits::{Currency, OnDilution, ArithmeticType}; use runtime_primitives::{Permill, traits::{Zero, EnsureOrigin, StaticLookup}}; -use parity_codec_derive::{Encode, Decode}; +use parity_codec::{Encode, Decode}; use system::ensure_signed; type BalanceOf = <::Currency as ArithmeticType>::Type;