fixed tests compilation

This commit is contained in:
Svyatoslav Nikolsky 2016-11-15 14:17:39 +03:00
parent b152c8178d
commit 3897a9e419
3 changed files with 9 additions and 7 deletions

View File

@ -26,12 +26,13 @@ impl ConsensusParams {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::{Magic, ConsensusParams}; use super::super::Magic;
use super::ConsensusParams;
#[test] #[test]
fn test_consensus_params_bip65_height() { fn test_consensus_params_bip65_height() {
assert_eq!(ConsensusParams::with_magic(Magic::Mainnet), 388381); assert_eq!(ConsensusParams::with_magic(Magic::Mainnet).bip65_height, 388381);
assert_eq!(ConsensusParams::with_magic(Magic::Testnet), 581885); assert_eq!(ConsensusParams::with_magic(Magic::Testnet).bip65_height, 581885);
assert_eq!(ConsensusParams::with_magic(Magic::Regtest), 1351); assert_eq!(ConsensusParams::with_magic(Magic::Regtest).bip65_height, 1351);
} }
} }

View File

@ -215,7 +215,7 @@ mod tests {
use synchronization_chain::Chain; use synchronization_chain::Chain;
use p2p::{event_loop, OutboundSyncConnection, OutboundSyncConnectionRef}; use p2p::{event_loop, OutboundSyncConnection, OutboundSyncConnectionRef};
use message::types; use message::types;
use message::common::{InventoryVector, InventoryType}; use message::common::{Magic, ConsensusParams, InventoryVector, InventoryType};
use db; use db;
use super::LocalNode; use super::LocalNode;
use test_data; 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 chain = Arc::new(RwLock::new(Chain::new(Arc::new(db::TestStorage::with_genesis_block()))));
let executor = DummyTaskExecutor::new(); let executor = DummyTaskExecutor::new();
let server = Arc::new(DummyServer::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 client = SynchronizationClient::new(config, &handle, executor.clone(), chain);
let local_node = LocalNode::new(server.clone(), client, executor.clone()); let local_node = LocalNode::new(server.clone(), client, executor.clone());
(event_loop, handle, executor, server, local_node) (event_loop, handle, executor, server, local_node)

View File

@ -962,6 +962,7 @@ pub mod tests {
use parking_lot::{Mutex, RwLock}; use parking_lot::{Mutex, RwLock};
use tokio_core::reactor::{Core, Handle}; use tokio_core::reactor::{Core, Handle};
use chain::{Block, RepresentH256}; use chain::{Block, RepresentH256};
use message::common::{Magic, ConsensusParams};
use super::{Client, Config, SynchronizationClient}; use super::{Client, Config, SynchronizationClient};
use synchronization_executor::Task; use synchronization_executor::Task;
use synchronization_chain::{Chain, ChainRef}; use synchronization_chain::{Chain, ChainRef};
@ -985,7 +986,7 @@ pub mod tests {
}; };
let chain = ChainRef::new(RwLock::new(Chain::new(storage.clone()))); let chain = ChainRef::new(RwLock::new(Chain::new(storage.clone())));
let executor = DummyTaskExecutor::new(); 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()); let client = SynchronizationClient::new(config, &handle, executor.clone(), chain.clone());
(event_loop, handle, executor, chain, client) (event_loop, handle, executor, chain, client)