Fix Determination of state roots.

This commit is contained in:
Gav Wood
2016-01-14 02:09:43 +01:00
parent 035b29c481
commit 59e2df3e40
2 changed files with 12 additions and 7 deletions

View File

@@ -50,14 +50,19 @@ fn do_json_test(json_data: &[u8]) -> Vec<String> {
//println!("Transaction: {:?}", t);
//println!("Env: {:?}", env);
{
let mut s = State::new_temp();
s.populate_from(post.clone());
s.commit();
assert_eq!(&post_state_root, s.root());
}
let mut s = State::new_temp();
s.populate_from(pre);
let e = Executive::new(&mut s, &env, engine.deref()).transact(&t).unwrap();
println!("executed: {:?}", e);
s.apply(&env, engine.deref(), &t).unwrap();
let our_post = s.to_pod_map();
s.commit();
if fail_unless(s.root() == &post_state_root) {
println!("FAILED {}. Diff:\n{}", name, pod_map_diff(&post, &our_post));
}