Disable two tests that will require an improved TestBlockChainClient

This commit is contained in:
Gav Wood 2016-03-25 16:41:01 +01:00
parent c99a486826
commit b45ed30936

View File

@ -328,9 +328,11 @@ mod tests {
use MinerService; use MinerService;
use super::{Miner}; use super::{Miner};
use util::*;
use ethcore::client::{TestBlockChainClient, EachBlockWith}; use ethcore::client::{TestBlockChainClient, EachBlockWith};
use ethcore::block::*;
// TODO [ToDr] To uncomment client is cleaned from mining stuff. // TODO [ToDr] To uncomment when TestBlockChainClient can actually return a ClosedBlock.
#[ignore] #[ignore]
#[test] #[test]
fn should_prepare_block_to_seal() { fn should_prepare_block_to_seal() {
@ -339,25 +341,29 @@ mod tests {
let miner = Miner::default(); let miner = Miner::default();
// when // when
let res = miner.would_seal(&client); let sealing_work = miner.map_sealing_work(&client, |_| ());
assert!(sealing_work.is_some(), "Expected closed block");
// then
assert!(res.lock().unwrap().is_some(), "Expected closed block");
} }
#[ignore]
#[test] #[test]
fn should_reset_seal_after_couple_of_blocks() { fn should_still_work_after_a_couple_of_blocks() {
// given // given
let client = TestBlockChainClient::default(); let client = TestBlockChainClient::default();
let miner = Miner::default(); let miner = Miner::default();
let res = miner.would_seal(&client);
// TODO [ToDr] Uncomment after fixing TestBlockChainClient
// assert!(res.lock().unwrap().is_some(), "Expected closed block");
// when let res = miner.map_sealing_work(&client, |b| b.block().fields().header.hash());
client.add_blocks(10, EachBlockWith::Uncle); assert!(res.is_some());
assert!(miner.submit_seal(&client, res.unwrap(), vec![]).is_ok());
// then // two more blocks mined, work requested.
assert!(res.lock().unwrap().is_none(), "Expected to remove sealed block"); client.add_blocks(1, EachBlockWith::Uncle);
miner.map_sealing_work(&client, |b| b.block().fields().header.hash());
client.add_blocks(1, EachBlockWith::Uncle);
miner.map_sealing_work(&client, |b| b.block().fields().header.hash());
// solution to original work submitted.
assert!(miner.submit_seal(&client, res.unwrap(), vec![]).is_ok());
} }
} }