Skip to content

Commit

Permalink
refactor: removed duplicate and some useless optional dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
frol committed Apr 24, 2020
1 parent ace0654 commit 012de6a
Show file tree
Hide file tree
Showing 66 changed files with 1,473 additions and 1,640 deletions.
2,566 changes: 1,174 additions & 1,392 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ members = [
]

[dev-dependencies]
actix = "0.9.0"
lazy_static = "1.4.0"
log = "0.4.6"
actix = "0.9"
lazy_static = "1.4"
log = "^0.4.6"
rand = "0.7"
serde_json = "1.0.0"
serde_json = "1"
reqwest = "0.10"
futures = "0.3"

Expand Down Expand Up @@ -89,6 +89,3 @@ regression_tests = []
old_tests = []
adversarial = ["neard/adversarial", "near-jsonrpc/adversarial"]
metric_recorder = ["neard/metric_recorder"]

[patch.crates-io]
actix-rt = { git = "https://github.com/actix/actix-net", rev="602db1779eb51d60e0fe5a33d725d1d7fdf540fd" }
5 changes: 2 additions & 3 deletions chain/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ failure_derive = "0.1"
futures = "0.3"
rocksdb = "0.13"
rand = "0.7"
serde = "1.0"
serde_derive = "1.0"
cached = "0.12.0"
serde = { version = "1", features = [ "derive" ] }
cached = "0.12"
lazy_static = "1.4"
num-rational = "0.2.4"
tracing = "0.1.13"
Expand Down
7 changes: 3 additions & 4 deletions chain/chunks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2018"

[dependencies]
actix = "0.9.0"
actix = "0.9"
futures = "0.3"
rand = "0.7"
chrono = "0.4.6"
log = "0.4"
borsh = "0.6.1"
serde = "1.0"
serde_derive = "1.0"
cached = "0.12.0"
serde = { version = "1", features = [ "derive" ] }
cached = "0.12"
reed-solomon-erasure = "4"

near-crypto = { path = "../../core/crypto" }
Expand Down
14 changes: 7 additions & 7 deletions chain/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2018"

[dependencies]
ansi_term = "0.12"
actix = "0.9.0"
ansi_term = "0.11"
actix = "0.9"
futures = "0.3"
chrono = { version = "0.4.4", features = ["serde"] }
rocksdb = "0.13"
log = "0.4"
rand = "0.7"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sysinfo = "0.10.5"
strum = { version = "0.16.0", features = ["derive"] }
cached = "0.12.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sysinfo = "0.14"
strum = { version = "0.18", features = ["derive"] }
cached = "0.12"
lazy_static = "1.4"
borsh = "0.6.1"
reed-solomon-erasure = "4"
Expand Down
11 changes: 5 additions & 6 deletions chain/epoch_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ edition = "2018"

[dependencies]
# Changing this version will lead to change to the protocol, as will change how validators get shuffled.
protocol_defining_rand = { package = "rand", version = "0.6.5" }
protocol_defining_rand = { package = "rand", version = "0.6.5", default-features = false }
log = "0.4"
cached = "0.12.0"
cached = "0.12"
borsh = "0.6.1"
rand = "0.7"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
ethereum-types = "0.8.0"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
primitive-types = { version = "0.7", default-features = false }
num-rational = "0.2.4"

near-crypto = { path = "../../core/crypto" }
Expand Down
2 changes: 1 addition & 1 deletion chain/epoch_manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::{BTreeMap, HashMap, HashSet};
use std::sync::Arc;

use cached::{Cached, SizedCache};
use ethereum_types::U256;
use log::{debug, warn};
use primitive_types::U256;

