Skip to content
Snippets Groups Projects
Commit d9d53c17 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Switch to edition 2021 (#4976)

* Switch to edition 2021

* Reset bridges

* Fix compilation

* Fix test-runtime

* Fix malus
parent 1ea0f60a
No related merge requests found
Showing
with 27 additions and 27 deletions
...@@ -8,7 +8,7 @@ description = "Implementation of a `https://polkadot.network` node in Rust based ...@@ -8,7 +8,7 @@ description = "Implementation of a `https://polkadot.network` node in Rust based
license = "GPL-3.0-only" license = "GPL-3.0-only"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
rust-version = "1.57.0" # custom profiles rust-version = "1.57.0" # custom profiles
readme = "README.md" readme = "README.md"
......
...@@ -35,7 +35,7 @@ use pallet_bridge_messages::benchmarking::{ ...@@ -35,7 +35,7 @@ use pallet_bridge_messages::benchmarking::{
use sp_core::Hasher; use sp_core::Hasher;
use sp_runtime::traits::Header; use sp_runtime::traits::Header;
use sp_std::prelude::*; 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 /// Generate ed25519 signature to be used in
/// `pallet_brdige_call_dispatch::CallOrigin::TargetAccount`. /// `pallet_brdige_call_dispatch::CallOrigin::TargetAccount`.
...@@ -102,7 +102,7 @@ where ...@@ -102,7 +102,7 @@ where
let mut root = Default::default(); let mut root = Default::default();
let mut mdb = MemoryDB::default(); let mut mdb = MemoryDB::default();
{ {
let mut trie = TrieDBMut::<H>::new(&mut mdb, &mut root); let mut trie = TrieDBMutV1::<H>::new(&mut mdb, &mut root);
// insert messages // insert messages
for nonce in params.message_nonces.clone() { for nonce in params.message_nonces.clone() {
...@@ -131,7 +131,7 @@ where ...@@ -131,7 +131,7 @@ where
// generate storage proof to be delivered to This chain // generate storage proof to be delivered to This chain
let mut proof_recorder = Recorder::<H::Out>::new(); let mut proof_recorder = Recorder::<H::Out>::new();
record_all_keys::<Layout<H>, _>(&mdb, &root, &mut proof_recorder) record_all_keys::<LayoutV1<H>, _>(&mdb, &root, &mut proof_recorder)
.map_err(|_| "record_all_keys has failed") .map_err(|_| "record_all_keys has failed")
.expect("record_all_keys should not fail in benchmarks"); .expect("record_all_keys should not fail in benchmarks");
let storage_proof = proof_recorder.drain().into_iter().map(|n| n.data.to_vec()).collect(); let storage_proof = proof_recorder.drain().into_iter().map(|n| n.data.to_vec()).collect();
...@@ -175,7 +175,7 @@ where ...@@ -175,7 +175,7 @@ where
let mut root = Default::default(); let mut root = Default::default();
let mut mdb = MemoryDB::default(); let mut mdb = MemoryDB::default();
{ {
let mut trie = TrieDBMut::<H>::new(&mut mdb, &mut root); let mut trie = TrieDBMutV1::<H>::new(&mut mdb, &mut root);
trie.insert(&storage_key, &params.inbound_lane_data.encode()) trie.insert(&storage_key, &params.inbound_lane_data.encode())
.map_err(|_| "TrieMut::insert has failed") .map_err(|_| "TrieMut::insert has failed")
.expect("TrieMut::insert should not fail in benchmarks"); .expect("TrieMut::insert should not fail in benchmarks");
...@@ -184,7 +184,7 @@ where ...@@ -184,7 +184,7 @@ where
// generate storage proof to be delivered to This chain // generate storage proof to be delivered to This chain
let mut proof_recorder = Recorder::<H::Out>::new(); let mut proof_recorder = Recorder::<H::Out>::new();
record_all_keys::<Layout<H>, _>(&mdb, &root, &mut proof_recorder) record_all_keys::<LayoutV1<H>, _>(&mdb, &root, &mut proof_recorder)
.map_err(|_| "record_all_keys has failed") .map_err(|_| "record_all_keys has failed")
.expect("record_all_keys should not fail in benchmarks"); .expect("record_all_keys should not fail in benchmarks");
let storage_proof = proof_recorder.drain().into_iter().map(|n| n.data.to_vec()).collect(); let storage_proof = proof_recorder.drain().into_iter().map(|n| n.data.to_vec()).collect();
...@@ -209,11 +209,11 @@ fn grow_trie<H: Hasher>(mut root: H::Out, mdb: &mut MemoryDB<H>, trie_size: Proo ...@@ -209,11 +209,11 @@ fn grow_trie<H: Hasher>(mut root: H::Out, mdb: &mut MemoryDB<H>, trie_size: Proo
ProofSize::HasExtraNodes(size) => (8, 1, size), ProofSize::HasExtraNodes(size) => (8, 1, size),
}; };
let mut key_index = 0; let mut key_index = 0u32;
loop { loop {
// generate storage proof to be delivered to This chain // generate storage proof to be delivered to This chain
let mut proof_recorder = Recorder::<H::Out>::new(); let mut proof_recorder = Recorder::<H::Out>::new();
record_all_keys::<Layout<H>, _>(mdb, &root, &mut proof_recorder) record_all_keys::<LayoutV1<H>, _>(mdb, &root, &mut proof_recorder)
.map_err(|_| "record_all_keys has failed") .map_err(|_| "record_all_keys has failed")
.expect("record_all_keys should not fail in benchmarks"); .expect("record_all_keys should not fail in benchmarks");
let size: usize = proof_recorder.drain().into_iter().map(|n| n.data.len()).sum(); let size: usize = proof_recorder.drain().into_iter().map(|n| n.data.len()).sum();
...@@ -221,7 +221,7 @@ fn grow_trie<H: Hasher>(mut root: H::Out, mdb: &mut MemoryDB<H>, trie_size: Proo ...@@ -221,7 +221,7 @@ fn grow_trie<H: Hasher>(mut root: H::Out, mdb: &mut MemoryDB<H>, trie_size: Proo
return root return root
} }
let mut trie = TrieDBMut::<H>::from_existing(mdb, &mut root) let mut trie = TrieDBMutV1::<H>::from_existing(mdb, &mut root)
.map_err(|_| "TrieDBMut::from_existing has failed") .map_err(|_| "TrieDBMut::from_existing has failed")
.expect("TrieDBMut::from_existing should not fail in benchmarks"); .expect("TrieDBMut::from_existing should not fail in benchmarks");
for _ in 0..iterations { for _ in 0..iterations {
......
...@@ -3,7 +3,7 @@ name = "polkadot-cli" ...@@ -3,7 +3,7 @@ name = "polkadot-cli"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node" description = "Polkadot Relay-chain Client Node"
edition = "2018" edition = "2021"
[package.metadata.wasm-pack.profile.release] [package.metadata.wasm-pack.profile.release]
# `wasm-opt` has some problems on Linux, see # `wasm-opt` has some problems on Linux, see
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-core-primitives" name = "polkadot-core-primitives"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-erasure-coding" name = "polkadot-erasure-coding"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
polkadot-primitives = { path = "../primitives" } polkadot-primitives = { path = "../primitives" }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "erasure_coding_fuzzer" name = "erasure_coding_fuzzer"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
polkadot-erasure-coding = { path = ".." } polkadot-erasure-coding = { path = ".." }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-client" name = "polkadot-client"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" } frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-collation-generation" name = "polkadot-node-collation-generation"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-approval-voting" name = "polkadot-node-core-approval-voting"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-av-store" name = "polkadot-node-core-av-store"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-backing" name = "polkadot-node-core-backing"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-bitfield-signing" name = "polkadot-node-core-bitfield-signing"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-candidate-validation" name = "polkadot-node-core-candidate-validation"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
async-trait = "0.1.52" async-trait = "0.1.52"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-chain-api" name = "polkadot-node-core-chain-api"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -3,7 +3,7 @@ name = "polkadot-node-core-chain-selection" ...@@ -3,7 +3,7 @@ name = "polkadot-node-core-chain-selection"
description = "Chain Selection Subsystem" description = "Chain Selection Subsystem"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-dispute-coordinator" name = "polkadot-node-core-dispute-coordinator"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-parachains-inherent" name = "polkadot-node-core-parachains-inherent"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-provisioner" name = "polkadot-node-core-provisioner"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-pvf-checker" name = "polkadot-node-core-pvf-checker"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.21" futures = "0.3.21"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "polkadot-node-core-pvf" name = "polkadot-node-core-pvf"
version = "0.9.17" version = "0.9.17"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2021"
[[bin]] [[bin]]
name = "puppet_worker" name = "puppet_worker"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment