From 645ae551fcce76f040af71d10ad429baf40b6c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Thu, 24 Feb 2022 11:20:58 +0100 Subject: [PATCH] Switch to edition 2021 (#4976) * Switch to edition 2021 * Reset bridges * Fix compilation * Fix test-runtime * Fix malus --- Cargo.toml | 2 +- .../runtime-common/src/messages_benchmarking.rs | 16 ++++++++-------- cli/Cargo.toml | 2 +- core-primitives/Cargo.toml | 2 +- erasure-coding/Cargo.toml | 2 +- erasure-coding/fuzzer/Cargo.toml | 2 +- node/client/Cargo.toml | 2 +- node/collation-generation/Cargo.toml | 2 +- node/core/approval-voting/Cargo.toml | 2 +- node/core/av-store/Cargo.toml | 2 +- node/core/backing/Cargo.toml | 2 +- node/core/bitfield-signing/Cargo.toml | 2 +- node/core/candidate-validation/Cargo.toml | 2 +- node/core/chain-api/Cargo.toml | 2 +- node/core/chain-selection/Cargo.toml | 2 +- node/core/dispute-coordinator/Cargo.toml | 2 +- node/core/parachains-inherent/Cargo.toml | 2 +- node/core/provisioner/Cargo.toml | 2 +- node/core/pvf-checker/Cargo.toml | 2 +- node/core/pvf/Cargo.toml | 2 +- node/core/runtime-api/Cargo.toml | 2 +- node/jaeger/Cargo.toml | 2 +- node/malus/Cargo.toml | 4 ++-- node/metered-channel/Cargo.toml | 2 +- node/metrics/Cargo.toml | 2 +- node/network/approval-distribution/Cargo.toml | 2 +- .../network/availability-distribution/Cargo.toml | 2 +- node/network/availability-recovery/Cargo.toml | 2 +- node/network/bitfield-distribution/Cargo.toml | 2 +- node/network/bridge/Cargo.toml | 2 +- node/network/collator-protocol/Cargo.toml | 2 +- node/network/dispute-distribution/Cargo.toml | 2 +- node/network/gossip-support/Cargo.toml | 2 +- node/network/protocol/Cargo.toml | 2 +- node/network/statement-distribution/Cargo.toml | 2 +- node/overseer/Cargo.toml | 2 +- node/overseer/overseer-gen/Cargo.toml | 2 +- node/overseer/overseer-gen/proc-macro/Cargo.toml | 2 +- node/overseer/src/tests.rs | 1 - node/primitives/Cargo.toml | 2 +- node/service/Cargo.toml | 2 +- node/service/src/overseer.rs | 1 - node/subsystem-test-helpers/Cargo.toml | 2 +- node/subsystem-types/Cargo.toml | 2 +- node/subsystem-util/Cargo.toml | 2 +- node/subsystem-util/src/lib.rs | 2 -- node/subsystem/Cargo.toml | 2 +- node/test/client/Cargo.toml | 2 +- node/test/performance-test/Cargo.toml | 2 +- node/test/service/Cargo.toml | 2 +- parachain/Cargo.toml | 2 +- parachain/src/primitives.rs | 1 - parachain/test-parachains/Cargo.toml | 2 +- parachain/test-parachains/adder/Cargo.toml | 2 +- .../test-parachains/adder/collator/Cargo.toml | 2 +- parachain/test-parachains/halt/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- rpc/Cargo.toml | 2 +- runtime/common/Cargo.toml | 2 +- runtime/common/slot_range_helper/Cargo.toml | 2 +- runtime/kusama/Cargo.toml | 2 +- runtime/metrics/Cargo.toml | 2 +- runtime/parachains/Cargo.toml | 2 +- runtime/polkadot/Cargo.toml | 2 +- runtime/rococo/Cargo.toml | 2 +- runtime/test-runtime/Cargo.toml | 3 ++- runtime/westend/Cargo.toml | 2 +- statement-table/Cargo.toml | 2 +- utils/generate-bags/Cargo.toml | 2 +- utils/remote-ext-tests/bags-list/Cargo.toml | 2 +- utils/staking-miner/Cargo.toml | 2 +- xcm/Cargo.toml | 2 +- xcm/pallet-xcm-benchmarks/Cargo.toml | 2 +- xcm/pallet-xcm/Cargo.toml | 2 +- xcm/procedural/Cargo.toml | 2 +- xcm/xcm-builder/Cargo.toml | 2 +- xcm/xcm-executor/Cargo.toml | 2 +- xcm/xcm-executor/integration-tests/Cargo.toml | 2 +- xcm/xcm-simulator/Cargo.toml | 2 +- xcm/xcm-simulator/example/Cargo.toml | 2 +- xcm/xcm-simulator/fuzzer/Cargo.toml | 2 +- 81 files changed, 86 insertions(+), 90 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 32c11fe9dc6e..491c58724269 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ description = "Implementation of a `https://polkadot.network` node in Rust based license = "GPL-3.0-only" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" rust-version = "1.57.0" # custom profiles readme = "README.md" diff --git a/bridges/bin/runtime-common/src/messages_benchmarking.rs b/bridges/bin/runtime-common/src/messages_benchmarking.rs index 217560e11434..de2d0cd1cb60 100644 --- a/bridges/bin/runtime-common/src/messages_benchmarking.rs +++ b/bridges/bin/runtime-common/src/messages_benchmarking.rs @@ -35,7 +35,7 @@ use pallet_bridge_messages::benchmarking::{ use sp_core::Hasher; use sp_runtime::traits::Header; use sp_std::prelude::*; -use sp_trie::{record_all_keys, trie_types::TrieDBMut, Layout, MemoryDB, Recorder, TrieMut}; +use sp_trie::{record_all_keys, trie_types::TrieDBMutV1, LayoutV1, MemoryDB, Recorder, TrieMut}; /// Generate ed25519 signature to be used in /// `pallet_brdige_call_dispatch::CallOrigin::TargetAccount`. @@ -102,7 +102,7 @@ where let mut root = Default::default(); let mut mdb = MemoryDB::default(); { - let mut trie = TrieDBMut::::new(&mut mdb, &mut root); + let mut trie = TrieDBMutV1::::new(&mut mdb, &mut root); // insert messages for nonce in params.message_nonces.clone() { @@ -131,7 +131,7 @@ where // generate storage proof to be delivered to This chain let mut proof_recorder = Recorder::::new(); - record_all_keys::, _>(&mdb, &root, &mut proof_recorder) + record_all_keys::, _>(&mdb, &root, &mut proof_recorder) .map_err(|_| "record_all_keys has failed") .expect("record_all_keys should not fail in benchmarks"); let storage_proof = proof_recorder.drain().into_iter().map(|n| n.data.to_vec()).collect(); @@ -175,7 +175,7 @@ where let mut root = Default::default(); let mut mdb = MemoryDB::default(); { - let mut trie = TrieDBMut::::new(&mut mdb, &mut root); + let mut trie = TrieDBMutV1::::new(&mut mdb, &mut root); trie.insert(&storage_key, ¶ms.inbound_lane_data.encode()) .map_err(|_| "TrieMut::insert has failed") .expect("TrieMut::insert should not fail in benchmarks"); @@ -184,7 +184,7 @@ where // generate storage proof to be delivered to This chain let mut proof_recorder = Recorder::::new(); - record_all_keys::, _>(&mdb, &root, &mut proof_recorder) + record_all_keys::, _>(&mdb, &root, &mut proof_recorder) .map_err(|_| "record_all_keys has failed") .expect("record_all_keys should not fail in benchmarks"); let storage_proof = proof_recorder.drain().into_iter().map(|n| n.data.to_vec()).collect(); @@ -209,11 +209,11 @@ fn grow_trie(mut root: H::Out, mdb: &mut MemoryDB, trie_size: Proo ProofSize::HasExtraNodes(size) => (8, 1, size), }; - let mut key_index = 0; + let mut key_index = 0u32; loop { // generate storage proof to be delivered to This chain let mut proof_recorder = Recorder::::new(); - record_all_keys::, _>(mdb, &root, &mut proof_recorder) + record_all_keys::, _>(mdb, &root, &mut proof_recorder) .map_err(|_| "record_all_keys has failed") .expect("record_all_keys should not fail in benchmarks"); let size: usize = proof_recorder.drain().into_iter().map(|n| n.data.len()).sum(); @@ -221,7 +221,7 @@ fn grow_trie(mut root: H::Out, mdb: &mut MemoryDB, trie_size: Proo return root } - let mut trie = TrieDBMut::::from_existing(mdb, &mut root) + let mut trie = TrieDBMutV1::::from_existing(mdb, &mut root) .map_err(|_| "TrieDBMut::from_existing has failed") .expect("TrieDBMut::from_existing should not fail in benchmarks"); for _ in 0..iterations { diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 366258a017f9..88b6ed53ea2e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -3,7 +3,7 @@ name = "polkadot-cli" version = "0.9.17" authors = ["Parity Technologies "] description = "Polkadot Relay-chain Client Node" -edition = "2018" +edition = "2021" [package.metadata.wasm-pack.profile.release] # `wasm-opt` has some problems on Linux, see diff --git a/core-primitives/Cargo.toml b/core-primitives/Cargo.toml index bb7c809c65fd..bf5572fca5ea 100644 --- a/core-primitives/Cargo.toml +++ b/core-primitives/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-core-primitives" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/erasure-coding/Cargo.toml b/erasure-coding/Cargo.toml index cd5853df5033..7fe2023364f0 100644 --- a/erasure-coding/Cargo.toml +++ b/erasure-coding/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-erasure-coding" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] polkadot-primitives = { path = "../primitives" } diff --git a/erasure-coding/fuzzer/Cargo.toml b/erasure-coding/fuzzer/Cargo.toml index 13812ab76bd7..d531c42d4289 100644 --- a/erasure-coding/fuzzer/Cargo.toml +++ b/erasure-coding/fuzzer/Cargo.toml @@ -2,7 +2,7 @@ name = "erasure_coding_fuzzer" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] polkadot-erasure-coding = { path = ".." } diff --git a/node/client/Cargo.toml b/node/client/Cargo.toml index 3ebd65de8ab1..2f10ff290eab 100644 --- a/node/client/Cargo.toml +++ b/node/client/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-client" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/collation-generation/Cargo.toml b/node/collation-generation/Cargo.toml index 09cc647e441c..d1d62569f915 100644 --- a/node/collation-generation/Cargo.toml +++ b/node/collation-generation/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-collation-generation" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/approval-voting/Cargo.toml b/node/core/approval-voting/Cargo.toml index a328dec18d50..e14b547058fd 100644 --- a/node/core/approval-voting/Cargo.toml +++ b/node/core/approval-voting/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-approval-voting" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index 4c79fc9fcff5..29f3bba9dc91 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-av-store" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/backing/Cargo.toml b/node/core/backing/Cargo.toml index 0bc7ff04c1c3..c5a02c0df538 100644 --- a/node/core/backing/Cargo.toml +++ b/node/core/backing/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-backing" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/bitfield-signing/Cargo.toml b/node/core/bitfield-signing/Cargo.toml index 60501a3137a7..820c12afabcf 100644 --- a/node/core/bitfield-signing/Cargo.toml +++ b/node/core/bitfield-signing/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-bitfield-signing" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/candidate-validation/Cargo.toml b/node/core/candidate-validation/Cargo.toml index ab0fbccf1268..e6035670f496 100644 --- a/node/core/candidate-validation/Cargo.toml +++ b/node/core/candidate-validation/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-candidate-validation" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] async-trait = "0.1.52" diff --git a/node/core/chain-api/Cargo.toml b/node/core/chain-api/Cargo.toml index ecac94abcb46..85629724fd66 100644 --- a/node/core/chain-api/Cargo.toml +++ b/node/core/chain-api/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-chain-api" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/chain-selection/Cargo.toml b/node/core/chain-selection/Cargo.toml index 38544cf0574c..33ff8e37db2b 100644 --- a/node/core/chain-selection/Cargo.toml +++ b/node/core/chain-selection/Cargo.toml @@ -3,7 +3,7 @@ name = "polkadot-node-core-chain-selection" description = "Chain Selection Subsystem" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/dispute-coordinator/Cargo.toml b/node/core/dispute-coordinator/Cargo.toml index 686441352bbe..680875f38a17 100644 --- a/node/core/dispute-coordinator/Cargo.toml +++ b/node/core/dispute-coordinator/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-dispute-coordinator" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/parachains-inherent/Cargo.toml b/node/core/parachains-inherent/Cargo.toml index a050d4a6974e..6652d34ab0e8 100644 --- a/node/core/parachains-inherent/Cargo.toml +++ b/node/core/parachains-inherent/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-parachains-inherent" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/provisioner/Cargo.toml b/node/core/provisioner/Cargo.toml index 1fbe9f83bef8..094171264553 100644 --- a/node/core/provisioner/Cargo.toml +++ b/node/core/provisioner/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-provisioner" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } diff --git a/node/core/pvf-checker/Cargo.toml b/node/core/pvf-checker/Cargo.toml index efb3b1d2ac0a..875323e909df 100644 --- a/node/core/pvf-checker/Cargo.toml +++ b/node/core/pvf-checker/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-pvf-checker" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/core/pvf/Cargo.toml b/node/core/pvf/Cargo.toml index ee486b3c66dd..217fe431d73a 100644 --- a/node/core/pvf/Cargo.toml +++ b/node/core/pvf/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-pvf" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [[bin]] name = "puppet_worker" diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index 143d7b5dca9a..9a2892c5ac76 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-core-runtime-api" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/jaeger/Cargo.toml b/node/jaeger/Cargo.toml index d7a16098c190..b9a6d32722cf 100644 --- a/node/jaeger/Cargo.toml +++ b/node/jaeger/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-jaeger" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Polkadot Jaeger primitives" [dependencies] diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index 68e6b82f7e9a..ced05ca9cec9 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -4,7 +4,7 @@ description = "Misbehaving nodes for local testnets, system and Simnet tests." license = "GPL-3.0-only" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" readme = "README.md" publish = false @@ -13,7 +13,7 @@ name = "malus" path = "src/malus.rs" [dependencies] -polkadot-cli = { path = "../../cli", default-features = false, features = ["cli", "malus"] } +polkadot-cli = { path = "../../cli", default-features = false, features = ["cli", "malus", "polkadot-native"] } polkadot-node-subsystem = { path = "../subsystem" } polkadot-node-subsystem-util = { path = "../subsystem-util" } polkadot-node-subsystem-types = { path = "../subsystem-types" } diff --git a/node/metered-channel/Cargo.toml b/node/metered-channel/Cargo.toml index 2d21321130b7..06b390b4ac78 100644 --- a/node/metered-channel/Cargo.toml +++ b/node/metered-channel/Cargo.toml @@ -2,7 +2,7 @@ name = "metered-channel" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Channels with attached Meters" [dependencies] diff --git a/node/metrics/Cargo.toml b/node/metrics/Cargo.toml index b41ae13c5386..814b3cb75fb1 100644 --- a/node/metrics/Cargo.toml +++ b/node/metrics/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-metrics" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Subsystem metric helpers" [dependencies] diff --git a/node/network/approval-distribution/Cargo.toml b/node/network/approval-distribution/Cargo.toml index 83e628663767..be488999c8f8 100644 --- a/node/network/approval-distribution/Cargo.toml +++ b/node/network/approval-distribution/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-approval-distribution" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] polkadot-node-primitives = { path = "../../primitives" } diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index 41e8d4d40195..1aaa1b497b50 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-availability-distribution" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/network/availability-recovery/Cargo.toml b/node/network/availability-recovery/Cargo.toml index 70756fefdab8..e0696e17f8b2 100644 --- a/node/network/availability-recovery/Cargo.toml +++ b/node/network/availability-recovery/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-availability-recovery" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/network/bitfield-distribution/Cargo.toml b/node/network/bitfield-distribution/Cargo.toml index 346a26353cb1..2b19e0a5bbaf 100644 --- a/node/network/bitfield-distribution/Cargo.toml +++ b/node/network/bitfield-distribution/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-availability-bitfield-distribution" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/network/bridge/Cargo.toml b/node/network/bridge/Cargo.toml index 4062d463b8a7..33bd223ca991 100644 --- a/node/network/bridge/Cargo.toml +++ b/node/network/bridge/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-network-bridge" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] async-trait = "0.1.52" diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index 21ec6620cbf4..08a9c30093ed 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-collator-protocol" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] always-assert = "0.1.2" diff --git a/node/network/dispute-distribution/Cargo.toml b/node/network/dispute-distribution/Cargo.toml index 7c2f0436d6da..e80a1d9333bb 100644 --- a/node/network/dispute-distribution/Cargo.toml +++ b/node/network/dispute-distribution/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-dispute-distribution" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/network/gossip-support/Cargo.toml b/node/network/gossip-support/Cargo.toml index 221f6de7bd2b..4de7f8d4d118 100644 --- a/node/network/gossip-support/Cargo.toml +++ b/node/network/gossip-support/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-gossip-support" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/protocol/Cargo.toml b/node/network/protocol/Cargo.toml index 17cb28969cb8..a80b6cf27543 100644 --- a/node/network/protocol/Cargo.toml +++ b/node/network/protocol/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-network-protocol" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Primitives types for the Node-side" [dependencies] diff --git a/node/network/statement-distribution/Cargo.toml b/node/network/statement-distribution/Cargo.toml index 4a3a06a25a96..8c0fa6350362 100644 --- a/node/network/statement-distribution/Cargo.toml +++ b/node/network/statement-distribution/Cargo.toml @@ -3,7 +3,7 @@ name = "polkadot-statement-distribution" version = "0.9.17" authors = ["Parity Technologies "] description = "Statement Distribution Subsystem" -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index 33f391271bed..40ee0955f8a4 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-overseer" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] client = { package = "sc-client-api", git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/overseer/overseer-gen/Cargo.toml b/node/overseer/overseer-gen/Cargo.toml index c3e8e147edae..24cdf8eb014f 100644 --- a/node/overseer/overseer-gen/Cargo.toml +++ b/node/overseer/overseer-gen/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-overseer-gen" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Generate an overseer including builder pattern and message wrapper from a single struct." [dependencies] diff --git a/node/overseer/overseer-gen/proc-macro/Cargo.toml b/node/overseer/overseer-gen/proc-macro/Cargo.toml index 3a68d8b63228..786728aa98e6 100644 --- a/node/overseer/overseer-gen/proc-macro/Cargo.toml +++ b/node/overseer/overseer-gen/proc-macro/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-overseer-gen-proc-macro" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Generate an overseer including builder pattern and message wrapper from a single annotated struct definition." [package.metadata.docs.rs] diff --git a/node/overseer/src/tests.rs b/node/overseer/src/tests.rs index 77145f0dc06f..761cb970cd1d 100644 --- a/node/overseer/src/tests.rs +++ b/node/overseer/src/tests.rs @@ -47,7 +47,6 @@ use sp_core::crypto::Pair as _; use super::*; fn block_info_to_pair(blocks: impl IntoIterator) -> Vec<(Hash, BlockNumber)> { - use std::iter::FromIterator; Vec::from_iter( blocks .into_iter() diff --git a/node/primitives/Cargo.toml b/node/primitives/Cargo.toml index 96af76f07c4d..a56f1ba56f8e 100644 --- a/node/primitives/Cargo.toml +++ b/node/primitives/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-primitives" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Primitives types for the Node-side" [dependencies] diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index b06b59339e8b..771c2614a4d8 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-service" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] # Substrate Client diff --git a/node/service/src/overseer.rs b/node/service/src/overseer.rs index 4b4d9682e0de..63e086de8c61 100644 --- a/node/service/src/overseer.rs +++ b/node/service/src/overseer.rs @@ -178,7 +178,6 @@ where Spawner: 'static + SpawnNamed + Clone + Unpin, { use polkadot_node_subsystem_util::metrics::Metrics; - use std::iter::FromIterator; let metrics = ::register(registry)?; diff --git a/node/subsystem-test-helpers/Cargo.toml b/node/subsystem-test-helpers/Cargo.toml index 5a5408bc5984..141c4d23c1e9 100644 --- a/node/subsystem-test-helpers/Cargo.toml +++ b/node/subsystem-test-helpers/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-subsystem-test-helpers" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Subsystem traits and message definitions" [dependencies] diff --git a/node/subsystem-types/Cargo.toml b/node/subsystem-types/Cargo.toml index a0e6586c3fd5..4a020a923ca4 100644 --- a/node/subsystem-types/Cargo.toml +++ b/node/subsystem-types/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-subsystem-types" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Subsystem traits and message definitions" [dependencies] diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 7b2596a5ac25..1bb8eea01991 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-subsystem-util" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Subsystem traits and message definitions" [dependencies] diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index bf120c945f02..2f07aa9389a3 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -250,8 +250,6 @@ pub async fn sign( key: &ValidatorId, data: &[u8], ) -> Result, KeystoreError> { - use std::convert::TryInto; - let signature = CryptoStore::sign_with(&**keystore, ValidatorId::ID, &key.into(), &data).await?; diff --git a/node/subsystem/Cargo.toml b/node/subsystem/Cargo.toml index 1dc1e208b87f..3f960bcb8b92 100644 --- a/node/subsystem/Cargo.toml +++ b/node/subsystem/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-node-subsystem" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" description = "Subsystem traits and message definitions and the generated overseer" [dependencies] diff --git a/node/test/client/Cargo.toml b/node/test/client/Cargo.toml index e8f404ed870c..307730488930 100644 --- a/node/test/client/Cargo.toml +++ b/node/test/client/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-test-client" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] parity-scale-codec = { version = "2.3.1", default-features = false, features = ["derive"] } diff --git a/node/test/performance-test/Cargo.toml b/node/test/performance-test/Cargo.toml index bd5a5be241d3..0c43a1c45f2e 100644 --- a/node/test/performance-test/Cargo.toml +++ b/node/test/performance-test/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-performance-test" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] thiserror = "1.0.30" diff --git a/node/test/service/Cargo.toml b/node/test/service/Cargo.toml index 526d02bb6216..a85777238174 100644 --- a/node/test/service/Cargo.toml +++ b/node/test/service/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-test-service" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] futures = "0.3.21" diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 1cf1801f4a24..266a19ead253 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -3,7 +3,7 @@ name = "polkadot-parachain" version = "0.9.17" authors = ["Parity Technologies "] description = "Types and utilities for creating and working with parachains" -edition = "2018" +edition = "2021" [dependencies] # note: special care is taken to avoid inclusion of `sp-io` externals when compiling diff --git a/parachain/src/primitives.rs b/parachain/src/primitives.rs index df2b338ca6fa..b7de1d0ada33 100644 --- a/parachain/src/primitives.rs +++ b/parachain/src/primitives.rs @@ -158,7 +158,6 @@ impl From for Id { impl From for Id { fn from(x: usize) -> Self { - use sp_std::convert::TryInto; // can't panic, so need to truncate let x = x.try_into().unwrap_or(u32::MAX); Id(x) diff --git a/parachain/test-parachains/Cargo.toml b/parachain/test-parachains/Cargo.toml index fc769e898dfb..d587c30292d3 100644 --- a/parachain/test-parachains/Cargo.toml +++ b/parachain/test-parachains/Cargo.toml @@ -3,7 +3,7 @@ name = "test-parachains" version = "0.9.17" authors = ["Parity Technologies "] description = "Integration tests using the test-parachains" -edition = "2018" +edition = "2021" [dependencies] tiny-keccak = "2.0.2" diff --git a/parachain/test-parachains/adder/Cargo.toml b/parachain/test-parachains/adder/Cargo.toml index 781c27893584..7bd3272a4861 100644 --- a/parachain/test-parachains/adder/Cargo.toml +++ b/parachain/test-parachains/adder/Cargo.toml @@ -3,7 +3,7 @@ name = "test-parachain-adder" version = "0.9.17" authors = ["Parity Technologies "] description = "Test parachain which adds to a number as its state transition" -edition = "2018" +edition = "2021" build = "build.rs" [dependencies] diff --git a/parachain/test-parachains/adder/collator/Cargo.toml b/parachain/test-parachains/adder/collator/Cargo.toml index 3c6f49bfd409..495710f3f7c9 100644 --- a/parachain/test-parachains/adder/collator/Cargo.toml +++ b/parachain/test-parachains/adder/collator/Cargo.toml @@ -3,7 +3,7 @@ name = "test-parachain-adder-collator" version = "0.9.17" authors = ["Parity Technologies "] description = "Collator for the adder test parachain" -edition = "2018" +edition = "2021" [[bin]] name = "adder-collator" diff --git a/parachain/test-parachains/halt/Cargo.toml b/parachain/test-parachains/halt/Cargo.toml index a79f1773c7ef..2b99fd41d886 100644 --- a/parachain/test-parachains/halt/Cargo.toml +++ b/parachain/test-parachains/halt/Cargo.toml @@ -3,7 +3,7 @@ name = "test-parachain-halt" version = "0.9.17" authors = ["Parity Technologies "] description = "Test parachain which executes forever" -edition = "2018" +edition = "2021" build = "build.rs" [dependencies] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index faf41737c0f9..30581eb307fc 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-primitives" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] serde = { version = "1.0.136", optional = true, features = ["derive"] } diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 28ca97b49608..a0a059544bd1 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-rpc" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] jsonrpc-core = "18.0.0" diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index da760b960c87..1d9a7b31d2af 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-runtime-common" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] impl-trait-for-tuples = "0.2.2" diff --git a/runtime/common/slot_range_helper/Cargo.toml b/runtime/common/slot_range_helper/Cargo.toml index d728f7f7b1f4..0f86e308a161 100644 --- a/runtime/common/slot_range_helper/Cargo.toml +++ b/runtime/common/slot_range_helper/Cargo.toml @@ -2,7 +2,7 @@ name = "slot-range-helper" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] paste = "1.0" diff --git a/runtime/kusama/Cargo.toml b/runtime/kusama/Cargo.toml index 3615191879e5..f705e28c816a 100644 --- a/runtime/kusama/Cargo.toml +++ b/runtime/kusama/Cargo.toml @@ -2,7 +2,7 @@ name = "kusama-runtime" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" build = "build.rs" [dependencies] diff --git a/runtime/metrics/Cargo.toml b/runtime/metrics/Cargo.toml index 14aefaa2626f..48e84a4a16ee 100644 --- a/runtime/metrics/Cargo.toml +++ b/runtime/metrics/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-runtime-metrics" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] sp-std = { package = "sp-std", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false} diff --git a/runtime/parachains/Cargo.toml b/runtime/parachains/Cargo.toml index 028b749452d9..35880d339c1e 100644 --- a/runtime/parachains/Cargo.toml +++ b/runtime/parachains/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-runtime-parachains" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } diff --git a/runtime/polkadot/Cargo.toml b/runtime/polkadot/Cargo.toml index f8f5a5d915bb..4e04f7dbbbed 100644 --- a/runtime/polkadot/Cargo.toml +++ b/runtime/polkadot/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-runtime" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" build = "build.rs" [dependencies] diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index ac92aeeb2b51..078883434f2f 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -2,7 +2,7 @@ name = "rococo-runtime" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" build = "build.rs" [dependencies] diff --git a/runtime/test-runtime/Cargo.toml b/runtime/test-runtime/Cargo.toml index 45b434f0baa5..d8ef280a57ee 100644 --- a/runtime/test-runtime/Cargo.toml +++ b/runtime/test-runtime/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-test-runtime" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" build = "build.rs" [dependencies] @@ -129,4 +129,5 @@ std = [ "runtime-common/std", "log/std", "frame-election-provider-support/std", + "pallet-sudo/std", ] diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index 37ad7429b4d0..402f8d7b490f 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -2,7 +2,7 @@ name = "westend-runtime" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" build = "build.rs" [dependencies] diff --git a/statement-table/Cargo.toml b/statement-table/Cargo.toml index d4f95908775b..1c1d22ea608d 100644 --- a/statement-table/Cargo.toml +++ b/statement-table/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-statement-table" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] parity-scale-codec = { version = "2.3.1", default-features = false, features = ["derive"] } diff --git a/utils/generate-bags/Cargo.toml b/utils/generate-bags/Cargo.toml index 82a455fbdbe8..36320e15a36a 100644 --- a/utils/generate-bags/Cargo.toml +++ b/utils/generate-bags/Cargo.toml @@ -2,7 +2,7 @@ name = "polkadot-voter-bags" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] clap = { version = "3.1", features = ["derive"] } diff --git a/utils/remote-ext-tests/bags-list/Cargo.toml b/utils/remote-ext-tests/bags-list/Cargo.toml index ff4cd45ec643..14511e7292cc 100644 --- a/utils/remote-ext-tests/bags-list/Cargo.toml +++ b/utils/remote-ext-tests/bags-list/Cargo.toml @@ -2,7 +2,7 @@ name = "remote-ext-tests-bags-list" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] polkadot-runtime = { version = "0.9.17", path = "../../../runtime/polkadot" } diff --git a/utils/staking-miner/Cargo.toml b/utils/staking-miner/Cargo.toml index 8126c84e1a39..d73dfa9c6d94 100644 --- a/utils/staking-miner/Cargo.toml +++ b/utils/staking-miner/Cargo.toml @@ -2,7 +2,7 @@ name = "staking-miner" version = "0.9.17" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" [dependencies] clap = { version = "3.1", features = ["derive", "env"] } diff --git a/xcm/Cargo.toml b/xcm/Cargo.toml index 560df741b1b5..fa26804f7c1e 100644 --- a/xcm/Cargo.toml +++ b/xcm/Cargo.toml @@ -3,7 +3,7 @@ name = "xcm" version = "0.9.17" authors = ["Parity Technologies "] description = "The basic XCM datastructures." -edition = "2018" +edition = "2021" [dependencies] impl-trait-for-tuples = "0.2.2" diff --git a/xcm/pallet-xcm-benchmarks/Cargo.toml b/xcm/pallet-xcm-benchmarks/Cargo.toml index 0cc3c4bb0202..bc73e2ef0c2b 100644 --- a/xcm/pallet-xcm-benchmarks/Cargo.toml +++ b/xcm/pallet-xcm-benchmarks/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pallet-xcm-benchmarks" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" version = "0.9.17" [package.metadata.docs.rs] diff --git a/xcm/pallet-xcm/Cargo.toml b/xcm/pallet-xcm/Cargo.toml index b497f3a10f11..bb1dff9bc214 100644 --- a/xcm/pallet-xcm/Cargo.toml +++ b/xcm/pallet-xcm/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" name = "pallet-xcm" version = "0.9.17" diff --git a/xcm/procedural/Cargo.toml b/xcm/procedural/Cargo.toml index cbe7bea685db..02de4fbba984 100644 --- a/xcm/procedural/Cargo.toml +++ b/xcm/procedural/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Parity Technologies "] name = "xcm-procedural" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] proc-macro = true diff --git a/xcm/xcm-builder/Cargo.toml b/xcm/xcm-builder/Cargo.toml index 36be7d2e41d5..3929e885e80f 100644 --- a/xcm/xcm-builder/Cargo.toml +++ b/xcm/xcm-builder/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" name = "xcm-builder" description = "Tools & types for building with XCM and its executor." version = "0.9.17" diff --git a/xcm/xcm-executor/Cargo.toml b/xcm/xcm-executor/Cargo.toml index ac4f1fea5172..aca64b8d9017 100644 --- a/xcm/xcm-executor/Cargo.toml +++ b/xcm/xcm-executor/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" name = "xcm-executor" description = "An abstract and configurable XCM message executor." version = "0.9.17" diff --git a/xcm/xcm-executor/integration-tests/Cargo.toml b/xcm/xcm-executor/integration-tests/Cargo.toml index 89ad1713ab8d..ffa1523bfda8 100644 --- a/xcm/xcm-executor/integration-tests/Cargo.toml +++ b/xcm/xcm-executor/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" name = "xcm-executor-integration-tests" description = "Integration tests for the XCM Executor" version = "0.9.17" diff --git a/xcm/xcm-simulator/Cargo.toml b/xcm/xcm-simulator/Cargo.toml index e3904603b90e..5a7801987ac2 100644 --- a/xcm/xcm-simulator/Cargo.toml +++ b/xcm/xcm-simulator/Cargo.toml @@ -3,7 +3,7 @@ name = "xcm-simulator" version = "0.9.17" authors = ["Parity Technologies "] description = "Test kit to simulate cross-chain message passing and XCM execution" -edition = "2018" +edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0" } diff --git a/xcm/xcm-simulator/example/Cargo.toml b/xcm/xcm-simulator/example/Cargo.toml index e4348c838df4..3f0a85650bd8 100644 --- a/xcm/xcm-simulator/example/Cargo.toml +++ b/xcm/xcm-simulator/example/Cargo.toml @@ -3,7 +3,7 @@ name = "xcm-simulator-example" version = "0.9.17" authors = ["Parity Technologies "] description = "Examples of xcm-simulator usage." -edition = "2018" +edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0" } diff --git a/xcm/xcm-simulator/fuzzer/Cargo.toml b/xcm/xcm-simulator/fuzzer/Cargo.toml index c6b0552d0768..e3c6935ccbbf 100644 --- a/xcm/xcm-simulator/fuzzer/Cargo.toml +++ b/xcm/xcm-simulator/fuzzer/Cargo.toml @@ -3,7 +3,7 @@ name = "xcm-simulator-fuzzer" version = "0.9.17" authors = ["Parity Technologies "] description = "Examples of xcm-simulator usage." -edition = "2018" +edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "2.0.0" }