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

test: skip verification in sync testing code #253

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions sync/src/synchronizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,9 @@ mod tests {
let shared = builder.build();

let notify = notify.unwrap_or_else(|| NotifyService::default().start::<&str>(None));
let chain_service = ChainBuilder::new(shared.clone(), notify.clone()).build();
let chain_service = ChainBuilder::new(shared.clone(), notify.clone())
.verification(false)
.build();
let chain_controller = chain_service.start::<&str>(None);

(chain_controller, shared, notify)
Expand Down Expand Up @@ -995,18 +997,16 @@ mod tests {
chain_controller1
.process_block(Arc::new(new_block.clone()))
.expect("process block ok");
blocks.push(new_block.clone());
parent = new_block.header().clone();
blocks.push(new_block);
}

let synchronizer = gen_synchronizer(chain_controller2.clone(), shared2.clone());

blocks.clone().into_iter().for_each(|block| {
let chain1_last_block = blocks.last().cloned().unwrap();
blocks.into_iter().for_each(|block| {
synchronizer.insert_new_block(peer, block);
});

assert_eq!(
blocks.last().unwrap().header(),
chain1_last_block.header(),
shared2.chain_state().read().tip_header()
);
}
Expand Down
4 changes: 3 additions & 1 deletion sync/src/tests/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ fn setup_node(
TransactionPoolService::new(PoolConfig::default(), shared.clone(), notify.clone());
let tx_pool_controller = tx_pool_service.start(Some(thread_name));

let chain_service = ChainBuilder::new(shared.clone(), notify).build();
let chain_service = ChainBuilder::new(shared.clone(), notify)
.verification(false)
.build();
let chain_controller = chain_service.start::<&str>(None);

for _i in 0..height {
Expand Down
4 changes: 3 additions & 1 deletion sync/src/tests/synchronizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ fn setup_node(
.build();
let notify = NotifyService::default().start(Some(thread_name));

let chain_service = ChainBuilder::new(shared.clone(), notify).build();
let chain_service = ChainBuilder::new(shared.clone(), notify)
.verification(false)
.build();
let chain_controller = chain_service.start::<&str>(None);

for _i in 0..height {
Expand Down