Migrate consensus (common, aura-primitives, aura, rhd) to 2018 edition (#1548)

This commit is contained in:
Stanislav Tkach
2019-01-24 17:51:33 +02:00
committed by Gav Wood
parent a5cafa68b1
commit 7f05bd959f
14 changed files with 65 additions and 136 deletions
+13 -13
View File
@@ -3,21 +3,22 @@ name = "substrate-consensus-rhd"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Rhododendron Round-Based consensus-algorithm for substrate"
edition = "2018"
[dependencies]
futures = "0.1.17"
parity-codec = { version = "2.2" }
parity-codec-derive = { version = "2.0" }
substrate-primitives = { path = "../../primitives" }
substrate-consensus-common = { path = "../common" }
substrate-client = { path = "../../client" }
substrate-transaction-pool = { path = "../../transaction-pool" }
srml-support = { path = "../../../srml/support" }
primitives = { package = "substrate-primitives", path = "../../primitives" }
consensus = { package = "substrate-consensus-common", path = "../common" }
client = { package = "substrate-client", path = "../../client" }
transaction_pool = { package = "substrate-transaction-pool", path = "../../transaction-pool" }
runtime_support = { package = "srml-support", path = "../../../srml/support" }
srml-system = { path = "../../../srml/system" }
srml-consensus = { path = "../../../srml/consensus" }
sr-primitives = { path = "../../sr-primitives" }
sr-version = { path = "../../sr-version" }
sr-io = { path = "../../sr-io" }
runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" }
runtime_version = { package = "sr-version", path = "../../sr-version" }
runtime_io = { package = "sr-io", path = "../../sr-io" }
tokio = "0.1.7"
parking_lot = "0.7.1"
error-chain = "0.12"
@@ -25,7 +26,6 @@ log = "0.4"
rhododendron = { version = "0.4.0", features = ["codec"] }
exit-future = "0.1"
[dev-dependencies]
substrate-keyring = { path = "../../keyring" }
substrate-executor = { path = "../../executor" }
@@ -33,8 +33,8 @@ substrate-executor = { path = "../../executor" }
[features]
default = ["std"]
std = [
"substrate-primitives/std",
"srml-support/std",
"sr-primitives/std",
"sr-version/std",
"primitives/std",
"runtime_support/std",
"runtime_primitives/std",
"runtime_version/std",
]
+3 -1
View File
@@ -18,6 +18,8 @@
use consensus::error::{Error as CommonError, ErrorKind as CommonErrorKind};
use primitives::AuthorityId;
use client;
use error_chain::{error_chain, error_chain_processing, impl_error_chain_processed,
impl_extract_backtrace, impl_error_chain_kind};
error_chain! {
links {
@@ -54,4 +56,4 @@ impl From<CommonErrorKind> for Error {
fn from(e: CommonErrorKind) -> Self {
CommonError::from(e).into()
}
}
}
+2 -30
View File
@@ -33,40 +33,12 @@
#![cfg(feature="rhd")]
// FIXME: doesn't compile - https://github.com/paritytech/substrate/issues/1020
extern crate parity_codec as codec;
extern crate substrate_primitives as primitives;
extern crate substrate_client as client;
extern crate substrate_consensus_common as consensus;
extern crate substrate_transaction_pool as transaction_pool;
extern crate srml_system;
extern crate srml_support as runtime_support;
extern crate sr_primitives as runtime_primitives;
extern crate sr_version as runtime_version;
extern crate sr_io as runtime_io;
extern crate parking_lot;
extern crate rhododendron;
extern crate futures;
extern crate exit_future;
extern crate tokio;
#[macro_use]
extern crate log;
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate parity_codec_derive;
#[cfg(test)]
extern crate substrate_keyring;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::{self, Instant, Duration};
use codec::{Decode, Encode};
use parity_codec::{Decode, Encode};
use parity_codec_derive::{Decode, Encode};
use consensus::offline_tracker::OfflineTracker;
use consensus::error::{ErrorKind as CommonErrorKind};
use consensus::{Authorities, BlockImport, Environment, Proposer as BaseProposer};