Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): remove actix dependency from near-primitives #2511

Merged
merged 20 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a689073
fix: extract actix dependency from near-primitives
lexfrl Apr 21, 2020
130ebbc
fix near-env in state-viewer
lexfrl Apr 21, 2020
2dfc829
Merge branch 'master' into fckt/extract-actix-from-primitives
lexfrl Apr 21, 2020
8ce012b
fix test
lexfrl Apr 21, 2020
2da48ce
Merge branch 'fckt/extract-actix-from-primitives' of github.com:nearp…
lexfrl Apr 21, 2020
2537776
Merge branch 'master' into fckt/extract-actix-from-primitives
lexfrl Apr 21, 2020
fdf9633
dubstiuted near-env with near-actix-utils and near-logger-utils
lexfrl Apr 23, 2020
5fc843c
Merge branch 'fckt/extract-actix-from-primitives' of github.com:nearp…
lexfrl Apr 23, 2020
0382fbd
substituted near-env with near-actix-utils and near-logger-utils
lexfrl Apr 23, 2020
1f81e8c
remove Account::new and account_new function added
lexfrl Apr 28, 2020
c26ecc7
core/primitives/src/test_utils.rs ressurected
lexfrl Apr 28, 2020
b69d61d
move account_new to near_primitives::test_utils::account_new
lexfrl Apr 28, 2020
b45c5b9
Merge branch 'master' into fckt/extract-actix-from-primitives
lexfrl Apr 28, 2020
d964289
move account_new to near_primitives::test_utils::account_new
lexfrl Apr 28, 2020
04ca267
fix warning
lexfrl Apr 29, 2020
9309fd7
fix consensus.rs tests
lexfrl Apr 29, 2020
7490c84
Merge branch 'master' into fckt/extract-actix-from-primitives
frol Apr 29, 2020
27300d2
Merge refs/heads/master into fckt/extract-actix-from-primitives
nearprotocol-bulldozer[bot] Apr 29, 2020
b951c71
fix test_consensus_with_epoch_switches test
lexfrl Apr 29, 2020
61ec9f6
Merge branch 'fckt/extract-actix-from-primitives' of github.com:nearp…
lexfrl Apr 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ members = [
"core/runtime-configs",
"core/store",
"core/metrics",
"utils/actix",
lexfrl marked this conversation as resolved.
Show resolved Hide resolved
"runtime/runtime",
"runtime/near-runtime-fees",
"runtime/near-vm-logic",
Expand Down Expand Up @@ -47,6 +48,7 @@ serde_json = "1.0.0"
reqwest = "0.10"
futures = "0.3"

near-logger-utils = { path = "./test-utils/logger" }
lexfrl marked this conversation as resolved.
Show resolved Hide resolved
near-chain-configs = { path = "./core/chain-configs" }
near-crypto = { path = "./core/crypto" }
near-primitives = { path = "./core/primitives" }
Expand Down
1 change: 1 addition & 0 deletions chain/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ near-primitives = { path = "../../core/primitives" }
near-store = { path = "../../core/store" }
near-metrics = { path = "../../core/metrics" }
near-pool = { path = "../pool" }
near-logger-utils = {path = "../../test-utils/logger"}

[features]
# if enabled, we assert in most situations that are impossible unless some byzantine behavior is observed.
Expand Down
2 changes: 1 addition & 1 deletion chain/chain/tests/challenges.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use near_chain::test_utils::setup;
use near_chain::{Block, ErrorKind, Provenance};
use near_primitives::test_utils::init_test_logger;
use near_logger_utils::init_test_logger;

#[test]
fn challenges_new_head_prev() {
Expand Down
2 changes: 1 addition & 1 deletion chain/chain/tests/simple_chain.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use near_chain::test_utils::setup;
use near_chain::{Block, ChainStoreAccess, ErrorKind, Provenance};
use near_logger_utils::init_test_logger;
use near_primitives::hash::CryptoHash;
use near_primitives::test_utils::init_test_logger;
use num_rational::Rational;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion chain/chain/tests/sync_chain.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use near_chain::test_utils::setup;
use near_chain::Block;
use near_primitives::test_utils::init_test_logger;
use near_logger_utils::init_test_logger;

#[test]
fn chain_sync_headers() {
Expand Down
2 changes: 2 additions & 0 deletions chain/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ near-chunks = { path = "../chunks" }
near-telemetry = { path = "../telemetry" }

[dev-dependencies]
near-logger-utils = { path = "../../test-utils/logger" }
testlib = { path = "../../test-utils/testlib" }
neard = { path = "../../neard" }

[features]
Expand Down
2 changes: 1 addition & 1 deletion chain/client/tests/bug_repros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ use near_chain::test_utils::account_id_to_shard_id;
use near_client::test_utils::setup_mock_all_validators;
use near_client::{ClientActor, ViewClientActor};
use near_crypto::{InMemorySigner, KeyType};
use near_logger_utils::init_test_logger;
use near_network::types::NetworkRequests::PartialEncodedChunkMessage;
use near_network::{NetworkClientMessages, NetworkRequests, NetworkResponses, PeerInfo};
use near_primitives::block::Block;
use near_primitives::test_utils::init_test_logger;
use near_primitives::transaction::SignedTransaction;
use std::cmp::max;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion chain/client/tests/catching_up.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ mod tests {
use near_client::test_utils::setup_mock_all_validators;
use near_client::{ClientActor, Query, ViewClientActor};
use near_crypto::{InMemorySigner, KeyType};
use near_logger_utils::init_integration_logger;
use near_network::types::AccountOrPeerIdOrHash;
use near_network::{NetworkClientMessages, NetworkRequests, NetworkResponses, PeerInfo};
use near_primitives::hash::hash as hash_func;
use near_primitives::hash::CryptoHash;
use near_primitives::receipt::Receipt;
use near_primitives::sharding::ChunkHash;
use near_primitives::test_utils::init_integration_logger;
use near_primitives::transaction::SignedTransaction;
use near_primitives::types::{BlockHeight, BlockHeightDelta, BlockIdOrFinality};
use near_primitives::views::{QueryRequest, QueryResponseKind::ViewAccount};
Expand Down
2 changes: 1 addition & 1 deletion chain/client/tests/challenges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use near_chain_configs::Genesis;
use near_client::test_utils::TestEnv;
use near_client::Client;
use near_crypto::{InMemorySigner, KeyType, Signer};
use near_logger_utils::init_test_logger;
use near_network::test_utils::MockNetworkAdapter;
use near_network::NetworkRequests;
use near_primitives::challenge::{
Expand All @@ -25,7 +26,6 @@ use near_primitives::merkle::{merklize, MerklePath};
use near_primitives::receipt::Receipt;
use near_primitives::serialize::BaseDecode;
use near_primitives::sharding::{EncodedShardChunk, ReedSolomonWrapper};
use near_primitives::test_utils::init_test_logger;
use near_primitives::transaction::SignedTransaction;
use near_primitives::types::StateRoot;
use near_primitives::validator_signer::InMemoryValidatorSigner;
Expand Down
4 changes: 2 additions & 2 deletions chain/client/tests/chunks_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ use near_chain::ChainGenesis;
use near_client::test_utils::{setup_mock_all_validators, TestEnv};
use near_client::{ClientActor, GetBlock, ViewClientActor};
use near_crypto::KeyType;
use near_logger_utils::{init_integration_logger, init_test_logger};
use near_network::types::PartialEncodedChunkRequestMsg;
use near_network::{NetworkClientMessages, NetworkRequests, NetworkResponses, PeerInfo};
use near_primitives::block::BlockHeader;
use near_primitives::hash::{hash, CryptoHash};
use near_primitives::sharding::{PartialEncodedChunk, ShardChunkHeader};
use near_primitives::test_utils::init_integration_logger;
use near_primitives::test_utils::{heavy_test, init_test_logger};
use near_primitives::transaction::SignedTransaction;
use near_primitives::validator_signer::InMemoryValidatorSigner;
use testlib::test_helpers::heavy_test;

#[test]
fn chunks_produced_and_distributed_all_in_all_shards() {
Expand Down
4 changes: 2 additions & 2 deletions chain/client/tests/cross_shard_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use futures::{future, FutureExt};

use near_client::test_utils::setup_mock_all_validators;
use near_client::{ClientActor, Query, ViewClientActor};
use near_logger_utils::init_test_logger;
use near_network::{NetworkRequests, NetworkResponses, PeerInfo};
use near_primitives::test_utils::init_test_logger;
use near_primitives::types::BlockIdOrFinality;
use near_primitives::views::{QueryRequest, QueryResponseKind::ViewAccount};

Expand Down Expand Up @@ -87,11 +87,11 @@ mod tests {
use near_client::test_utils::setup_mock_all_validators;
use near_client::{ClientActor, Query, ViewClientActor};
use near_crypto::{InMemorySigner, KeyType};
use near_logger_utils::init_test_logger;
use near_network::{
NetworkClientMessages, NetworkClientResponses, NetworkRequests, NetworkResponses, PeerInfo,
};
use near_primitives::hash::CryptoHash;
use near_primitives::test_utils::init_test_logger;
use near_primitives::transaction::SignedTransaction;
use near_primitives::types::{AccountId, BlockIdOrFinality};
use near_primitives::views::{QueryRequest, QueryResponse, QueryResponseKind::ViewAccount};
Expand Down
2 changes: 1 addition & 1 deletion chain/client/tests/process_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use near_client::test_utils::setup_mock_all_validators;
use near_client::test_utils::{setup_client, setup_mock, TestEnv};
use near_client::{Client, GetBlock};
use near_crypto::{InMemorySigner, KeyType, Signature, Signer};
use near_logger_utils::init_test_logger;
#[cfg(feature = "metric_recorder")]
use near_network::recorder::MetricRecorder;
use near_network::routing::EdgeInfo;
Expand All @@ -27,7 +28,6 @@ use near_primitives::errors::InvalidTxError;
use near_primitives::hash::{hash, CryptoHash};
use near_primitives::merkle::merklize;
use near_primitives::sharding::{EncodedShardChunk, ReedSolomonWrapper};
use near_primitives::test_utils::init_test_logger;
use near_primitives::transaction::{SignedTransaction, Transaction};
use near_primitives::types::{BlockHeight, EpochId, MerkleHash, NumBlocks};
use near_primitives::utils::to_timestamp;
Expand Down
2 changes: 1 addition & 1 deletion chain/client/tests/query_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use futures::{future, FutureExt};

use near_client::test_utils::setup_no_network;
use near_client::Query;
use near_primitives::test_utils::init_test_logger;
use near_logger_utils::init_test_logger;
use near_primitives::types::BlockIdOrFinality;
use near_primitives::views::{QueryRequest, QueryResponseKind};

Expand Down
1 change: 1 addition & 0 deletions chain/jsonrpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ borsh = "0.6.1"

near-chain-configs = { path = "../../core/chain-configs" }
near-crypto = { path = "../../core/crypto" }
near-logger-utils = { path = "../../test-utils/logger" }
near-primitives = { path = "../../core/primitives" }
near-store = { path = "../../core/store" }
near-metrics = { path = "../../core/metrics" }
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 @@ -2,7 +2,7 @@ use actix::System;
use futures::{future, FutureExt};

use near_jsonrpc::client::new_http_client;
use near_primitives::test_utils::init_test_logger;
use near_logger_utils::init_test_logger;

mod test_utils;

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 @@ -7,11 +7,11 @@ use near_chain_configs::PROTOCOL_VERSION;
use near_crypto::{KeyType, PublicKey, Signature};
use near_jsonrpc::client::new_client;
use near_jsonrpc_client::ChunkId;
use near_logger_utils::init_test_logger;
use near_network::test_utils::WaitOrTimeout;
use near_primitives::account::{AccessKey, AccessKeyPermission};
use near_primitives::hash::CryptoHash;
use near_primitives::rpc::{RpcGenesisRecordsRequest, RpcPagination, RpcQueryRequest};
use near_primitives::test_utils::init_test_logger;
use near_primitives::types::{BlockId, BlockIdOrFinality, Finality, ShardId};
use near_primitives::views::{QueryRequest, QueryResponseKind};

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 @@ -6,10 +6,10 @@ use futures::{future, FutureExt, TryFutureExt};

use near_crypto::{InMemorySigner, KeyType};
use near_jsonrpc::client::new_client;
use near_logger_utils::{init_integration_logger, init_test_logger};
use near_network::test_utils::WaitOrTimeout;
use near_primitives::hash::{hash, CryptoHash};
use near_primitives::serialize::{to_base, to_base64};
use near_primitives::test_utils::{init_integration_logger, init_test_logger};
use near_primitives::transaction::SignedTransaction;
use near_primitives::types::BlockIdOrFinality;
use near_primitives::views::FinalExecutionStatus;
Expand Down
1 change: 1 addition & 0 deletions chain/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ near-metrics = { path = "../../core/metrics" }
near-chain = { path = "../chain" }

[dev-dependencies]
near-logger-utils = {path = "../../test-utils/logger"}
tempdir = "0.3.7"
bencher = "0.1.5"
num-rational = "0.2.4"
Expand Down
2 changes: 1 addition & 1 deletion chain/network/tests/infinite_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ use actix::{Actor, System};
use futures::{future, FutureExt};

use near_client::ClientActor;
use near_logger_utils::init_integration_logger;
use near_network::test_utils::{convert_boot_nodes, open_port, GetInfo, WaitOrTimeout};
use near_network::types::{NetworkViewClientMessages, NetworkViewClientResponses, SyncData};
use near_network::{NetworkClientResponses, NetworkConfig, NetworkRequests, PeerManagerActor};
use near_primitives::block::GenesisId;
use near_primitives::network::{AnnounceAccount, PeerId};
use near_primitives::test_utils::init_integration_logger;
use near_store::test_utils::create_test_store;

/// Make Peer Manager with mocked client ready to accept any announce account.
Expand Down
2 changes: 1 addition & 1 deletion chain/network/tests/peer_handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use actix::System;
use futures::{future, FutureExt};

use near_client::{ClientActor, ViewClientActor};
use near_logger_utils::init_test_logger;
use near_network::test_utils::{convert_boot_nodes, open_port, GetInfo, StopSignal, WaitOrTimeout};
use near_network::types::{NetworkViewClientMessages, NetworkViewClientResponses};
use near_network::{NetworkClientResponses, NetworkConfig, PeerManagerActor};
use near_primitives::test_utils::init_test_logger;
use near_store::test_utils::create_test_store;

type ClientMock = Mocker<ClientActor>;
Expand Down
2 changes: 1 addition & 1 deletion chain/network/tests/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use near_chain::ChainGenesis;
use near_chain_configs::ClientConfig;
use near_client::{ClientActor, ViewClientActor};
use near_crypto::KeyType;
use near_logger_utils::init_test_logger;
use near_network::test_utils::{
convert_boot_nodes, expected_routing_tables, open_port, peer_id_from_seed, BanPeerSignal,
GetInfo, StopSignal, WaitOrTimeout,
Expand All @@ -22,7 +23,6 @@ use near_network::utils::blacklist_from_vec;
use near_network::{
NetworkConfig, NetworkRecipient, NetworkRequests, NetworkResponses, PeerInfo, PeerManagerActor,
};
use near_primitives::test_utils::init_test_logger;
use near_primitives::types::{AccountId, ValidatorId};
use near_primitives::validator_signer::InMemoryValidatorSigner;
use near_store::test_utils::create_test_store;
Expand Down
2 changes: 1 addition & 1 deletion chain/network/tests/stress_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use futures::FutureExt;
use tracing::info;

use near_client::{ClientActor, ViewClientActor};
use near_logger_utils::init_test_logger_allow_panic;
use near_network::test_utils::{convert_boot_nodes, open_port, GetInfo, StopSignal, WaitOrTimeout};
use near_network::types::{NetworkViewClientMessages, NetworkViewClientResponses};
use near_network::{NetworkClientResponses, NetworkConfig, PeerManagerActor};
use near_primitives::test_utils::init_test_logger_allow_panic;
use near_store::test_utils::create_test_store;

type ClientMock = Mocker<ClientActor>;
Expand Down
2 changes: 0 additions & 2 deletions core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jemallocator = { version = "0.3.0", optional = true }
actix = "0.9.0"
hex = "0.4"
num-rational = "0.2.4"
tracing = "0.1.13"
tracing-subscriber = "0.2.4"

borsh = "0.6.1"

Expand Down
Loading