splitting part of util into smaller crates (#4956)

* split path module from util

* moved RotatingLogger from util to logger crate

* fix tests

* fix tests

* use only one version of ansi_term crate
This commit is contained in:
Marek Kotewicz
2017-03-22 06:23:40 +01:00
committed by GitHub
parent 63f1ca9243
commit d530cc86f3
42 changed files with 93 additions and 80 deletions

View File

@@ -22,7 +22,7 @@ use std::cmp::max;
use cli::{Args, ArgsError};
use util::{Hashable, H256, U256, Uint, Bytes, version_data, Address};
use util::journaldb::Algorithm;
use util::log::Colour;
use util::Colour;
use ethsync::{NetworkConfiguration, is_valid_node_url, AllowIP};
use ethcore::ethstore::ethkey::Secret;
use ethcore::client::{VMType};
@@ -824,7 +824,7 @@ impl Configuration {
}
fn directories(&self) -> Directories {
use util::path;
use path;
let local_path = default_local_path();
let base_path = self.args.flag_base_path.as_ref().map_or_else(|| default_data_path(), |s| s.clone());

View File

@@ -18,7 +18,7 @@ use std::{io, env};
use std::io::{Write, BufReader, BufRead};
use std::time::Duration;
use std::fs::File;
use util::{clean_0x, U256, Uint, Address, path, CompactionProfile};
use util::{clean_0x, U256, Uint, Address, CompactionProfile};
use util::journaldb::Algorithm;
use ethcore::client::{Mode, BlockId, VMType, DatabaseCompactionProfile, ClientConfig, VerifierType};
use ethcore::miner::{PendingSet, GasLimit, PrioritizationStrategy};
@@ -27,6 +27,7 @@ use dir::DatabaseDirectories;
use upgrade::{upgrade, upgrade_data_paths};
use migration::migrate;
use ethsync::is_valid_node_url;
use path;
pub fn to_duration(s: &str) -> Result<Duration, String> {
to_seconds(s).map(Duration::from_secs)
@@ -465,7 +466,7 @@ but the first password is trimmed
#[test]
#[cfg(not(windows))]
fn test_geth_ipc_path() {
use util::path;
use path;
assert_eq!(geth_ipc_path(true), path::ethereum::with_testnet("geth.ipc").to_str().unwrap().to_owned());
assert_eq!(geth_ipc_path(false), path::ethereum::with_default("geth.ipc").to_str().unwrap().to_owned());
}

View File

@@ -61,6 +61,7 @@ extern crate parity_reactor;
extern crate parity_updater as updater;
extern crate parity_local_store as local_store;
extern crate rpc_cli;
extern crate path;
#[macro_use]
extern crate log as rlog;

View File

@@ -33,7 +33,7 @@ use ethsync::{ManageNetwork, SyncProvider};
use hash_fetch::fetch::Client as FetchClient;
use jsonrpc_core::{MetaIoHandler};
use updater::Updater;
use util::RotatingLogger;
use ethcore_logger::RotatingLogger;
#[derive(Debug, PartialEq, Clone, Eq, Hash)]
pub enum Api {

View File

@@ -20,9 +20,9 @@ use ctrlc::CtrlC;
use fdlimit::raise_fd_limit;
use ethcore_rpc::{NetworkSettings, informant, is_major_importing};
use ethsync::NetworkConfiguration;
use util::{Colour, version, RotatingLogger, Mutex, Condvar};
use util::{Colour, version, Mutex, Condvar};
use io::{MayPanic, ForwardPanic, PanicHandler};
use ethcore_logger::{Config as LogConfig};
use ethcore_logger::{Config as LogConfig, RotatingLogger};
use ethcore::miner::{StratumOptions, Stratum};
use ethcore::client::{Client, Mode, DatabaseCompactionProfile, VMType, BlockChainClient};
use ethcore::service::ClientService;

View File

@@ -29,7 +29,7 @@ use helpers::replace_home;
use io::{ForwardPanic, PanicHandler};
use jsonrpc_core::reactor::{RpcHandler, Remote};
use rpc_apis;
use util::path::restrict_permissions_owner;
use path::restrict_permissions_owner;
use util::H256;
const CODES_FILENAME: &'static str = "authcodes";