From 3897a9e419b5ee89c7b9faf6e6afbc6beb43d7f6 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Tue, 15 Nov 2016 14:17:39 +0300 Subject: [PATCH] fixed tests compilation --- message/src/common/consensus.rs | 9 +++++---- sync/src/local_node.rs | 4 ++-- sync/src/synchronization_client.rs | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/message/src/common/consensus.rs b/message/src/common/consensus.rs index fd10bdda..c92c14de 100644 --- a/message/src/common/consensus.rs +++ b/message/src/common/consensus.rs @@ -26,12 +26,13 @@ impl ConsensusParams { #[cfg(test)] mod tests { - use super::{Magic, ConsensusParams}; + use super::super::Magic; + use super::ConsensusParams; #[test] fn test_consensus_params_bip65_height() { - assert_eq!(ConsensusParams::with_magic(Magic::Mainnet), 388381); - assert_eq!(ConsensusParams::with_magic(Magic::Testnet), 581885); - assert_eq!(ConsensusParams::with_magic(Magic::Regtest), 1351); + assert_eq!(ConsensusParams::with_magic(Magic::Mainnet).bip65_height, 388381); + assert_eq!(ConsensusParams::with_magic(Magic::Testnet).bip65_height, 581885); + assert_eq!(ConsensusParams::with_magic(Magic::Regtest).bip65_height, 1351); } } diff --git a/sync/src/local_node.rs b/sync/src/local_node.rs index 6e5ef35c..b30adc96 100644 --- a/sync/src/local_node.rs +++ b/sync/src/local_node.rs @@ -215,7 +215,7 @@ mod tests { use synchronization_chain::Chain; use p2p::{event_loop, OutboundSyncConnection, OutboundSyncConnectionRef}; use message::types; - use message::common::{InventoryVector, InventoryType}; + use message::common::{Magic, ConsensusParams, InventoryVector, InventoryType}; use db; use super::LocalNode; use test_data; @@ -259,7 +259,7 @@ mod tests { let chain = Arc::new(RwLock::new(Chain::new(Arc::new(db::TestStorage::with_genesis_block())))); let executor = DummyTaskExecutor::new(); let server = Arc::new(DummyServer::new()); - let config = Config { threads_num: 1, skip_verification: true }; + let config = Config { consensus_params: ConsensusParams::with_magic(Magic::Mainnet), threads_num: 1, skip_verification: true }; let client = SynchronizationClient::new(config, &handle, executor.clone(), chain); let local_node = LocalNode::new(server.clone(), client, executor.clone()); (event_loop, handle, executor, server, local_node) diff --git a/sync/src/synchronization_client.rs b/sync/src/synchronization_client.rs index eb7ef612..013fe443 100644 --- a/sync/src/synchronization_client.rs +++ b/sync/src/synchronization_client.rs @@ -962,6 +962,7 @@ pub mod tests { use parking_lot::{Mutex, RwLock}; use tokio_core::reactor::{Core, Handle}; use chain::{Block, RepresentH256}; + use message::common::{Magic, ConsensusParams}; use super::{Client, Config, SynchronizationClient}; use synchronization_executor::Task; use synchronization_chain::{Chain, ChainRef}; @@ -985,7 +986,7 @@ pub mod tests { }; let chain = ChainRef::new(RwLock::new(Chain::new(storage.clone()))); let executor = DummyTaskExecutor::new(); - let config = Config { threads_num: 1, skip_verification: true }; + let config = Config { consensus_params: ConsensusParams::with_magic(Magic::Mainnet), threads_num: 1, skip_verification: true }; let client = SynchronizationClient::new(config, &handle, executor.clone(), chain.clone()); (event_loop, handle, executor, chain, client)