use near_primitives::hash::CryptoHash;
use near_primitives::types::{
Expand Down
5 changes: 3 additions & 2 deletions chain/epoch_manager/src/reward_calculator.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use ethereum_types::U256;
use std::cmp::max;
use std::collections::HashMap;

use near_primitives::types::{AccountId, Balance, BlockChunkValidatorStats};
use num_rational::Rational;
use primitive_types::U256;

use near_primitives::types::{AccountId, Balance, BlockChunkValidatorStats};

#[derive(Clone)]
pub struct RewardCalculator {
Expand Down
21 changes: 6 additions & 15 deletions chain/jsonrpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,24 @@ authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2018"

[dependencies]
ansi_term = "0.12"
actix = "0.9.0"
actix-web = "2.0.0"
actix-cors = "0.2.0"
actix = "0.9"
actix-web = "2"
actix-cors = "0.2"
tokio = { version = "0.2", features = ["full"] }
base64 = "0.11"
bytes = "0.5"
futures = "0.3"
chrono = { version = "0.4.4", features = ["serde"] }
lazy_static = "1.4"
log = "0.4"
prometheus = "^0.7"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
prometheus = "0.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
validator = "0.10"
uuid = { version = "~0.8", features = ["v4"] }
borsh = "0.6.1"

near-chain-configs = { path = "../../core/chain-configs" }
near-crypto = { path = "../../core/crypto" }
near-primitives = { path = "../../core/primitives" }
near-store = { path = "../../core/store" }
near-metrics = { path = "../../core/metrics" }
near-chain = { path = "../chain" }
near-client = { path = "../client" }
near-network = { path = "../network" }
near-pool = { path = "../pool" }
near-jsonrpc-client = { path = "client" }
near-rpc-error-macro = { path = "../../tools/rpctypegen/macro" }

Expand Down
6 changes: 3 additions & 3 deletions chain/jsonrpc/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2018"

[dependencies]
actix-web = "2.0.0"
actix-web = "2"
futures = "0.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
uuid = { version = "~0.8", features = ["v4"] }

near-chain-configs = { path = "../../../core/chain-configs" }
Expand Down
2 changes: 1 addition & 1 deletion chain/jsonrpc/tests/http_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use futures::{future, FutureExt};
use near_jsonrpc::client::new_http_client;
use near_primitives::test_utils::init_test_logger;

mod test_utils;
pub mod test_utils;

/// Retrieve client status via HTTP GET.
#[test]
Expand Down
2 changes: 1 addition & 1 deletion chain/jsonrpc/tests/rpc_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use near_primitives::types::{BlockId, BlockIdOrFinality, Finality, ShardId};
use near_primitives::views::{QueryRequest, QueryResponseKind};

#[macro_use]
mod test_utils;
pub mod test_utils;

/// Retrieve blocks via json rpc
#[test]
Expand Down
2 changes: 1 addition & 1 deletion chain/jsonrpc/tests/rpc_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use near_primitives::types::BlockIdOrFinality;
use near_primitives::views::FinalExecutionStatus;

#[macro_use]
mod test_utils;
pub mod test_utils;

/// Test sending transaction via json rpc without waiting.
#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ use near_primitives::types::NumBlocks;

lazy_static::lazy_static! {
pub static ref TEST_GENESIS_CONFIG: GenesisConfig =
GenesisConfig::from_json(include_str!("../../../neard/res/genesis_config.json"));
GenesisConfig::from_json(include_str!("../../../../neard/res/genesis_config.json"));
}

#[allow(dead_code)] // Suppress Rustc warnings even though these variants are used.
pub enum NodeType {
Validator,
NonValidator,
Expand Down
11 changes: 5 additions & 6 deletions chain/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@ edition = "2018"

[dependencies]
bytes = "0.5"
actix = "0.9.0"
actix = "0.9"
log = "0.4"
tokio = { version = "0.2", features = ["full"] }
tokio-util = { version = "0.2", features = ["codec"] }
futures = "0.3"
chrono = { version = "0.4.4", features = ["serde"] }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
rand = "0.7"
byteorder = "1.2"
lazy_static = "1.4"
tracing = "0.1.13"

borsh = "0.6.1"
cached = "0.12.0"
cached = "0.12"

near-chain-configs = { path = "../../core/chain-configs" }
near-crypto = { path = "../../core/crypto" }
Expand All @@ -31,7 +30,7 @@ near-metrics = { path = "../../core/metrics" }
near-chain = { path = "../chain" }

[dev-dependencies]
tempdir = "0.3.7"
tempfile = "3"
bencher = "0.1.5"
num-rational = "0.2.4"

Expand Down
4 changes: 1 addition & 3 deletions chain/network/src/peer_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ impl PeerStore {

#[cfg(test)]
mod test {
use tempdir;

use near_crypto::{KeyType, SecretKey};
use near_store::create_store;
use near_store::test_utils::create_test_store;
Expand Down Expand Up @@ -396,7 +394,7 @@ mod test {

#[test]
fn ban_store() {
let tmp_dir = tempdir::TempDir::new("_test_store_ban").unwrap();
let tmp_dir = tempfile::Builder::new().prefix("_test_store_ban").tempdir().unwrap();
let peer_info_a = gen_peer_info(0);
let peer_info_to_ban = gen_peer_info(1);
let boot_nodes = vec![peer_info_a.clone(), peer_info_to_ban.clone()];
Expand Down
2 changes: 1 addition & 1 deletion chain/network/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use actix::{Actor, Addr, MailboxError, Message, Recipient};
use borsh::{BorshDeserialize, BorshSerialize};
use chrono::{DateTime, Utc};
use futures::{future::BoxFuture, FutureExt};
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
use tokio::net::TcpStream;
use tracing::{error, warn};

Expand Down
5 changes: 3 additions & 2 deletions chain/pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2018"

[dependencies]
near-crypto = { path = "../../core/crypto" }
near-primitives = { path = "../../core/primitives" }
rand = "0.7"
borsh = "0.6.1"

near-crypto = { path = "../../core/crypto" }
near-primitives = { path = "../../core/primitives" }
9 changes: 4 additions & 5 deletions chain/telemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ edition = "2018"
[dependencies]
openssl = { version = "0.10", features = ["vendored"] }
openssl-probe = "0.1.2"
actix-web = { version = "2.0.0", features = [ "openssl" ] }
actix-web = { version = "2", features = [ "openssl" ] }
futures = "0.3"
actix = "0.9.0"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
actix = "0.9"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
tracing = "0.1.13"
2 changes: 1 addition & 1 deletion chain/telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::time::Duration;
use actix::{Actor, Addr, Context, Handler, Message};
use actix_web::client::{Client, Connector};
use futures::FutureExt;
use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};
use tracing::info;

/// Timeout for establishing connection.
Expand Down
4 changes: 2 additions & 2 deletions core/chain-configs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ edition = "2018"
[dependencies]
chrono = { version = "0.4.4", features = ["serde"] }
derive_more = "0.99.3"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
smart-default = "0.6"
num-rational = { version = "0.2.4", features = ["serde"] }

Expand Down
7 changes: 3 additions & 4 deletions core/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ digest = "0.8"
ed25519-dalek = "1.0.0-pre.3"
lazy_static = "1.4"
libc = "0.2"
parity-secp256k1 = "0.7.0"
parity-secp256k1 = "0.7"
rand = "0.7"
rand_core = "0.5"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
sha2 = "0.8"
subtle = "2.2"

Expand Down
2 changes: 1 addition & 1 deletion core/crypto/src/key_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::io::{Read, Write};
use std::os::unix::fs::PermissionsExt;
use std::path::Path;

use serde_derive::{Deserialize, Serialize};
use serde::{Deserialize, Serialize};

use crate::{PublicKey, SecretKey};

Expand Down
Loading

0 comments on commit 012de6a

Please sign in to comment.