Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier committed Aug 4, 2016
1 parent d36d5a8 commit d48e262
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion ethcore/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,14 @@ mod tests {
#[test]
fn it_can_be_started() {
let temp_path = RandomTempPath::new();
let mut path = temp_path.as_path().to_owned();
path.push("pruning");
path.push("db");

let service = ClientService::start(
ClientConfig::default(),
get_test_spec(),
temp_path.as_path(),
&path,
Arc::new(Miner::with_spec(get_test_spec())),
);
assert!(service.is_ok());
Expand Down
2 changes: 1 addition & 1 deletion ethcore/src/snapshot/tests/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fn chunk_and_restore(amount: u64) {
// restore it.
let new_db = Arc::new(Database::open(&db_cfg, new_path.as_str()).unwrap());
let new_chain = BlockChain::new(Default::default(), &genesis, new_db.clone());
let mut rebuilder = BlockRebuilder::new(new_chain).unwrap();
let mut rebuilder = BlockRebuilder::new(new_chain, amount).unwrap();
let reader = PackedReader::new(&snapshot_path).unwrap().unwrap();
let engine = ::engines::NullEngine::new(Default::default(), Default::default());
for chunk_hash in &reader.manifest().block_hashes {
Expand Down
6 changes: 3 additions & 3 deletions ethcore/src/snapshot/tests/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl StateProducer {
let mut trie = TrieDBMut::from_existing(db, &mut self.state_root).unwrap();

for (address_hash, account_data) in accounts_to_modify {
trie.insert(&address_hash[..], &account_data);
trie.insert(&address_hash[..], &account_data).unwrap();
}

// add between 0 and 5 new accounts each tick.
Expand All @@ -80,7 +80,7 @@ impl StateProducer {
let balance: usize = rng.gen();
let nonce: usize = rng.gen();
let acc = ::account::Account::new_basic(balance.into(), nonce.into()).rlp();
trie.insert(&address_hash[..], &acc);
trie.insert(&address_hash[..], &acc).unwrap();
}
}

Expand All @@ -107,7 +107,7 @@ pub fn fill_storage(mut db: AccountDBMut, root: &mut H256, seed: &mut H256) {
};

for (k, v) in map.make_with(seed) {
trie.insert(&k, &v);
trie.insert(&k, &v).unwrap();
}
}
}
Expand Down

0 comments on commit d48e262

Please sign in to comment.