diff --git a/Cargo.lock b/Cargo.lock index 1d9d2f01b998e..af05d52d2eb1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -860,7 +860,7 @@ dependencies = [ "hashmap_core 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -917,7 +917,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "fork-tree" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1365,10 +1365,10 @@ dependencies = [ [[package]] name = "impl-codec" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1382,7 +1382,7 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2352,7 +2352,7 @@ dependencies = [ "node-primitives 2.0.0", "node-rpc 2.0.0", "node-runtime 2.0.0", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -2401,7 +2401,7 @@ dependencies = [ "node-primitives 2.0.0", "node-runtime 2.0.0", "node-testing 2.0.0", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", "srml-balances 2.0.0", @@ -2426,7 +2426,7 @@ dependencies = [ name = "node-primitives" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", @@ -2450,7 +2450,7 @@ dependencies = [ "node-primitives 2.0.0", "node-runtime 2.0.0", "node-testing 2.0.0", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", @@ -2479,7 +2479,7 @@ version = "2.0.0" dependencies = [ "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "node-primitives 2.0.0", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2530,7 +2530,7 @@ dependencies = [ "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "node-template-runtime 2.0.0", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "substrate-basic-authorship 2.0.0", @@ -2555,7 +2555,7 @@ dependencies = [ name = "node-template-runtime" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -2586,7 +2586,7 @@ dependencies = [ "node-executor 2.0.0", "node-primitives 2.0.0", "node-runtime 2.0.0", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", "srml-balances 2.0.0", @@ -2786,19 +2786,19 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "bitvec 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "byte-slice-cast 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec-derive 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec-derive 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parity-scale-codec-derive" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3023,12 +3023,12 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fixed-hash 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-codec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "impl-serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-codec 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "impl-serde 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "uint 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3425,7 +3425,7 @@ dependencies = [ "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3828,7 +3828,7 @@ version = "2.0.0" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3851,7 +3851,7 @@ dependencies = [ "environmental 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 2.0.0", "substrate-offchain 2.0.0", @@ -3869,9 +3869,9 @@ dependencies = [ "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "primitive-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "primitive-types 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3886,7 +3886,7 @@ name = "sr-sandbox" version = "2.0.0" dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 2.0.0", "substrate-primitives 2.0.0", @@ -3898,7 +3898,7 @@ dependencies = [ name = "sr-staking-primitives" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", ] @@ -3915,7 +3915,7 @@ name = "sr-version" version = "2.0.0" dependencies = [ "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", @@ -3925,7 +3925,7 @@ dependencies = [ name = "srml-assets" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -3940,7 +3940,7 @@ name = "srml-aura" version = "2.0.0" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -3960,7 +3960,7 @@ dependencies = [ name = "srml-authority-discovery" version = "0.1.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -3979,7 +3979,7 @@ name = "srml-authorship" version = "0.1.0" dependencies = [ "impl-trait-for-tuples 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", "sr-std 2.0.0", @@ -3995,7 +3995,7 @@ version = "2.0.0" dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4017,7 +4017,7 @@ dependencies = [ name = "srml-balances" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4034,7 +4034,7 @@ name = "srml-collective" version = "2.0.0" dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4053,7 +4053,7 @@ dependencies = [ "assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.40.2 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4074,7 +4074,7 @@ dependencies = [ name = "srml-democracy" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4091,7 +4091,7 @@ name = "srml-elections" version = "2.0.0" dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4108,7 +4108,7 @@ name = "srml-elections-phragmen" version = "2.0.0" dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4124,7 +4124,7 @@ dependencies = [ name = "srml-example" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4140,7 +4140,7 @@ name = "srml-executive" version = "2.0.0" dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4157,7 +4157,7 @@ name = "srml-finality-tracker" version = "2.0.0" dependencies = [ "impl-trait-for-tuples 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4172,7 +4172,7 @@ dependencies = [ name = "srml-generic-asset" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4186,7 +4186,7 @@ dependencies = [ name = "srml-grandpa" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4204,7 +4204,7 @@ dependencies = [ name = "srml-im-online" version = "0.1.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4222,7 +4222,7 @@ dependencies = [ name = "srml-indices" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "ref_thread_local 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4239,7 +4239,7 @@ dependencies = [ name = "srml-membership" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4253,7 +4253,7 @@ dependencies = [ name = "srml-metadata" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 2.0.0", "substrate-primitives 2.0.0", @@ -4263,7 +4263,7 @@ dependencies = [ name = "srml-offences" version = "1.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4279,7 +4279,7 @@ dependencies = [ name = "srml-scored-pool" version = "1.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4296,7 +4296,7 @@ version = "2.0.0" dependencies = [ "impl-trait-for-tuples 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4315,7 +4315,7 @@ dependencies = [ name = "srml-staking" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4349,7 +4349,7 @@ dependencies = [ name = "srml-sudo" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4366,7 +4366,7 @@ dependencies = [ "bitmask 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "impl-trait-for-tuples 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4415,7 +4415,7 @@ dependencies = [ name = "srml-support-test" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4431,7 +4431,7 @@ version = "2.0.0" dependencies = [ "criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "impl-trait-for-tuples 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4447,7 +4447,7 @@ name = "srml-timestamp" version = "2.0.0" dependencies = [ "impl-trait-for-tuples 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4462,7 +4462,7 @@ dependencies = [ name = "srml-treasury" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4554,7 +4554,7 @@ dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "node-primitives 2.0.0", "node-runtime 2.0.0", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (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)", "sr-primitives 2.0.0", @@ -4579,7 +4579,7 @@ dependencies = [ name = "substrate-application-crypto" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4597,7 +4597,7 @@ dependencies = [ "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4617,7 +4617,7 @@ dependencies = [ name = "substrate-authority-discovery-primitives" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", "substrate-client 2.0.0", @@ -4629,7 +4629,7 @@ version = "2.0.0" dependencies = [ "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", "substrate-consensus-common 2.0.0", @@ -4724,7 +4724,7 @@ dependencies = [ "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-api-macros 2.0.0", "sr-primitives 2.0.0", @@ -4754,7 +4754,7 @@ dependencies = [ "kvdb-rocksdb 0.1.4 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", @@ -4778,7 +4778,7 @@ dependencies = [ "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -4807,7 +4807,7 @@ dependencies = [ name = "substrate-consensus-aura-primitives" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", "substrate-application-crypto 2.0.0", @@ -4828,7 +4828,7 @@ dependencies = [ "num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "pdqselect 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4861,7 +4861,7 @@ dependencies = [ name = "substrate-consensus-babe-primitives" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "schnorrkel 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", @@ -4879,7 +4879,7 @@ dependencies = [ "futures-timer 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", @@ -4895,7 +4895,7 @@ version = "2.0.0" dependencies = [ "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "srml-timestamp 2.0.0", "substrate-client 2.0.0", @@ -4923,7 +4923,7 @@ dependencies = [ "exit-future 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rhododendron 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -4946,7 +4946,7 @@ dependencies = [ "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", @@ -4980,7 +4980,7 @@ dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.40.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -5009,7 +5009,7 @@ dependencies = [ "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5036,7 +5036,7 @@ dependencies = [ name = "substrate-finality-grandpa-primitives" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", @@ -5048,7 +5048,7 @@ dependencies = [ name = "substrate-inherents" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "sr-std 2.0.0", @@ -5100,7 +5100,7 @@ dependencies = [ "linked_hash_set 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "quickcheck 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5141,7 +5141,7 @@ dependencies = [ "hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", @@ -5213,10 +5213,10 @@ dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "primitive-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "primitive-types 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5243,7 +5243,7 @@ dependencies = [ "jsonrpc-core 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", @@ -5274,7 +5274,7 @@ dependencies = [ "jsonrpc-derive 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 13.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5340,7 +5340,7 @@ dependencies = [ "node-primitives 2.0.0", "node-runtime 2.0.0", "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5409,7 +5409,7 @@ version = "2.0.0" dependencies = [ "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 2.0.0", ] @@ -5422,7 +5422,7 @@ dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-panic-handler 2.0.0", @@ -5459,7 +5459,7 @@ version = "2.0.0" dependencies = [ "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", "substrate-client-db 2.0.0", @@ -5477,7 +5477,7 @@ dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "memory-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-io 2.0.0", "sr-primitives 2.0.0", @@ -5509,7 +5509,7 @@ dependencies = [ name = "substrate-test-runtime-client" version = "2.0.0" dependencies = [ - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-primitives 2.0.0", "substrate-test-client 2.0.0", @@ -5525,7 +5525,7 @@ dependencies = [ "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", @@ -5540,7 +5540,7 @@ dependencies = [ "derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-preview 0.3.0-alpha.18 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-client 2.0.0", @@ -5559,7 +5559,7 @@ dependencies = [ "hex-literal 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "memory-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-std 2.0.0", "substrate-primitives 2.0.0", "trie-bench 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5977,7 +5977,7 @@ name = "transaction-factory" version = "0.0.1" dependencies = [ "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "sr-primitives 2.0.0", "substrate-cli 2.0.0", "substrate-client 2.0.0", @@ -5995,7 +5995,7 @@ dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "keccak-hasher 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "memory-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "trie-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "trie-root 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "trie-standardmap 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6712,9 +6712,9 @@ dependencies = [ "checksum hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -"checksum impl-codec 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "78c441b3d2b5e24b407161e76d482b7bbd29b5da357707839ac40d95152f031f" +"checksum impl-codec 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3fa0086251524c50fd53b32e7b05eb6d79e2f97221eaf0c53c0ca9c3096f21d3" "checksum impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5158079de9d4158e0ce1de3ae0bd7be03904efc40b3d7dd8b8c301cbf6b52b56" -"checksum impl-serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d26be4b97d738552ea423f76c4f681012ff06c3fa36fa968656b3679f60b4a1" +"checksum impl-serde 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bbb1ea6188aca47a0eaeeb330d8a82f16cd500f30b897062d23922568727333a" "checksum impl-trait-for-tuples 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0df44cb13008e863c3d80788d5f4cb0f94d09b31bb0190a8ecc05151b2ac8a" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ea155abb3ba6f382a75f1418988c05fe82959ed9ce727de427f9cfd425b0c903" @@ -6817,8 +6817,8 @@ dependencies = [ "checksum parity-bytes 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)" = "" "checksum parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "045b3c7af871285146300da35b1932bb6e4639b66c7c98e85d06a32cbc4e8fa7" "checksum parity-multihash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df3a17dc27848fd99e4f87eb0f8c9baba6ede0a6d555400c850ca45254ef4ce3" -"checksum parity-scale-codec 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "65582b5c02128a4b0fa60fb3e070216e9c84be3e4a8f1b74bc37e15a25e58daf" -"checksum parity-scale-codec-derive 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a81f3cd93ed368a8e41c4e79538e99ca6e8f536096de23e3a0bc3e782093ce28" +"checksum parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "001fbbb956d8593f321c7a784f64d16b2c99b2657823976eea729006ad2c3668" +"checksum parity-scale-codec-derive 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "42af752f59119656fa3cb31e8852ed24e895b968c0bdb41847da7f0cea6d155f" "checksum parity-send-wrapper 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" "checksum parity-util-mem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2005637ccf93dbb60c85081ccaaf3f945f573da48dcc79f27f9646caa3ec1dc" "checksum parity-wasm 0.40.2 (registry+https://github.com/rust-lang/crates.io-index)" = "49d1e33551976be5345d2ecbfe995830719746c7f0902f0880a13d40e215f851" @@ -6844,7 +6844,7 @@ dependencies = [ "checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af" "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" "checksum pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" -"checksum primitive-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e44400d651ca5276415dc8e00541c5c9d03844f1f0a87ad28f0a8fadcb2300bc" +"checksum primitive-types 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "83ef7b3b965c0eadcb6838f34f827e1dfb2939bdd5ebd43f9647e009b12b0371" "checksum proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" "checksum proc-macro-hack 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "982a35d1194084ba319d65c4a68d24ca28f5fdb5b8bc20899e4eef8641ea5178" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" diff --git a/core/primitives/Cargo.toml b/core/primitives/Cargo.toml index f05907e3f205e..b94fa39bd07a2 100644 --- a/core/primitives/Cargo.toml +++ b/core/primitives/Cargo.toml @@ -11,7 +11,7 @@ rustc-hex = { version = "2.0", default-features = false } serde = { version = "1.0", optional = true, features = ["derive"] } twox-hash = { version = "1.2.0", optional = true } byteorder = { version = "1.3.1", default-features = false } -primitive-types = { version = "0.5.0", default-features = false, features = ["codec"] } +primitive-types = { version = "0.5.1", default-features = false, features = ["codec"] } impl-serde = { version = "0.1", optional = true } log = { version = "0.4", optional = true } wasmi = { version = "0.5.0", optional = true } diff --git a/core/sr-primitives/Cargo.toml b/core/sr-primitives/Cargo.toml index db1819c3e6b79..271ed2dccc4c9 100644 --- a/core/sr-primitives/Cargo.toml +++ b/core/sr-primitives/Cargo.toml @@ -20,7 +20,7 @@ impl-trait-for-tuples = "0.1.1" [dev-dependencies] serde_json = "1.0" -primitive-types = "0.5.0" +primitive-types = "0.5.1" rand = "0.7.2" [features] diff --git a/core/sr-primitives/src/generic/unchecked_extrinsic.rs b/core/sr-primitives/src/generic/unchecked_extrinsic.rs index 48614946d6d13..c5ee76e21c011 100644 --- a/core/sr-primitives/src/generic/unchecked_extrinsic.rs +++ b/core/sr-primitives/src/generic/unchecked_extrinsic.rs @@ -21,7 +21,7 @@ use std::fmt; use rstd::prelude::*; use runtime_io::blake2_256; -use codec::{Decode, Encode, Input, Error}; +use codec::{Decode, Encode, EncodeLike, Input, Error}; use crate::{ traits::{self, Member, MaybeDisplay, SignedExtension, Checkable, Extrinsic}, generic::CheckedExtrinsic, transaction_validity::{TransactionValidityError, InvalidTransaction}, @@ -185,6 +185,12 @@ impl Encode for SignedPayload where } } +impl EncodeLike for SignedPayload +where + Call: Encode, + Extra: SignedExtension, +{} + impl Decode for UncheckedExtrinsic where @@ -240,6 +246,15 @@ where } } +impl EncodeLike + for UncheckedExtrinsic +where + Address: Encode, + Signature: Encode, + Call: Encode, + Extra: SignedExtension, +{} + #[cfg(feature = "std")] impl serde::Serialize for UncheckedExtrinsic diff --git a/node/runtime/src/lib.rs b/node/runtime/src/lib.rs index 87bf313ac4fb3..7163d2c736523 100644 --- a/node/runtime/src/lib.rs +++ b/node/runtime/src/lib.rs @@ -85,7 +85,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. spec_version: 168, - impl_version: 168, + impl_version: 169, apis: RUNTIME_API_VERSIONS, }; diff --git a/srml/assets/src/lib.rs b/srml/assets/src/lib.rs index bde5f7d538092..b143085232a3f 100644 --- a/srml/assets/src/lib.rs +++ b/srml/assets/src/lib.rs @@ -159,7 +159,7 @@ decl_module! { let id = Self::next_asset_id(); >::mutate(|id| *id += One::one()); - >::insert((id, origin.clone()), total); + >::insert((id, &origin), total); >::insert(id, total); Self::deposit_event(RawEvent::Issued(id, origin, total)); @@ -186,7 +186,7 @@ decl_module! { /// Destroy any assets of `id` owned by `origin`. fn destroy(origin, #[compact] id: T::AssetId) { let origin = ensure_signed(origin)?; - let balance = >::take((id, origin.clone())); + let balance = >::take((id, &origin)); ensure!(!balance.is_zero(), "origin balance should be non-zero"); >::mutate(id, |total_supply| *total_supply -= balance); diff --git a/srml/aura/src/lib.rs b/srml/aura/src/lib.rs index 65d15088106ea..834d6b0a14dfe 100644 --- a/srml/aura/src/lib.rs +++ b/srml/aura/src/lib.rs @@ -177,7 +177,7 @@ impl Module { fn initialize_authorities(authorities: &[T::AuthorityId]) { if !authorities.is_empty() { assert!(>::get().is_empty(), "Authorities are already initialized!"); - >::put_ref(authorities); + >::put(authorities); } } } diff --git a/srml/authority-discovery/src/lib.rs b/srml/authority-discovery/src/lib.rs index 4f759ba38a21d..c8857630fb022 100644 --- a/srml/authority-discovery/src/lib.rs +++ b/srml/authority-discovery/src/lib.rs @@ -29,13 +29,13 @@ #![cfg_attr(not(feature = "std"), no_std)] use app_crypto::RuntimeAppPublic; -use codec::{Decode, Encode}; +use codec::FullCodec; use rstd::prelude::*; use support::{decl_module, decl_storage}; /// The module's config trait. pub trait Trait: system::Trait + session::Trait { - type AuthorityId: RuntimeAppPublic + Default + Decode + Encode + PartialEq; + type AuthorityId: RuntimeAppPublic + Default + FullCodec + PartialEq; } decl_storage! { @@ -102,7 +102,7 @@ impl Module { fn initialize_keys(keys: &[T::AuthorityId]) { if !keys.is_empty() { assert!(Keys::::get().is_empty(), "Keys are already initialized!"); - Keys::::put_ref(keys); + Keys::::put(keys); } } } diff --git a/srml/babe/src/lib.rs b/srml/babe/src/lib.rs index aa0165f9f8b72..a410eccda83ca 100644 --- a/srml/babe/src/lib.rs +++ b/srml/babe/src/lib.rs @@ -358,7 +358,7 @@ impl Module { } else { // move onto the next segment and update the index. let segment_idx = segment_idx + 1; - ::insert(&segment_idx, vec![*vrf_output].as_ref()); + ::insert(&segment_idx, &vec![*vrf_output]); ::put(&segment_idx); } } @@ -438,7 +438,7 @@ impl Module { fn initialize_authorities(authorities: &[(AuthorityId, BabeAuthorityWeight)]) { if !authorities.is_empty() { assert!(Authorities::get().is_empty(), "Authorities are already initialized!"); - Authorities::put_ref(authorities); + Authorities::put(authorities); } } } diff --git a/srml/collective/src/lib.rs b/srml/collective/src/lib.rs index f4e5ef50f0acf..4a157569c0ffe 100644 --- a/srml/collective/src/lib.rs +++ b/srml/collective/src/lib.rs @@ -281,7 +281,7 @@ impl, I: Instance> ChangeMembers for Module { } ); } - >::put_ref(new); + >::put(new); } } @@ -289,7 +289,7 @@ impl, I: Instance> InitializeMembers for Module fn initialize_members(members: &[T::AccountId]) { if !members.is_empty() { assert!(>::get().is_empty(), "Members are already initialized!"); - >::put_ref(members); + >::put(members); } } } diff --git a/srml/contracts/src/wasm/code_cache.rs b/srml/contracts/src/wasm/code_cache.rs index 80fb3e18f65a6..e6702d29cf5c7 100644 --- a/srml/contracts/src/wasm/code_cache.rs +++ b/srml/contracts/src/wasm/code_cache.rs @@ -98,7 +98,7 @@ pub fn load( let original_code = >::get(code_hash).ok_or_else(|| "pristine code is not found")?; prefab_module = prepare::prepare_contract::(&original_code, schedule)?; - >::insert(code_hash, prefab_module.clone()); + >::insert(&code_hash, &prefab_module); } Ok(prefab_module) } diff --git a/srml/democracy/src/lib.rs b/srml/democracy/src/lib.rs index 2c6187e582f91..b93f6f893aef9 100644 --- a/srml/democracy/src/lib.rs +++ b/srml/democracy/src/lib.rs @@ -24,7 +24,7 @@ use sr_primitives::{ traits::{Zero, Bounded, CheckedMul, CheckedDiv, EnsureOrigin, Hash, Dispatchable}, weights::SimpleDispatchInfo, }; -use codec::{Encode, Decode, Input, Output, Error}; +use codec::{Ref, Encode, Decode, Input, Output, Error}; use support::{ decl_module, decl_storage, decl_event, ensure, Parameter, @@ -377,10 +377,10 @@ decl_module! { let index = Self::public_prop_count(); PublicPropCount::put(index + 1); - >::insert(index, (value, vec![who.clone()])); + >::insert(index, (value, &[&who][..])); - let new_prop = (index, (*proposal).clone(), who); - >::append_or_put([new_prop].into_iter()); + let new_prop = (index, proposal, who); + >::append_or_put(&[Ref::from(&new_prop)][..]); Self::deposit_event(RawEvent::Proposed(index, value)); } @@ -609,7 +609,7 @@ decl_module! { #[weight = SimpleDispatchInfo::FixedNormal(500_000)] pub fn delegate(origin, to: T::AccountId, conviction: Conviction) { let who = ensure_signed(origin)?; - >::insert(who.clone(), (to.clone(), conviction)); + >::insert(&who, (&to, conviction)); // Currency is locked indefinitely as long as it's delegated. T::Currency::extend_lock( DEMOCRACY_ID, @@ -788,10 +788,10 @@ impl Module { /// Actually enact a vote, if legit. fn do_vote(who: T::AccountId, ref_index: ReferendumIndex, vote: Vote) -> Result { ensure!(Self::is_active_referendum(ref_index), "vote given for invalid referendum."); - if !>::exists(&(ref_index, who.clone())) { - >::append_or_insert(ref_index, [who.clone()].into_iter()); + if !>::exists((ref_index, &who)) { + >::append_or_insert(ref_index, &[&who][..]); } - >::insert(&(ref_index, who), vote); + >::insert((ref_index, &who), vote); Ok(()) } @@ -929,7 +929,7 @@ impl Module { } else { >::append_or_insert( now + info.delay, - [Some((info.proposal, index))].into_iter() + &[Some((info.proposal, index))][..] ); } } else { diff --git a/srml/elections-phragmen/src/lib.rs b/srml/elections-phragmen/src/lib.rs index 42bec61fe1ef8..b7cf1a4013d50 100644 --- a/srml/elections-phragmen/src/lib.rs +++ b/srml/elections-phragmen/src/lib.rs @@ -539,7 +539,7 @@ impl Module { // sort and save the members. new_members.sort(); - >::put(new_members.clone()); + >::put(&new_members); // save the runners as-is >::put(runners_up); diff --git a/srml/elections/src/lib.rs b/srml/elections/src/lib.rs index 1c4e012b5b61d..2a683879f8770 100644 --- a/srml/elections/src/lib.rs +++ b/srml/elections/src/lib.rs @@ -816,7 +816,7 @@ impl Module { if set_len + 1 == VOTER_SET_SIZE { NextVoterSet::put(next + 1); } - >::append_or_insert(next, [Some(who.clone())].into_iter()) + >::append_or_insert(next, &[Some(who.clone())][..]) } } @@ -862,7 +862,7 @@ impl Module { // initialize leaderboard. let leaderboard_size = empty_seats + T::CarryCount::get() as usize; - >::put(vec![(Zero::zero(), T::AccountId::default()); leaderboard_size]); + >::put(vec![(BalanceOf::::zero(), T::AccountId::default()); leaderboard_size]); Self::deposit_event(RawEvent::TallyStarted(empty_seats as u32)); } @@ -1027,7 +1027,7 @@ impl Module { .chunks(APPROVAL_SET_SIZE) .enumerate() .for_each(|(index, slice)| >::insert( - (who.clone(), index as SetIndex), slice.to_vec()) + (&who, index as SetIndex), slice) ); } diff --git a/srml/grandpa/src/lib.rs b/srml/grandpa/src/lib.rs index 599dc0886f105..610bd18fb3f8a 100644 --- a/srml/grandpa/src/lib.rs +++ b/srml/grandpa/src/lib.rs @@ -333,7 +333,7 @@ impl Module { fn initialize_authorities(authorities: &[(AuthorityId, AuthorityWeight)]) { if !authorities.is_empty() { assert!(Authorities::get().is_empty(), "Authorities are already initialized!"); - Authorities::put_ref(authorities); + Authorities::put(authorities); } } } diff --git a/srml/im-online/src/lib.rs b/srml/im-online/src/lib.rs index 1a09349701749..84c95fee47fb7 100644 --- a/srml/im-online/src/lib.rs +++ b/srml/im-online/src/lib.rs @@ -418,7 +418,7 @@ impl Module { fn initialize_keys(keys: &[T::AuthorityId]) { if !keys.is_empty() { assert!(Keys::::get().is_empty(), "Keys are already initialized!"); - Keys::::put_ref(keys); + Keys::::put(keys); } } } diff --git a/srml/scored-pool/src/lib.rs b/srml/scored-pool/src/lib.rs index dabe9e812351e..4d92caa5592e5 100644 --- a/srml/scored-pool/src/lib.rs +++ b/srml/scored-pool/src/lib.rs @@ -88,7 +88,7 @@ mod mock; #[cfg(test)] mod tests; -use codec::{Encode, Decode}; +use codec::FullCodec; use rstd::prelude::*; use support::{ StorageValue, StorageMap, decl_module, decl_storage, decl_event, ensure, @@ -117,7 +117,7 @@ pub trait Trait: system::Trait { type Currency: Currency + ReservableCurrency; /// The score attributed to a member or candidate. - type Score: SimpleArithmetic + Clone + Copy + Default + Encode + Decode + MaybeSerializeDebug; + type Score: SimpleArithmetic + Clone + Copy + Default + FullCodec + MaybeSerializeDebug; /// The overarching event type. type Event: From> + Into<::Event>; diff --git a/srml/session/src/lib.rs b/srml/session/src/lib.rs index 992d24d6b6df7..208be4664aa6e 100644 --- a/srml/session/src/lib.rs +++ b/srml/session/src/lib.rs @@ -640,15 +640,15 @@ impl Module { } fn key_owner(id: KeyTypeId, key_data: &[u8]) -> Option { - >::get(DEDUP_KEY_PREFIX, &(id, key_data.to_vec())) + >::get(DEDUP_KEY_PREFIX, (id, key_data)) } fn put_key_owner(id: KeyTypeId, key_data: &[u8], v: &T::ValidatorId) { - >::insert(DEDUP_KEY_PREFIX, &(id, key_data.to_vec()), v) + >::insert(DEDUP_KEY_PREFIX, (id, key_data), v) } fn clear_key_owner(id: KeyTypeId, key_data: &[u8]) { - >::remove(DEDUP_KEY_PREFIX, &(id, key_data.to_vec())); + >::remove(DEDUP_KEY_PREFIX, (id, key_data)); } } diff --git a/srml/staking/src/lib.rs b/srml/staking/src/lib.rs index e82188a46318b..0a2f37ccc4425 100644 --- a/srml/staking/src/lib.rs +++ b/srml/staking/src/lib.rs @@ -722,7 +722,7 @@ decl_module! { // You're auto-bonded forever, here. We might improve this by only bonding when // you actually validate/nominate and remove once you unbond __everything__. - >::insert(&stash, controller.clone()); + >::insert(&stash, &controller); >::insert(&stash, payee); let stash_balance = T::Currency::free_balance(&stash); @@ -1339,7 +1339,7 @@ impl Module { if exposure.total < slot_stake { slot_stake = exposure.total; } - >::insert(c.clone(), exposure.clone()); + >::insert(&c, exposure.clone()); } // Update slot stake. diff --git a/srml/support/Cargo.toml b/srml/support/Cargo.toml index 731c6b1c45fa2..2acf9f5fe3ede 100644 --- a/srml/support/Cargo.toml +++ b/srml/support/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] serde = { version = "1.0", optional = true, features = ["derive"] } -codec = { package = "parity-scale-codec", version = "1.0.5", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "1.0.6", default-features = false, features = ["derive"] } srml-metadata = { path = "../metadata", 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 } diff --git a/srml/support/procedural/src/storage/transformation.rs b/srml/support/procedural/src/storage/transformation.rs index 83f62d97fcedb..76fff30bd35f8 100644 --- a/srml/support/procedural/src/storage/transformation.rs +++ b/srml/support/procedural/src/storage/transformation.rs @@ -338,7 +338,7 @@ fn decl_store_extra_genesis( < #name<#struct_trait #instance> as #scrate::storage::StorageValue<#typ> - >::put(&v); + >::put::<#typ>(v); }} }, DeclStorageTypeInfosKind::Map { key_type, is_linked, .. } => { @@ -363,7 +363,7 @@ fn decl_store_extra_genesis( < #name<#struct_trait #instance> as #scrate::storage::#map<#key_type, #typ> - >::insert(&k, &v); + >::insert::<#key_type, #typ>(k, v); }); }} }, @@ -384,7 +384,7 @@ fn decl_store_extra_genesis( < #name<#struct_trait #instance> as #scrate::storage::StorageDoubleMap<#key1_type, #key2_type, #typ> - >::insert(&k1, &k2, &v); + >::insert::<#key1_type, #key2_type, #typ>(k1, k2, v); }); }} }, @@ -927,11 +927,11 @@ fn impl_store_fns( quote!{ #( #[ #attrs ] )* - pub fn #get_fn>(key: K) -> #value_type { + pub fn #get_fn>(key: K) -> #value_type { < #name<#struct_trait #instance> as #scrate::storage::#map<#key_type, #typ> - >::get(key.borrow()) + >::get(key) } } } @@ -946,12 +946,10 @@ fn impl_store_fns( }; quote!{ - pub fn #get_fn(k1: &KArg1, k2: &KArg2) -> #value_type + pub fn #get_fn(k1: KArg1, k2: KArg2) -> #value_type where - #key1_type: #scrate::rstd::borrow::Borrow, - #key2_type: #scrate::rstd::borrow::Borrow, - KArg1: ?Sized + #scrate::codec::Encode, - KArg2: ?Sized + #scrate::codec::Encode, + KArg1: #scrate::codec::EncodeLike<#key1_type>, + KArg2: #scrate::codec::EncodeLike<#key2_type>, { < #name<#struct_trait #instance> as diff --git a/srml/support/src/dispatch.rs b/srml/support/src/dispatch.rs index b7b142ea195af..67cd3e44bf92f 100644 --- a/srml/support/src/dispatch.rs +++ b/srml/support/src/dispatch.rs @@ -20,7 +20,7 @@ pub use crate::rstd::{result, prelude::{Vec, Clone, Eq, PartialEq}, marker}; #[cfg(feature = "std")] pub use std::fmt; -pub use crate::codec::{Codec, Decode, Encode, Input, Output, HasCompact, EncodeAsRef}; +pub use crate::codec::{Codec, EncodeLike, Decode, Encode, Input, Output, HasCompact, EncodeAsRef}; pub use srml_metadata::{ FunctionMetadata, DecodeDifferent, DecodeDifferentArray, FunctionArgumentMetadata, ModuleConstantMetadata, DefaultByte, DefaultByteGetter, @@ -49,16 +49,16 @@ pub trait Callable { pub type CallableCallFor = >::Call; #[cfg(feature = "std")] -pub trait Parameter: Codec + Clone + Eq + fmt::Debug {} +pub trait Parameter: Codec + EncodeLike + Clone + Eq + fmt::Debug {} #[cfg(feature = "std")] -impl Parameter for T where T: Codec + Clone + Eq + fmt::Debug {} +impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + fmt::Debug {} #[cfg(not(feature = "std"))] -pub trait Parameter: Codec + Clone + Eq {} +pub trait Parameter: Codec + EncodeLike + Clone + Eq {} #[cfg(not(feature = "std"))] -impl Parameter for T where T: Codec + Clone + Eq {} +impl Parameter for T where T: Codec + EncodeLike + Clone + Eq {} /// Declares a `Module` struct and a `Call` enum, which implements the dispatch logic. /// diff --git a/srml/support/src/lib.rs b/srml/support/src/lib.rs index 711f4cbcfd804..b88d86761c314 100644 --- a/srml/support/src/lib.rs +++ b/srml/support/src/lib.rs @@ -235,7 +235,7 @@ pub use serde::{Serialize, Deserialize}; #[cfg(test)] mod tests { use super::*; - use codec::Codec; + use codec::{Codec, EncodeLike}; use runtime_io::with_externalities; use primitives::Blake2Hasher; pub use srml_metadata::{ @@ -245,7 +245,7 @@ mod tests { pub use rstd::marker::PhantomData; pub trait Trait { - type BlockNumber: Codec + Default; + type BlockNumber: Codec + EncodeLike + Default; type Origin; } diff --git a/srml/support/src/storage/child.rs b/srml/support/src/storage/child.rs index 6000dd2f17508..1d6ee7a6f1a61 100644 --- a/srml/support/src/storage/child.rs +++ b/srml/support/src/storage/child.rs @@ -21,7 +21,8 @@ //! avoid collision from a resistant hash function (which unique implies)). // NOTE: could replace unhashed by having only one kind of storage (root being null storage key (storage_key can become Option<&[u8]>). -use super::{Codec, Encode, Decode, Vec}; +use crate::rstd::prelude::*; +use codec::{Codec, Encode, Decode}; /// Return the value of the item in storage under `key`, or `None` if there is no explicit entry. pub fn get(storage_key: &[u8], key: &[u8]) -> Option { diff --git a/srml/support/src/storage/generator/double_map.rs b/srml/support/src/storage/generator/double_map.rs index 3282c2074fde0..cac8dbd034e85 100644 --- a/srml/support/src/storage/generator/double_map.rs +++ b/srml/support/src/storage/generator/double_map.rs @@ -16,7 +16,7 @@ use rstd::prelude::*; use rstd::borrow::Borrow; -use codec::{Codec, Encode, EncodeAppend}; +use codec::{Ref, FullCodec, FullEncode, Encode, EncodeLike, EncodeAppend}; use crate::{storage::{self, unhashed}, hash::StorageHasher}; /// Generator for `StorageDoubleMap` used by `decl_storage`. @@ -39,7 +39,7 @@ use crate::{storage::{self, unhashed}, hash::StorageHasher}; /// If the key2s are not trusted (e.g. can be set by a user), a cryptographic `hasher` such as /// `blake2_256` must be used for Hasher2. Otherwise, other items in storage with the same first /// key can be compromised. -pub trait StorageDoubleMap { +pub trait StorageDoubleMap { /// The type that get/take returns. type Query; @@ -59,10 +59,9 @@ pub trait StorageDoubleMap { fn from_query_to_optional_value(v: Self::Query) -> Option; /// Generate the first part of the key used in top storage. - fn storage_double_map_final_key1(k1: &KArg1) -> ::Output + fn storage_double_map_final_key1(k1: KArg1) -> ::Output where - KArg1: ?Sized + Encode, - K1: Borrow, + KArg1: EncodeLike, { let mut final_key1 = Self::key1_prefix().to_vec(); k1.encode_to(&mut final_key1); @@ -70,12 +69,10 @@ pub trait StorageDoubleMap { } /// Generate the full key used in top storage. - fn storage_double_map_final_key(k1: &KArg1, k2: &KArg2) -> Vec + fn storage_double_map_final_key(k1: KArg1, k2: KArg2) -> Vec where - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, - K1: Borrow, - K2: Borrow, + KArg1: EncodeLike, + KArg2: EncodeLike, { let mut final_key = Self::storage_double_map_final_key1(k1).as_ref().to_vec(); final_key.extend_from_slice(k2.using_encoded(Self::Hasher2::hash).as_ref()); @@ -85,39 +82,33 @@ pub trait StorageDoubleMap { impl storage::StorageDoubleMap for G where - K1: Encode, - K2: Encode, - V: Codec, + K1: FullEncode, + K2: FullEncode, + V: FullCodec, G: StorageDoubleMap, { type Query = G::Query; - fn exists(k1: &KArg1, k2: &KArg2) -> bool + fn exists(k1: KArg1, k2: KArg2) -> bool where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, + KArg1: EncodeLike, + KArg2: EncodeLike, { unhashed::exists(&Self::storage_double_map_final_key(k1, k2)) } - fn get(k1: &KArg1, k2: &KArg2) -> Self::Query + fn get(k1: KArg1, k2: KArg2) -> Self::Query where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, + KArg1: EncodeLike, + KArg2: EncodeLike, { G::from_optional_value_to_query(unhashed::get(&Self::storage_double_map_final_key(k1, k2))) } - fn take(k1: &KArg1, k2: &KArg2) -> Self::Query + fn take(k1: KArg1, k2: KArg2) -> Self::Query where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, + KArg1: EncodeLike, + KArg2: EncodeLike, { let final_key = Self::storage_double_map_final_key(k1, k2); @@ -125,62 +116,57 @@ where G::from_optional_value_to_query(value) } - fn insert(k1: &KArg1, k2: &KArg2, val: &VArg) + fn insert(k1: KArg1, k2: KArg2, val: VArg) where - K1: Borrow, - K2: Borrow, - V: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, - VArg: ?Sized + Encode, + KArg1: EncodeLike, + KArg2: EncodeLike, + VArg: EncodeLike, { unhashed::put(&Self::storage_double_map_final_key(k1, k2), &val.borrow()) } - fn remove(k1: &KArg1, k2: &KArg2) + fn remove(k1: KArg1, k2: KArg2) where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, + KArg1: EncodeLike, + KArg2: EncodeLike, { unhashed::kill(&Self::storage_double_map_final_key(k1, k2)) } - fn remove_prefix(k1: &KArg1) where KArg1: ?Sized + Encode, K1: Borrow { + fn remove_prefix(k1: KArg1) where KArg1: EncodeLike { unhashed::kill_prefix(Self::storage_double_map_final_key1(k1).as_ref()) } - fn mutate(k1: &KArg1, k2: &KArg2, f: F) -> R + fn mutate(k1: KArg1, k2: KArg2, f: F) -> R where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, + KArg1: EncodeLike, + KArg2: EncodeLike, F: FnOnce(&mut Self::Query) -> R, { - let mut val = G::get(k1, k2); + let final_key = Self::storage_double_map_final_key(k1, k2); + let mut val = G::from_optional_value_to_query(unhashed::get(final_key.as_ref())); let ret = f(&mut val); match G::from_query_to_optional_value(val) { - Some(ref val) => G::insert(k1, k2, val), - None => G::remove(k1, k2), + Some(ref val) => unhashed::put(final_key.as_ref(), val), + None => unhashed::kill(final_key.as_ref()), } ret } - fn append( - k1: &KArg1, - k2: &KArg2, - items: &[I], + fn append( + k1: KArg1, + k2: KArg2, + items: Items, ) -> Result<(), &'static str> where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, - I: codec::Encode, - V: EncodeAppend, + KArg1: EncodeLike, + KArg2: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator, + Items::IntoIter: ExactSizeIterator { let final_key = Self::storage_double_map_final_key(k1, k2); @@ -192,7 +178,7 @@ where } }); - let new_val = V::append( + let new_val = V::append_or_new( encoded_value, items, ).map_err(|_| "Could not append given item")?; @@ -200,4 +186,22 @@ where Ok(()) } + + fn append_or_insert( + k1: KArg1, + k2: KArg2, + items: Items, + ) + where + KArg1: EncodeLike, + KArg2: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator + Clone + EncodeLike, + Items::IntoIter: ExactSizeIterator + { + Self::append(Ref::from(&k1), Ref::from(&k2), items.clone()) + .unwrap_or_else(|_| Self::insert(k1, k2, items)); + } } diff --git a/srml/support/src/storage/generator/linked_map.rs b/srml/support/src/storage/generator/linked_map.rs index d2476de5879c8..6643a37f4f50c 100644 --- a/srml/support/src/storage/generator/linked_map.rs +++ b/srml/support/src/storage/generator/linked_map.rs @@ -14,12 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -use codec::{Codec, Encode, Decode}; +use codec::{FullCodec, Encode, Decode, EncodeLike, Ref}; use crate::{storage::{self, unhashed}, hash::StorageHasher, traits::Len}; -use rstd::{ - borrow::Borrow, - marker::PhantomData, -}; +use rstd::marker::PhantomData; /// Generator for `StorageLinkedMap` used by `decl_storage`. /// @@ -43,7 +40,7 @@ use rstd::{ /// /// If the keys are not trusted (e.g. can be set by a user), a cryptographic `hasher` such as /// `blake2_256` must be used. Otherwise, other values in storage can be compromised. -pub trait StorageLinkedMap { +pub trait StorageLinkedMap { /// The type that get/take returns. type Query; @@ -65,10 +62,10 @@ pub trait StorageLinkedMap { /// Generate the full key used in top storage. fn storage_linked_map_final_key(key: KeyArg) -> ::Output where - KeyArg: Borrow, + KeyArg: EncodeLike, { let mut final_key = Self::prefix().to_vec(); - key.borrow().encode_to(&mut final_key); + key.encode_to(&mut final_key); Self::Hasher::hash(&final_key) } @@ -96,13 +93,29 @@ impl Default for Linkage { } } +// Encode like a linkage. +#[derive(Encode)] +struct EncodeLikeLinkage, NKey: EncodeLike, Key: Encode> { + // Previous element key in storage (None for the first element) + previous: Option, + // Next element key in storage (None for the last element) + next: Option, + // The key of the linkage this type encode to + phantom: core::marker::PhantomData, +} + /// A key-value pair iterator for enumerable map. -pub struct Enumerator> { +pub struct Enumerator> { next: Option, _phantom: PhantomData<(G, V)>, } -impl> Iterator for Enumerator { +impl Iterator for Enumerator +where + K: FullCodec, + V: FullCodec, + G: StorageLinkedMap, +{ type Item = (K, V); fn next(&mut self) -> Option { @@ -123,7 +136,12 @@ impl> Iterator for Enumerator>(linkage: Linkage) { +fn remove_linkage(linkage: Linkage) +where + K: FullCodec, + V: FullCodec, + G: StorageLinkedMap, +{ let next_key = linkage.next.as_ref() .map(G::storage_linked_map_final_key) .map(|x| x.as_ref().to_vec()); @@ -140,7 +158,7 @@ fn remove_linkage>(linkage: Linkag unhashed::put(prev_key.as_ref(), &res); } else { // we were first so let's update the head - write_head::<_, _, G>(linkage.next.as_ref()); + write_head::<_, _, _, G>(linkage.next.as_ref()); } if let Some(next_key) = next_key { // Update previous of next element @@ -155,9 +173,9 @@ fn remove_linkage>(linkage: Linkag /// Read the contained data and it's linkage. fn read_with_linkage(key: &[u8]) -> Option<(V, Linkage)> where - K: Codec, - V: Codec, - G: StorageLinkedMap + K: FullCodec, + V: FullCodec, + G: StorageLinkedMap, { unhashed::get(key) } @@ -165,11 +183,12 @@ where /// Generate linkage for newly inserted element. /// /// Takes care of updating head and previous head's pointer. -fn new_head_linkage(key: &K) -> Linkage +fn new_head_linkage(key: KeyArg) -> Linkage where - K: Codec, - V: Codec, - G: StorageLinkedMap + KeyArg: EncodeLike, + K: FullCodec, + V: FullCodec, + G: StorageLinkedMap, { if let Some(head) = read_head::<_, _, G>() { // update previous head predecessor @@ -179,20 +198,22 @@ where .expect("head is set when first element is inserted and unset when last element is removed; if head is Some then it points to existing key; qed"); - unhashed::put(head_key.as_ref(), &(data, Linkage { + let new_linkage = EncodeLikeLinkage::<_, _, K> { + previous: Some(Ref::from(&key)), next: linkage.next.as_ref(), - previous: Some(key), - })); + phantom: Default::default(), + }; + unhashed::put(head_key.as_ref(), &(data, new_linkage)); } // update to current head - write_head::<_, _, G>(Some(key)); + write_head::<_, _, _, G>(Some(key)); // return linkage with pointer to previous head let mut linkage = Linkage::default(); linkage.next = Some(head); linkage } else { // we are first - update the head and produce empty linkage - write_head::<_, _, G>(Some(key)); + write_head::<_, _, _, G>(Some(key)); Linkage::default() } } @@ -200,9 +221,9 @@ where /// Read current head pointer. fn read_head() -> Option where - K: Codec, - V: Codec, - G: StorageLinkedMap + K: FullCodec, + V: FullCodec, + G: StorageLinkedMap, { unhashed::get(G::storage_linked_map_final_head_key().as_ref()) } @@ -210,35 +231,41 @@ where /// Overwrite current head pointer. /// /// If `None` is given head is removed from storage. -fn write_head(head: Option<&K>) +fn write_head(head: Option) where - K: Codec, - V: Codec, - G: StorageLinkedMap + KeyArg: EncodeLike, + K: FullCodec, + V: FullCodec, + G: StorageLinkedMap, { - match head { + match head.as_ref() { Some(head) => unhashed::put(G::storage_linked_map_final_head_key().as_ref(), head), None => unhashed::kill(G::storage_linked_map_final_head_key().as_ref()), } } -impl> storage::StorageLinkedMap for G { +impl storage::StorageLinkedMap for G +where + K: FullCodec, + V: FullCodec, + G: StorageLinkedMap, +{ type Query = G::Query; type Enumerator = Enumerator; - fn exists>(key: KeyArg) -> bool { + fn exists>(key: KeyArg) -> bool { unhashed::exists(Self::storage_linked_map_final_key(key).as_ref()) } - fn get>(key: KeyArg) -> Self::Query { + fn get>(key: KeyArg) -> Self::Query { let val = unhashed::get(Self::storage_linked_map_final_key(key).as_ref()); G::from_optional_value_to_query(val) } - fn swap, KeyArg2: Borrow>(key1: KeyArg1, key2: KeyArg2) { - let final_key1 = Self::storage_linked_map_final_key(key1.borrow()); - let final_key2 = Self::storage_linked_map_final_key(key2.borrow()); + fn swap, KeyArg2: EncodeLike>(key1: KeyArg1, key2: KeyArg2) { + let final_key1 = Self::storage_linked_map_final_key(Ref::from(&key1)); + let final_key2 = Self::storage_linked_map_final_key(Ref::from(&key2)); let full_value_1 = read_with_linkage::<_, _, G>(final_key1.as_ref()); let full_value_2 = read_with_linkage::<_, _, G>(final_key2.as_ref()); @@ -251,13 +278,13 @@ impl> storage::StorageLinkedMap { Self::remove(key1); - let linkage = new_head_linkage::<_, _, G>(key2.borrow()); + let linkage = new_head_linkage::<_, _, _, G>(key2); unhashed::put(final_key2.as_ref(), &(value, linkage)); } // Remove key and insert the new one. (None, Some((value, _linkage))) => { Self::remove(key2); - let linkage = new_head_linkage::<_, _, G>(key1.borrow()); + let linkage = new_head_linkage::<_, _, _, G>(key1); unhashed::put(final_key1.as_ref(), &(value, linkage)); } // No-op. @@ -265,37 +292,23 @@ impl> storage::StorageLinkedMap, ValArg: Borrow>(key: KeyArg, val: ValArg) { - let final_key = Self::storage_linked_map_final_key(key.borrow()); - let linkage = match read_with_linkage::<_, _, G>(final_key.as_ref()) { - // overwrite but reuse existing linkage - Some((_data, linkage)) => linkage, - // create new linkage - None => new_head_linkage::<_, _, G>(key.borrow()), - }; - unhashed::put(final_key.as_ref(), &(val.borrow(), linkage)) - } - - fn insert_ref, ValArg: ?Sized + Encode>(key: KeyArg, val: &ValArg) - where - V: AsRef - { - let final_key = Self::storage_linked_map_final_key(key.borrow()); + fn insert, ValArg: EncodeLike>(key: KeyArg, val: ValArg) { + let final_key = Self::storage_linked_map_final_key(Ref::from(&key)); let linkage = match read_with_linkage::<_, _, G>(final_key.as_ref()) { // overwrite but reuse existing linkage Some((_data, linkage)) => linkage, // create new linkage - None => new_head_linkage::<_, _, G>(key.borrow()), + None => new_head_linkage::<_, _, _, G>(key), }; - unhashed::put(final_key.as_ref(), &(&val, &linkage)) + unhashed::put(final_key.as_ref(), &(val, linkage)) } - fn remove>(key: KeyArg) { + fn remove>(key: KeyArg) { G::take(key); } - fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R { - let final_key = Self::storage_linked_map_final_key(key.borrow()); + fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R { + let final_key = Self::storage_linked_map_final_key(Ref::from(&key)); let (mut val, _linkage) = read_with_linkage::<_, _, G>(final_key.as_ref()) .map(|(data, linkage)| (G::from_optional_value_to_query(Some(data)), Some(linkage))) @@ -303,13 +316,13 @@ impl> storage::StorageLinkedMap G::insert(key.borrow(), val), - None => G::remove(key.borrow()), + Some(ref val) => G::insert(key, val), + None => G::remove(key), } ret } - fn take>(key: KeyArg) -> Self::Query { + fn take>(key: KeyArg) -> Self::Query { let final_key = Self::storage_linked_map_final_key(key); let full_value: Option<(V, Linkage)> = unhashed::take(final_key.as_ref()); @@ -333,7 +346,7 @@ impl> storage::StorageLinkedMap() } - fn decode_len>(key: KeyArg) -> Result + fn decode_len>(key: KeyArg) -> Result where V: codec::DecodeLength + Len { let key = Self::storage_linked_map_final_key(key); diff --git a/srml/support/src/storage/generator/map.rs b/srml/support/src/storage/generator/map.rs index cc060cf1ecc72..3c3edac28a42a 100644 --- a/srml/support/src/storage/generator/map.rs +++ b/srml/support/src/storage/generator/map.rs @@ -17,7 +17,7 @@ #[cfg(not(feature = "std"))] use rstd::prelude::*; use rstd::borrow::Borrow; -use codec::{Codec, Encode}; +use codec::{FullCodec, FullEncode, Encode, EncodeLike, Ref, EncodeAppend}; use crate::{storage::{self, unhashed}, hash::StorageHasher, traits::Len}; /// Generator for `StorageMap` used by `decl_storage`. @@ -31,7 +31,7 @@ use crate::{storage::{self, unhashed}, hash::StorageHasher, traits::Len}; /// /// If the keys are not trusted (e.g. can be set by a user), a cryptographic `hasher` such as /// `blake2_256` must be used. Otherwise, other values in storage can be compromised. -pub trait StorageMap { +pub trait StorageMap { /// The type that get/take returns. type Query; @@ -50,7 +50,7 @@ pub trait StorageMap { /// Generate the full key used in top storage. fn storage_map_final_key(key: KeyArg) -> ::Output where - KeyArg: Borrow, + KeyArg: EncodeLike, { let mut final_key = Self::prefix().to_vec(); key.borrow().encode_to(&mut final_key); @@ -58,14 +58,14 @@ pub trait StorageMap { } } -impl> storage::StorageMap for G { +impl> storage::StorageMap for G { type Query = G::Query; - fn hashed_key_for>(key: KeyArg) -> Vec { + fn hashed_key_for>(key: KeyArg) -> Vec { Self::storage_map_final_key(key).as_ref().to_vec() } - fn swap, KeyArg2: Borrow>(key1: KeyArg1, key2: KeyArg2) { + fn swap, KeyArg2: EncodeLike>(key1: KeyArg1, key2: KeyArg2) { let k1 = Self::storage_map_final_key(key1); let k2 = Self::storage_map_final_key(key2); @@ -82,52 +82,48 @@ impl> storage::StorageMap for G { } } - fn exists>(key: KeyArg) -> bool { + fn exists>(key: KeyArg) -> bool { unhashed::exists(Self::storage_map_final_key(key).as_ref()) } - fn get>(key: KeyArg) -> Self::Query { + fn get>(key: KeyArg) -> Self::Query { G::from_optional_value_to_query(unhashed::get(Self::storage_map_final_key(key).as_ref())) } - fn insert, ValArg: Borrow>(key: KeyArg, val: ValArg) { + fn insert, ValArg: EncodeLike>(key: KeyArg, val: ValArg) { unhashed::put(Self::storage_map_final_key(key).as_ref(), &val.borrow()) } - fn insert_ref, ValArg: ?Sized + Encode>(key: KeyArg, val: &ValArg) - where V: AsRef - { - val.using_encoded(|b| unhashed::put_raw(Self::storage_map_final_key(key).as_ref(), b)) - } - - fn remove>(key: KeyArg) { + fn remove>(key: KeyArg) { unhashed::kill(Self::storage_map_final_key(key).as_ref()) } - fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R { - let mut val = G::get(key.borrow()); + fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R { + let final_key = Self::storage_map_final_key(key); + let mut val = G::from_optional_value_to_query(unhashed::get(final_key.as_ref())); let ret = f(&mut val); match G::from_query_to_optional_value(val) { - Some(ref val) => G::insert(key, val), - None => G::remove(key), + Some(ref val) => unhashed::put(final_key.as_ref(), &val.borrow()), + None => unhashed::kill(final_key.as_ref()), } ret } - fn take>(key: KeyArg) -> Self::Query { + fn take>(key: KeyArg) -> Self::Query { let key = Self::storage_map_final_key(key); let value = unhashed::take(key.as_ref()); G::from_optional_value_to_query(value) } - fn append<'a, I, R, KeyArg>(key: KeyArg, items: R) -> Result<(), &'static str> + fn append(key: KeyArg, items: Items) -> Result<(), &'static str> where - KeyArg: Borrow, - I: 'a + codec::Encode, - V: codec::EncodeAppend, - R: IntoIterator, - R::IntoIter: ExactSizeIterator, + KeyArg: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator, + Items::IntoIter: ExactSizeIterator, { let key = Self::storage_map_final_key(key); let encoded_value = unhashed::get_raw(key.as_ref()) @@ -138,7 +134,7 @@ impl> storage::StorageMap for G { } }); - let new_val = V::append( + let new_val = V::append_or_new( encoded_value, items, ).map_err(|_| "Could not append given item")?; @@ -146,19 +142,20 @@ impl> storage::StorageMap for G { Ok(()) } - fn append_or_insert<'a, I, R, KeyArg>(key: KeyArg, items: R) + fn append_or_insert(key: KeyArg, items: Items) where - KeyArg: Borrow, - I: 'a + codec::Encode + Clone, - V: codec::EncodeAppend + crate::rstd::iter::FromIterator, - R: IntoIterator + Clone, - R::IntoIter: ExactSizeIterator, + KeyArg: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator + Clone + EncodeLike, + Items::IntoIter: ExactSizeIterator, { - Self::append(key.borrow(), items.clone()) - .unwrap_or_else(|_| Self::insert(key, &items.into_iter().cloned().collect())); + Self::append(Ref::from(&key), items.clone()) + .unwrap_or_else(|_| Self::insert(key, items)); } - fn decode_len>(key: KeyArg) -> Result + fn decode_len>(key: KeyArg) -> Result where V: codec::DecodeLength + Len { let key = Self::storage_map_final_key(key); diff --git a/srml/support/src/storage/generator/value.rs b/srml/support/src/storage/generator/value.rs index c595d85290723..8423503dde20e 100644 --- a/srml/support/src/storage/generator/value.rs +++ b/srml/support/src/storage/generator/value.rs @@ -16,8 +16,7 @@ #[cfg(not(feature = "std"))] use rstd::prelude::*; -use rstd::{borrow::Borrow, iter::FromIterator}; -use codec::{Codec, Encode}; +use codec::{FullCodec, Encode, EncodeAppend, EncodeLike}; use crate::{storage::{self, unhashed}, hash::{Twox128, StorageHasher}, traits::Len}; /// Generator for `StorageValue` used by `decl_storage`. @@ -26,7 +25,7 @@ use crate::{storage::{self, unhashed}, hash::{Twox128, StorageHasher}, traits::L /// ```nocompile /// Twox128(unhashed_key) /// ``` -pub trait StorageValue { +pub trait StorageValue { /// The type that get/take returns. type Query; @@ -45,7 +44,7 @@ pub trait StorageValue { } } -impl> storage::StorageValue for G { +impl> storage::StorageValue for G { type Query = G::Query; fn hashed_key() -> [u8; 16] { @@ -61,12 +60,8 @@ impl> storage::StorageValue for G { G::from_optional_value_to_query(value) } - fn put>(val: Arg) { - unhashed::put(&Self::storage_value_final_key(), val.borrow()) - } - - fn put_ref(val: &Arg) where T: AsRef { - val.using_encoded(|b| unhashed::put_raw(&Self::storage_value_final_key(), b)) + fn put>(val: Arg) { + unhashed::put(&Self::storage_value_final_key(), &val) } fn kill() { @@ -96,12 +91,13 @@ impl> storage::StorageValue for G { /// Append the given items to the value in the storage. /// /// `T` is required to implement `codec::EncodeAppend`. - fn append<'a, I, R>(items: R) -> Result<(), &'static str> + fn append(items: Items) -> Result<(), &'static str> where - I: 'a + codec::Encode, - T: codec::EncodeAppend, - R: IntoIterator, - R::IntoIter: ExactSizeIterator, + Item: Encode, + EncodeLikeItem: EncodeLike, + T: EncodeAppend, + Items: IntoIterator, + Items::IntoIter: ExactSizeIterator, { let key = Self::storage_value_final_key(); let encoded_value = unhashed::get_raw(&key) @@ -112,7 +108,7 @@ impl> storage::StorageValue for G { } }); - let new_val = T::append( + let new_val = T::append_or_new( encoded_value, items, ).map_err(|_| "Could not append given item")?; @@ -124,15 +120,14 @@ impl> storage::StorageValue for G { /// old (presumably corrupt) value is replaced with the given `items`. /// /// `T` is required to implement `codec::EncodeAppend`. - fn append_or_put<'a, I, R>(items: R) - where - I: 'a + codec::Encode + Clone, - T: codec::EncodeAppend + FromIterator, - R: IntoIterator + Clone, - R::IntoIter: ExactSizeIterator, + fn append_or_put(items: Items) where + Item: Encode, + EncodeLikeItem: EncodeLike, + T: EncodeAppend, + Items: IntoIterator + Clone + EncodeLike, + Items::IntoIter: ExactSizeIterator { - Self::append(items.clone()) - .unwrap_or_else(|_| Self::put(&items.into_iter().cloned().collect())); + Self::append(items.clone()).unwrap_or_else(|_| Self::put(items)); } /// Read the length of the value in a fast way, without decoding the entire value. diff --git a/srml/support/src/storage/mod.rs b/srml/support/src/storage/mod.rs index 3e3c889cdeaa5..648009b470e42 100644 --- a/srml/support/src/storage/mod.rs +++ b/srml/support/src/storage/mod.rs @@ -16,9 +16,8 @@ //! Stuff to do with the runtime's storage. -use crate::rstd::prelude::*; -use crate::rstd::{borrow::Borrow, iter::FromIterator}; -use codec::{Codec, Encode, Decode, EncodeAppend}; +use rstd::prelude::*; +use codec::{FullCodec, FullEncode, Encode, EncodeAppend, EncodeLike}; use crate::traits::Len; #[macro_use] @@ -29,7 +28,7 @@ pub mod child; pub mod generator; /// A trait for working with macro-generated storage values under the substrate storage API. -pub trait StorageValue { +pub trait StorageValue { /// The type that get/take return. type Query; @@ -43,11 +42,7 @@ pub trait StorageValue { fn get() -> Self::Query; /// Store a value under this key into the provided storage instance. - fn put>(val: Arg); - - /// Store a value under this key into the provided storage instance; this can take any reference - /// type that derefs to `T` (and has `Encode` implemented). - fn put_ref(val: &Arg) where T: AsRef; + fn put>(val: Arg); /// Mutate the value fn mutate R>(f: F) -> R; @@ -61,11 +56,13 @@ pub trait StorageValue { /// Append the given item to the value in the storage. /// /// `T` is required to implement `codec::EncodeAppend`. - fn append<'a, I, R>(items: R) -> Result<(), &'static str> where - I: 'a + Encode, - T: EncodeAppend, - R: IntoIterator, - R::IntoIter: ExactSizeIterator; + fn append(items: Items) -> Result<(), &'static str> + where + Item: Encode, + EncodeLikeItem: EncodeLike, + T: EncodeAppend, + Items: IntoIterator, + Items::IntoIter: ExactSizeIterator; /// Append the given items to the value in the storage. /// @@ -78,11 +75,13 @@ pub trait StorageValue { /// /// use with care; if your use-case is not _exactly_ as what this function is doing, /// you should use append and sensibly handle failure within the runtime code if it happens. - fn append_or_put<'a, I, R>(items: R) where - I: 'a + Encode + Clone, - T: EncodeAppend + FromIterator, - R: IntoIterator + Clone, - R::IntoIter: ExactSizeIterator; + fn append_or_put(items: Items) where + Item: Encode, + EncodeLikeItem: EncodeLike, + T: EncodeAppend, + Items: IntoIterator + Clone + EncodeLike, + Items::IntoIter: ExactSizeIterator; + /// Read the length of the value in a fast way, without decoding the entire value. /// @@ -92,60 +91,58 @@ pub trait StorageValue { } /// A strongly-typed map in storage. -pub trait StorageMap { +pub trait StorageMap { /// The type that get/take return. type Query; /// Get the storage key used to fetch a value corresponding to a specific key. - fn hashed_key_for>(key: KeyArg) -> Vec; + fn hashed_key_for>(key: KeyArg) -> Vec; /// Does the value (explicitly) exist in storage? - fn exists>(key: KeyArg) -> bool; + fn exists>(key: KeyArg) -> bool; /// Load the value associated with the given key from the map. - fn get>(key: KeyArg) -> Self::Query; + fn get>(key: KeyArg) -> Self::Query; /// Swap the values of two keys. - fn swap, KeyArg2: Borrow>(key1: KeyArg1, key2: KeyArg2); + fn swap, KeyArg2: EncodeLike>(key1: KeyArg1, key2: KeyArg2); /// Store a value to be associated with the given key from the map. - fn insert, ValArg: Borrow>(key: KeyArg, val: ValArg); - - /// Store a value under this key into the provided storage instance; this can take any reference - /// type that derefs to `T` (and has `Encode` implemented). - fn insert_ref, ValArg: ?Sized + Encode>(key: KeyArg, val: &ValArg) where V: AsRef; + fn insert, ValArg: EncodeLike>(key: KeyArg, val: ValArg); /// Remove the value under a key. - fn remove>(key: KeyArg); + fn remove>(key: KeyArg); /// Mutate the value under a key. - fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R; + fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R; /// Take the value under a key. - fn take>(key: KeyArg) -> Self::Query; + fn take>(key: KeyArg) -> Self::Query; /// Append the given items to the value in the storage. /// /// `V` is required to implement `codec::EncodeAppend`. - fn append<'a, I, R, KeyArg>(key: KeyArg, items: R) -> Result<(), &'static str> + fn append(key: KeyArg, items: Items) -> Result<(), &'static str> where - KeyArg: Borrow, - I: 'a + codec::Encode, - V: codec::EncodeAppend, - R: IntoIterator + Clone, - R::IntoIter: ExactSizeIterator; + KeyArg: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator, + Items::IntoIter: ExactSizeIterator; /// Safely append the given items to the value in the storage. If a codec error occurs, then the /// old (presumably corrupt) value is replaced with the given `items`. /// - /// `T` is required to implement `codec::EncodeAppend`. - fn append_or_insert<'a, I, R, KeyArg>(key: KeyArg, items: R) + /// `V` is required to implement `codec::EncodeAppend`. + fn append_or_insert(key: KeyArg, items: Items) where - KeyArg: Borrow, - I: 'a + codec::Encode + Clone, - V: codec::EncodeAppend + crate::rstd::iter::FromIterator, - R: IntoIterator + Clone, - R::IntoIter: ExactSizeIterator; + KeyArg: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator + Clone + EncodeLike, + Items::IntoIter: ExactSizeIterator; /// Read the length of the value in a fast way, without decoding the entire value. /// @@ -154,14 +151,14 @@ pub trait StorageMap { /// Note that `0` is returned as the default value if no encoded value exists at the given key. /// Therefore, this function cannot be used as a sign of _existence_. use the `::exists()` /// function for this purpose. - fn decode_len>(key: KeyArg) -> Result + fn decode_len>(key: KeyArg) -> Result where V: codec::DecodeLength + Len; } /// A strongly-typed linked map in storage. /// /// Similar to `StorageMap` but allows to enumerate other elements and doesn't implement append. -pub trait StorageLinkedMap { +pub trait StorageLinkedMap { /// The type that get/take return. type Query; @@ -169,29 +166,25 @@ pub trait StorageLinkedMap { type Enumerator: Iterator; /// Does the value (explicitly) exist in storage? - fn exists>(key: KeyArg) -> bool; + fn exists>(key: KeyArg) -> bool; /// Load the value associated with the given key from the map. - fn get>(key: KeyArg) -> Self::Query; + fn get>(key: KeyArg) -> Self::Query; /// Swap the values of two keys. - fn swap, KeyArg2: Borrow>(key1: KeyArg1, key2: KeyArg2); + fn swap, KeyArg2: EncodeLike>(key1: KeyArg1, key2: KeyArg2); /// Store a value to be associated with the given key from the map. - fn insert, ValArg: Borrow>(key: KeyArg, val: ValArg); - - /// Store a value under this key into the provided storage instance; this can take any reference - /// type that derefs to `T` (and has `Encode` implemented). - fn insert_ref, ValArg: ?Sized + Encode>(key: KeyArg, val: &ValArg) where V: AsRef; + fn insert, ValArg: EncodeLike>(key: KeyArg, val: ValArg); /// Remove the value under a key. - fn remove>(key: KeyArg); + fn remove>(key: KeyArg); /// Mutate the value under a key. - fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R; + fn mutate, R, F: FnOnce(&mut Self::Query) -> R>(key: KeyArg, f: F) -> R; /// Take the value under a key. - fn take>(key: KeyArg) -> Self::Query; + fn take>(key: KeyArg) -> Self::Query; /// Return current head element. fn head() -> Option; @@ -206,7 +199,7 @@ pub trait StorageLinkedMap { /// Note that `0` is returned as the default value if no encoded value exists at the given key. /// Therefore, this function cannot be used as a sign of _existence_. use the `::exists()` /// function for this purpose. - fn decode_len>(key: KeyArg) -> Result + fn decode_len>(key: KeyArg) -> Result where V: codec::DecodeLength + Len; } @@ -214,67 +207,69 @@ pub trait StorageLinkedMap { /// /// It provides an important ability to efficiently remove all entries /// that have a common first key. -pub trait StorageDoubleMap { +pub trait StorageDoubleMap { /// The type that get/take returns. type Query; - fn exists(k1: &KArg1, k2: &KArg2) -> bool + fn exists(k1: KArg1, k2: KArg2) -> bool where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode; + KArg1: EncodeLike, + KArg2: EncodeLike; - fn get(k1: &KArg1, k2: &KArg2) -> Self::Query + fn get(k1: KArg1, k2: KArg2) -> Self::Query where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode; + KArg1: EncodeLike, + KArg2: EncodeLike; - fn take(k1: &KArg1, k2: &KArg2) -> Self::Query + fn take(k1: KArg1, k2: KArg2) -> Self::Query where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode; + KArg1: EncodeLike, + KArg2: EncodeLike; - fn insert(k1: &KArg1, k2: &KArg2, val: &VArg) + fn insert(k1: KArg1, k2: KArg2, val: VArg) where - K1: Borrow, - K2: Borrow, - V: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, - VArg: ?Sized + Encode; - - fn remove(k1: &KArg1, k2: &KArg2) + KArg1: EncodeLike, + KArg2: EncodeLike, + VArg: EncodeLike; + + fn remove(k1: KArg1, k2: KArg2) where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode; + KArg1: EncodeLike, + KArg2: EncodeLike; - fn remove_prefix(k1: &KArg1) where KArg1: ?Sized + Encode, K1: Borrow; + fn remove_prefix(k1: KArg1) where KArg1: ?Sized + EncodeLike; - fn mutate(k1: &KArg1, k2: &KArg2, f: F) -> R + fn mutate(k1: KArg1, k2: KArg2, f: F) -> R where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, + KArg1: EncodeLike, + KArg2: EncodeLike, F: FnOnce(&mut Self::Query) -> R; - fn append( - k1: &KArg1, - k2: &KArg2, - items: &[I], + fn append( + k1: KArg1, + k2: KArg2, + items: Items, ) -> Result<(), &'static str> where - K1: Borrow, - K2: Borrow, - KArg1: ?Sized + Encode, - KArg2: ?Sized + Encode, - I: codec::Encode, - V: EncodeAppend; + KArg1: EncodeLike, + KArg2: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator, + Items::IntoIter: ExactSizeIterator; + + fn append_or_insert( + k1: KArg1, + k2: KArg2, + items: Items, + ) + where + KArg1: EncodeLike, + KArg2: EncodeLike, + Item: Encode, + EncodeLikeItem: EncodeLike, + V: EncodeAppend, + Items: IntoIterator + Clone + EncodeLike, + Items::IntoIter: ExactSizeIterator; } diff --git a/srml/support/src/storage/storage_items.rs b/srml/support/src/storage/storage_items.rs index d93152bb9a7ae..67d301dad96fe 100644 --- a/srml/support/src/storage/storage_items.rs +++ b/srml/support/src/storage/storage_items.rs @@ -256,6 +256,7 @@ mod tests { use crate::metadata::*; use crate::metadata::StorageHasher; use crate::rstd::marker::PhantomData; + use crate::codec::{Encode, Decode, EncodeLike}; storage_items! { Value: b"a" => u32; @@ -286,7 +287,7 @@ mod tests { } pub trait Trait { - type Origin: crate::codec::Encode + crate::codec::Decode + ::std::default::Default; + type Origin: Encode + Decode + EncodeLike + std::default::Default; type BlockNumber; } @@ -839,13 +840,17 @@ mod test_append_and_len { #[test] fn append_or_put_works() { with_externalities(&mut TestExternalities::default(), || { - let _ = MapVec::append_or_insert(1, [1, 2, 3].iter()); - let _ = MapVec::append_or_insert(1, [4, 5].iter()); + let _ = MapVec::append_or_insert(1, &[1, 2, 3][..]); + let _ = MapVec::append_or_insert(1, &[4, 5][..]); assert_eq!(MapVec::get(1), vec![1, 2, 3, 4, 5]); - let _ = JustVec::append_or_put([1, 2, 3].iter()); - let _ = JustVec::append_or_put([4, 5].iter()); + let _ = JustVec::append_or_put(&[1, 2, 3][..]); + let _ = JustVec::append_or_put(&[4, 5][..]); assert_eq!(JustVec::get(), vec![1, 2, 3, 4, 5]); + + let _ = OptionVec::append_or_put(&[1, 2, 3][..]); + let _ = OptionVec::append_or_put(&[4, 5][..]); + assert_eq!(OptionVec::get(), Some(vec![1, 2, 3, 4, 5])); }); } diff --git a/srml/support/src/storage/unhashed.rs b/srml/support/src/storage/unhashed.rs index d3cf346aced8e..6397fd39fcd2d 100644 --- a/srml/support/src/storage/unhashed.rs +++ b/srml/support/src/storage/unhashed.rs @@ -16,7 +16,8 @@ //! Operation on unhashed runtime storage. -use super::{Encode, Decode, Vec}; +use rstd::prelude::*; +use codec::{Encode, Decode}; /// Return the value of the item in storage under `key`, or `None` if there is no explicit entry. pub fn get(key: &[u8]) -> Option { diff --git a/srml/support/src/traits.rs b/srml/support/src/traits.rs index 655df596d0a11..88e61593659dc 100644 --- a/srml/support/src/traits.rs +++ b/srml/support/src/traits.rs @@ -19,7 +19,7 @@ //! NOTE: If you're looking for `parameter_types`, it has moved in to the top-level module. use rstd::{prelude::*, result, marker::PhantomData, ops::Div}; -use codec::{Codec, Encode, Decode}; +use codec::{FullCodec, Codec, Encode, Decode}; use primitives::u32_trait::Value as U32; use sr_primitives::{ ConsensusEngineId, @@ -254,7 +254,7 @@ pub enum SignedImbalance>{ impl< P: Imbalance, N: Imbalance, - B: SimpleArithmetic + Codec + Copy + MaybeSerializeDebug + Default, + B: SimpleArithmetic + FullCodec + Copy + MaybeSerializeDebug + Default, > SignedImbalance { pub fn zero() -> Self { SignedImbalance::Positive(P::zero()) @@ -317,7 +317,7 @@ impl< /// Abstraction over a fungible assets system. pub trait Currency { /// The balance of an account. - type Balance: SimpleArithmetic + Codec + Copy + MaybeSerializeDebug + Default; + type Balance: SimpleArithmetic + FullCodec + Copy + MaybeSerializeDebug + Default; /// The opaque token type for an imbalance. This is returned by unbalanced operations /// and must be dealt with. It may be dropped but cannot be cloned. @@ -615,7 +615,7 @@ bitmask! { } pub trait Time { - type Moment: SimpleArithmetic + Codec + Clone + Default + Copy; + type Moment: SimpleArithmetic + FullCodec + Clone + Default + Copy; fn now() -> Self::Moment; } diff --git a/srml/support/test/tests/final_keys.rs b/srml/support/test/tests/final_keys.rs index fdd41b04fe1ee..04b243ae7ce0b 100644 --- a/srml/support/test/tests/final_keys.rs +++ b/srml/support/test/tests/final_keys.rs @@ -20,11 +20,11 @@ use codec::Encode; use support::{StorageDoubleMap, StorageLinkedMap, StorageMap, StorageValue}; mod no_instance { - use codec::{Encode, Decode}; + use codec::{Encode, Decode, EncodeLike}; pub trait Trait { type Origin; - type BlockNumber: Encode + Decode + Default + Clone; + type BlockNumber: Encode + Decode + EncodeLike + Default + Clone; } support::decl_module! { diff --git a/srml/support/test/tests/genesisconfig.rs b/srml/support/test/tests/genesisconfig.rs index 9d03d204dc5e7..e945c774c0d07 100644 --- a/srml/support/test/tests/genesisconfig.rs +++ b/srml/support/test/tests/genesisconfig.rs @@ -15,7 +15,7 @@ // along with Substrate. If not, see . pub trait Trait { - type BlockNumber: codec::Codec + Default; + type BlockNumber: codec::Codec + codec::EncodeLike + Default; type Origin; } diff --git a/srml/support/test/tests/instance.rs b/srml/support/test/tests/instance.rs index 0662689379cce..da4e73e71017a 100644 --- a/srml/support/test/tests/instance.rs +++ b/srml/support/test/tests/instance.rs @@ -45,7 +45,7 @@ mod module1 { type Event: From> + Into<::Event>; type Origin: From>; type SomeParameter: Get; - type GenericType: Default + Clone + codec::Codec; + type GenericType: Default + Clone + codec::Codec + codec::EncodeLike; } support::decl_module! { @@ -314,10 +314,10 @@ fn storage_instance_independance() { module2::Map::::insert(0, 0); module2::Map::::insert(0, 0); module2::Map::::insert(0, 0); - module2::LinkedMap::::insert(0, vec![]); - module2::LinkedMap::::insert(0, vec![]); - module2::LinkedMap::::insert(0, vec![]); - module2::LinkedMap::::insert(0, vec![]); + module2::LinkedMap::::insert::<_, Vec>(0, vec![]); + module2::LinkedMap::::insert::<_, Vec>(0, vec![]); + module2::LinkedMap::::insert::<_, Vec>(0, vec![]); + module2::LinkedMap::::insert::<_, Vec>(0, vec![]); module2::DoubleMap::::insert(&0, &0, &0); module2::DoubleMap::::insert(&0, &0, &0); module2::DoubleMap::::insert(&0, &0, &0); @@ -377,7 +377,7 @@ fn storage_with_instance_basic_operation() { assert_eq!(LinkedMap::get(key), vec![]); assert_eq!(LinkedMap::exists(key), false); assert_eq!(LinkedMap::enumerate().count(), 1); - LinkedMap::insert_ref(key, &vec![1]); + LinkedMap::insert(key, &vec![1]); assert_eq!(LinkedMap::enumerate().count(), 2); let key1 = 1; diff --git a/srml/support/test/tests/system.rs b/srml/support/test/tests/system.rs index 344a2bec730f1..1040b26cc6126 100644 --- a/srml/support/test/tests/system.rs +++ b/srml/support/test/tests/system.rs @@ -1,12 +1,12 @@ -use support::codec::{Encode, Decode}; +use support::codec::{Encode, Decode, EncodeLike}; pub trait Trait: 'static + Eq + Clone { type Origin: Into, Self::Origin>> + From>; - type BlockNumber: Decode + Encode + Clone + Default; + type BlockNumber: Decode + Encode + EncodeLike + Clone + Default; type Hash; - type AccountId: Encode + Decode; + type AccountId: Encode + EncodeLike + Decode; type Event: From; }