fixed tests compilation
This commit is contained in:
parent
b152c8178d
commit
3897a9e419
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue