Fix JSONRPC test utils.
This commit is contained in:
parent
66837452c2
commit
152f132b7b
@ -227,19 +227,21 @@ fn do_json_test_for(vm: &VMType, json_data: &[u8]) -> Vec<String> {
|
||||
let out_of_gas = test.find("callcreates").map(|_calls| {
|
||||
}).is_none();
|
||||
|
||||
let mut substate = Substate::new();
|
||||
let mut substate = Substate::new(false);
|
||||
let mut output = vec![];
|
||||
|
||||
// execute
|
||||
let (res, callcreates) = {
|
||||
let mut ex = TestExt::new(&mut state,
|
||||
&info,
|
||||
&engine,
|
||||
0,
|
||||
OriginInfo::from(¶ms),
|
||||
&mut substate,
|
||||
OutputPolicy::Return(BytesRef::Flexible(&mut output)),
|
||||
params.address.clone());
|
||||
let mut ex = TestExt::new(
|
||||
&mut state,
|
||||
&info,
|
||||
&engine,
|
||||
0,
|
||||
OriginInfo::from(¶ms),
|
||||
&mut substate,
|
||||
OutputPolicy::Return(BytesRef::Flexible(&mut output)),
|
||||
params.address.clone()
|
||||
);
|
||||
let evm = engine.vm_factory().create();
|
||||
let res = evm.exec(params, &mut ex);
|
||||
(res, ex.callcreates)
|
||||
|
@ -69,7 +69,7 @@ pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
|
||||
let mut state = state_result.reference_mut();
|
||||
state.populate_from(pre);
|
||||
state.commit();
|
||||
let res = state.apply(&env, engine.deref(), &t);
|
||||
let res = state.apply(&env, engine.deref(), &t, false);
|
||||
|
||||
if fail_unless(state.root() == &post_state_root) {
|
||||
println!("!!! {}: State mismatch (got: {}, expect: {}):", name, state.root(), post_state_root);
|
||||
@ -80,9 +80,9 @@ pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
|
||||
}
|
||||
|
||||
if let Ok(r) = res {
|
||||
if fail_unless(logs == r.logs) {
|
||||
if fail_unless(logs == r.receipt.logs) {
|
||||
println!("!!! {}: Logs mismatch:", name);
|
||||
println!("Got:\n{:?}", r.logs);
|
||||
println!("Got:\n{:?}", r.receipt.logs);
|
||||
println!("Expect:\n{:?}", logs);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user