Update log -> 0.4, env_logger -> 0.5. (#9294)

* Rename a few types & methods.

* Change `(Log)Builder::format` (closure) arg.
This commit is contained in:
Nick Sanders
2018-08-09 16:04:10 -07:00
committed by André Silva
parent b28e742683
commit e590874a81
41 changed files with 168 additions and 110 deletions

View File

@@ -22,7 +22,7 @@ use {SyncConfig, WarpSync};
#[test]
fn two_peers() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(3);
net.peer(1).chain.add_blocks(1000, EachBlockWith::Uncle);
net.peer(2).chain.add_blocks(1000, EachBlockWith::Uncle);
@@ -33,7 +33,7 @@ fn two_peers() {
#[test]
fn long_chain() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(2);
net.peer(1).chain.add_blocks(50000, EachBlockWith::Nothing);
net.sync();
@@ -43,7 +43,7 @@ fn long_chain() {
#[test]
fn status_after_sync() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(3);
net.peer(1).chain.add_blocks(1000, EachBlockWith::Uncle);
net.peer(2).chain.add_blocks(1000, EachBlockWith::Uncle);
@@ -63,7 +63,7 @@ fn takes_few_steps() {
#[test]
fn empty_blocks() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(3);
for n in 0..200 {
let with = if n % 2 == 0 { EachBlockWith::Nothing } else { EachBlockWith::Uncle };
@@ -77,7 +77,7 @@ fn empty_blocks() {
#[test]
fn forked() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(3);
net.peer(0).chain.add_blocks(30, EachBlockWith::Uncle);
net.peer(1).chain.add_blocks(30, EachBlockWith::Uncle);
@@ -98,7 +98,7 @@ fn forked() {
#[test]
fn forked_with_misbehaving_peer() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(3);
let mut alt_spec = ::ethcore::spec::Spec::new_test();
@@ -122,7 +122,7 @@ fn forked_with_misbehaving_peer() {
#[test]
fn net_hard_fork() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let ref_client = TestBlockChainClient::new();
ref_client.add_blocks(50, EachBlockWith::Uncle);
{
@@ -141,7 +141,7 @@ fn net_hard_fork() {
#[test]
fn restart() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(3);
net.peer(1).chain.add_blocks(1000, EachBlockWith::Uncle);
net.peer(2).chain.add_blocks(1000, EachBlockWith::Uncle);
@@ -255,7 +255,7 @@ fn high_td_attach() {
#[test]
fn disconnect_on_unrelated_chain() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut net = TestNet::new(2);
net.peer(0).chain.set_history(Some(20));
net.peer(1).chain.set_history(Some(20));

View File

@@ -141,7 +141,7 @@ impl SnapshotService for TestSnapshotService {
#[test]
fn snapshot_sync() {
::env_logger::init().ok();
::env_logger::try_init().ok();
let mut config = SyncConfig::default();
config.warp_sync = WarpSync::Enabled;
let mut net = TestNet::new_with_config(5, config);