fixed failing tests

This commit is contained in:
debris 2016-04-08 11:48:37 +02:00
parent 64294853cc
commit fcf7f392f0
2 changed files with 12 additions and 9 deletions

View File

@ -305,7 +305,7 @@ impl<'a> Executive<'a> {
// otherwise it's just a basic transaction, only do tracing, if necessary. // otherwise it's just a basic transaction, only do tracing, if necessary.
self.state.clear_snapshot(); self.state.clear_snapshot();
tracer.trace_call(trace_info, U256::zero(), Some(vec![]), self.depth, vec![], delegate_call); tracer.trace_call(trace_info, U256::zero(), trace_output, self.depth, vec![], delegate_call);
Ok(params.gas) Ok(params.gas)
} }
} }

View File

@ -76,13 +76,13 @@ impl From<ethjson::vm::Call> for CallCreate {
/// Tiny wrapper around executive externalities. /// Tiny wrapper around executive externalities.
/// Stores callcreates. /// Stores callcreates.
struct TestExt<'a> { struct TestExt<'a, T> where T: 'a + Tracer {
ext: Externalities<'a>, ext: Externalities<'a, T>,
callcreates: Vec<CallCreate>, callcreates: Vec<CallCreate>,
contract_address: Address contract_address: Address
} }
impl<'a> TestExt<'a> { impl<'a, T> TestExt<'a, T> where T: 'a + Tracer {
fn new(state: &'a mut State, fn new(state: &'a mut State,
info: &'a EnvInfo, info: &'a EnvInfo,
engine: &'a Engine, engine: &'a Engine,
@ -90,16 +90,17 @@ impl<'a> TestExt<'a> {
origin_info: OriginInfo, origin_info: OriginInfo,
substate: &'a mut Substate, substate: &'a mut Substate,
output: OutputPolicy<'a, 'a>, output: OutputPolicy<'a, 'a>,
address: Address) -> Self { address: Address,
tracer: &'a mut T) -> Self {
TestExt { TestExt {
contract_address: contract_address(&address, &state.nonce(&address)), contract_address: contract_address(&address, &state.nonce(&address)),
ext: Externalities::new(state, info, engine, depth, origin_info, substate, output), ext: Externalities::new(state, info, engine, depth, origin_info, substate, output, tracer),
callcreates: vec![] callcreates: vec![]
} }
} }
} }
impl<'a> Ext for TestExt<'a> { impl<'a, T> Ext for TestExt<'a, T> where T: Tracer {
fn storage_at(&self, key: &H256) -> H256 { fn storage_at(&self, key: &H256) -> H256 {
self.ext.storage_at(key) self.ext.storage_at(key)
} }
@ -209,7 +210,8 @@ fn do_json_test_for(vm_type: &VMType, json_data: &[u8]) -> Vec<String> {
let engine = TestEngineFrontier::new(1, vm_type.clone()); let engine = TestEngineFrontier::new(1, vm_type.clone());
let params = ActionParams::from(vm.transaction); let params = ActionParams::from(vm.transaction);
let mut substate = Substate::new(false); let mut substate = Substate::new();
let mut tracer = NoopTracer;
let mut output = vec![]; let mut output = vec![];
// execute // execute
@ -222,7 +224,8 @@ fn do_json_test_for(vm_type: &VMType, json_data: &[u8]) -> Vec<String> {
OriginInfo::from(&params), OriginInfo::from(&params),
&mut substate, &mut substate,
OutputPolicy::Return(BytesRef::Flexible(&mut output), None), OutputPolicy::Return(BytesRef::Flexible(&mut output), None),
params.address.clone() params.address.clone(),
&mut tracer,
); );
let evm = engine.vm_factory().create(); let evm = engine.vm_factory().create();
let res = evm.exec(params, &mut ex); let res = evm.exec(params, &mut ex);