Skip to content

Commit

Permalink
Update dependencies (paritytech#1527)
Browse files Browse the repository at this point in the history
* update to latest env_logger

* roundabout dependency update

* Update to latest vengen

* Update rand to 0.6

* Update to latest rng shuffle API

* Roundabout update of dependencies

* Update rustc_hex

* Update wasm

* Fix logging setup in tests

* revert to fix test
  • Loading branch information
gnunicorn authored and MTDK1 committed Apr 12, 2019
1 parent 39fc70d commit f3a8bfa
Show file tree
Hide file tree
Showing 28 changed files with 531 additions and 825 deletions.
1,259 changes: 487 additions & 772 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ futures = "0.1"
ctrlc = { version = "3.0", features = ["termination"] }

[build-dependencies]
vergen = "2"
vergen = "3"

[workspace]
members = [
Expand Down
9 changes: 2 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@

extern crate vergen;

use vergen::{ConstantsFlags, Vergen};
use vergen::{ConstantsFlags, generate_cargo_keys};

const ERROR_MSG: &'static str = "Failed to generate metadata files";

fn main() {
let vergen = Vergen::new(ConstantsFlags::all()).expect(ERROR_MSG);

for (k, v) in vergen.build_info() {
println!("cargo:rustc-env={}={}", k.name(), v);
}

generate_cargo_keys(ConstantsFlags::all()).expect(ERROR_MSG);
println!("cargo:rerun-if-changed=.git/HEAD");
}
2 changes: 1 addition & 1 deletion core/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2018"
[dependencies]
clap = "~2.32"
backtrace = "0.3"
env_logger = "0.5"
env_logger = "0.6"
error-chain = "0.12"
log = "0.4"
atty = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion core/client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ log = "0.4"
kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
# FIXME replace with release as soon as our rocksdb changes are released upstream https://github.com/paritytech/parity-common/issues/88
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
lru-cache = "0.1"
lru-cache = "0.1.1"
hash-db = { version = "0.9" }
primitives = { package = "substrate-primitives", path = "../../primitives" }
runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" }
Expand Down
4 changes: 2 additions & 2 deletions core/consensus/aura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ futures = "0.1.17"
tokio = "0.1.7"
parking_lot = "0.7.1"
error-chain = "0.12"
log = "0.3"
log = "0.4"
consensus_common = { package = "substrate-consensus-common", path = "../common" }

[dev-dependencies]
Expand All @@ -30,4 +30,4 @@ substrate-executor = { path = "../../executor" }
network = { package = "substrate-network", path = "../../network", features = ["test-helpers"]}
service = { package = "substrate-service", path = "../../service" }
test_client = { package = "substrate-test-client", path = "../../test-client" }
env_logger = "0.4"
env_logger = "0.6"
2 changes: 1 addition & 1 deletion core/consensus/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ mod tests {

#[test]
fn authoring_blocks() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = AuraTestNet::new(3);

net.start();
Expand Down
2 changes: 1 addition & 1 deletion core/finality-grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ features = ["derive-codec"]
substrate-network = { path = "../network", features = ["test-helpers"] }
substrate-keyring = { path = "../keyring" }
substrate-test-client = { path = "../test-client"}
env_logger = "0.5"
env_logger = "0.6"

[features]
default = ["service-integration"]
Expand Down
2 changes: 1 addition & 1 deletion core/keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ substrate-primitives = { path = "../primitives" }
parity-crypto = { version = "0.2", default-features = false }
error-chain = "0.12"
hex = "0.3"
rand = "0.4"
rand = "0.6"
serde_json = "1.0"
serde = "1.0"
serde_derive = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion core/keystore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct EncryptedKey {

impl EncryptedKey {
fn encrypt(plain: &[u8; PKCS_LEN], password: &str, iterations: u32) -> Self {
use rand::{Rng, OsRng};
use rand::{Rng, rngs::OsRng};

let mut rng = OsRng::new().expect("OS Randomness available on all supported platforms; qed");

Expand Down
2 changes: 1 addition & 1 deletion core/network-libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ libp2p = { version = "0.2", default-features = false, features = ["secio-rsa", "
parking_lot = "0.7.1"
lazy_static = "1.2"
log = "0.4"
rand = "0.5.0"
rand = "0.6"
serde = "1.0.70"
serde_derive = "1.0.70"
serde_json = "1.0.24"
Expand Down
8 changes: 4 additions & 4 deletions core/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ error-chain = "0.12"
bitflags = "1.0"
futures = "0.1.17"
linked-hash-map = "0.5"
rustc-hex = "1.0"
rand = "0.5"
rustc-hex = "2.0"
rand = "0.6"
substrate-primitives = { path = "../../core/primitives" }
substrate-consensus-common = { path = "../../core/consensus/common" }
substrate-client = { path = "../../core/client" }
Expand All @@ -25,12 +25,12 @@ parity-codec-derive = "2.1"
substrate-network-libp2p = { path = "../../core/network-libp2p" }
tokio = "0.1.11"

env_logger = { version = "0.4", optional = true }
env_logger = { version = "0.6", optional = true }
substrate-keyring = { path = "../../core/keyring", optional = true }
substrate-test-client = { path = "../../core/test-client", optional = true }

[dev-dependencies]
env_logger = { version = "0.4" }
env_logger = { version = "0.6" }
substrate-keyring = { path = "../../core/keyring" }
substrate-test-client = { path = "../../core/test-client" }

Expand Down
4 changes: 2 additions & 2 deletions core/network/src/consensus_gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use std::collections::{HashMap, HashSet};
use futures::sync::mpsc;
use std::time::{Instant, Duration};
use rand::{self, Rng};
use rand::{self, seq::SliceRandom};
use network_libp2p::NodeIndex;
use runtime_primitives::traits::{Block as BlockT, Header as HeaderT, Hash, HashFor};
use runtime_primitives::generic::BlockId;
Expand Down Expand Up @@ -125,7 +125,7 @@ impl<B: BlockT> ConsensusGossip<B> {
.filter_map(|(id, ref peer)| if !peer.is_authority && !peer.known_messages.contains(&(topic, message_hash)) { Some(*id) } else { None })
.collect();

rand::thread_rng().shuffle(&mut non_authorities);
non_authorities.shuffle(&mut rand::thread_rng());
let non_authorities: HashSet<_> = if non_authorities.is_empty() {
HashSet::new()
} else {
Expand Down
8 changes: 4 additions & 4 deletions core/network/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,12 @@ impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Protocol<B, S, H> {

fn on_remote_read_request(&self, io: &mut SyncIo, who: NodeIndex, request: message::RemoteReadRequest<B::Hash>) {
trace!(target: "sync", "Remote read request {} from {} ({} at {})",
request.id, who, request.key.to_hex(), request.block);
request.id, who, request.key.to_hex::<String>(), request.block);
let proof = match self.context_data.chain.read_proof(&request.block, &request.key) {
Ok(proof) => proof,
Err(error) => {
trace!(target: "sync", "Remote read request {} from {} ({} at {}) failed with: {}",
request.id, who, request.key.to_hex(), request.block, error);
request.id, who, request.key.to_hex::<String>(), request.block, error);
Default::default()
},
};
Expand Down Expand Up @@ -766,13 +766,13 @@ impl<B: BlockT, S: NetworkSpecialization<B>, H: ExHashT> Protocol<B, S, H> {

fn on_remote_changes_request(&self, io: &mut SyncIo, who: NodeIndex, request: message::RemoteChangesRequest<B::Hash>) {
trace!(target: "sync", "Remote changes proof request {} from {} for key {} ({}..{})",
request.id, who, request.key.to_hex(), request.first, request.last);
request.id, who, request.key.to_hex::<String>(), request.first, request.last);
let key = StorageKey(request.key);
let proof = match self.context_data.chain.key_changes_proof(request.first, request.last, request.min, request.max, &key) {
Ok(proof) => proof,
Err(error) => {
trace!(target: "sync", "Remote changes proof request {} from {} for key {} ({}..{}) failed with: {}",
request.id, who, key.0.to_hex(), request.first, request.last, error);
request.id, who, key.0.to_hex::<String>(), request.first, request.last, error);
ChangesProof::<B::Header> {
max_block: Zero::zero(),
proof: vec![],
Expand Down
18 changes: 10 additions & 8 deletions core/network/src/test/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use super::*;

#[test]
fn sync_from_two_peers_works() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = TestNet::new(3);
net.peer(1).push_blocks(100, false);
net.peer(2).push_blocks(100, false);
Expand All @@ -35,7 +35,7 @@ fn sync_from_two_peers_works() {

#[test]
fn sync_from_two_peers_with_ancestry_search_works() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = TestNet::new(3);
net.peer(0).push_blocks(10, true);
net.peer(1).push_blocks(100, false);
Expand All @@ -57,7 +57,7 @@ fn sync_long_chain_works() {

#[test]
fn sync_no_common_longer_chain_fails() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = TestNet::new(3);
net.peer(0).push_blocks(20, true);
net.peer(1).push_blocks(20, false);
Expand All @@ -67,13 +67,15 @@ fn sync_no_common_longer_chain_fails() {

#[test]
fn sync_justifications() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = JustificationTestNet::new(3);
net.peer(0).push_blocks(20, false);
net.sync();

// there's currently no justification for block #10
assert_eq!(net.peer(0).client().justification(&BlockId::Number(10)).unwrap(), None);
assert_eq!(net.peer(1).client().justification(&BlockId::Number(10)).unwrap(), None);

// we finalize block #10 for peer 0 with a justification
net.peer(0).client().finalize_block(BlockId::Number(10), Some(Vec::new()), true).unwrap();

Expand All @@ -88,7 +90,7 @@ fn sync_justifications() {

#[test]
fn sync_after_fork_works() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = TestNet::new(3);
net.sync_step();
net.peer(0).push_blocks(30, false);
Expand All @@ -112,7 +114,7 @@ fn sync_after_fork_works() {

#[test]
fn syncs_all_forks() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = TestNet::new(4);
net.sync_step();
net.peer(0).push_blocks(2, false);
Expand All @@ -129,7 +131,7 @@ fn syncs_all_forks() {

#[test]
fn own_blocks_are_announced() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = TestNet::new(3);
net.sync(); // connect'em
net.peer(0).generate_blocks(1, BlockOrigin::Own, |builder| builder.bake().unwrap());
Expand All @@ -146,7 +148,7 @@ fn own_blocks_are_announced() {

#[test]
fn blocks_are_not_announced_by_light_nodes() {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
let mut net = TestNet::new(0);

// full peer0 is connected to light peer
Expand Down
2 changes: 1 addition & 1 deletion core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ blake2-rfc = { version = "0.2.18", optional = true }

[dev-dependencies]
substrate-serializer = { path = "../serializer" }
pretty_assertions = "0.4"
pretty_assertions = "0.5"
heapsize = "0.4"

[features]
Expand Down
4 changes: 2 additions & 2 deletions core/service/test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ authors = ["Parity Technologies <admin@parity.io>"]
tempdir = "0.3"
tokio = "0.1.7"
futures = "0.1"
log = "0.3"
env_logger = "0.4"
log = "0.4"
env_logger = "0.6"
fdlimit = "0.1"
substrate-service = { path = "../../../core/service" }
substrate-network = { path = "../../../core/network" }
Expand Down
2 changes: 1 addition & 1 deletion core/service/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn node_config<F: ServiceFactory> (

impl<F: ServiceFactory> TestNet<F> {
fn new(temp: &TempDir, spec: FactoryChainSpec<F>, full: u32, light: u32, authorities: Vec<String>, base_port: u16) -> TestNet<F> {
::env_logger::init().ok();
let _ = ::env_logger::try_init();
::fdlimit::raise_fd_limit();
let runtime = Runtime::new().expect("Error creating tokio runtime");
let mut net = TestNet {
Expand Down
2 changes: 1 addition & 1 deletion core/state-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ parity-codec = "2.2"
parity-codec-derive = "2.1"

[dev-dependencies]
env_logger = "0.4"
env_logger = "0.6"
Binary file not shown.
2 changes: 1 addition & 1 deletion core/trie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ substrate-primitives = { path = "../primitives" }
trie-bench = { version = "0.9" }
trie-standardmap = { version = "0.9" }
keccak-hasher = { version = "0.2" }
criterion = "0.1.2"
criterion = "0.2"
hex-literal = "0.1.0"

[features]
Expand Down
2 changes: 1 addition & 1 deletion node/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sr-primitives = { path = "../../core/sr-primitives", default-features = false }

[dev-dependencies]
substrate-serializer = { path = "../../core/serializer" }
pretty_assertions = "0.4"
pretty_assertions = "0.5"

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ srml-sudo = { path = "../../srml/sudo", default-features = false }
srml-upgrade-key = { path = "../../srml/upgrade-key", default-features = false }
node-primitives = { path = "../primitives", default-features = false }
substrate-consensus-aura-primitives = { path = "../../core/consensus/aura/primitives", default-features = false }
rustc-hex = { version = "1.0", optional = true }
rustc-hex = { version = "2.0", optional = true }
hex-literal = { version = "0.1.0", optional = true }
serde = { version = "1.0", optional = true }
substrate-keyring = { path = "../../core/keyring", optional = true }
Expand Down
8 changes: 1 addition & 7 deletions node/runtime/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
2 changes: 1 addition & 1 deletion subkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
substrate-primitives = { version = "*", path = "../core/primitives" }
rand = "0.4"
rand = "0.6"
clap = { version = "~2.32", features = ["yaml"] }

[features]
Expand Down
2 changes: 1 addition & 1 deletion subkey/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern crate rand;
#[macro_use]
extern crate clap;

use rand::{OsRng, Rng};
use rand::{RngCore, rngs::OsRng};
use substrate_primitives::{ed25519::Pair, hexdisplay::HexDisplay};

mod vanity;
Expand Down
2 changes: 1 addition & 1 deletion subkey/src/vanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

use rand::{OsRng, Rng};
use rand::{rngs::OsRng, RngCore};
use substrate_primitives::ed25519::Pair;

fn good_waypoint(done: u64) -> u64 {
Expand Down

0 comments on commit f3a8bfa

Please sign in to comment.