state logs tests passing
This commit is contained in:
parent
c24883efc8
commit
a97a4a9bc4
@ -39,6 +39,14 @@ impl Substate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn accrue(&mut self, s: Substate) {
|
||||||
|
self.suicides.extend(s.suicides.into_iter());
|
||||||
|
self.logs.extend(s.logs.into_iter());
|
||||||
|
self.refunds_count = self.refunds_count + s.refunds_count;
|
||||||
|
self.out_of_gas |= s.out_of_gas;
|
||||||
|
self.contracts_created.extend(s.contracts_created.into_iter());
|
||||||
|
}
|
||||||
|
|
||||||
pub fn out_of_gas(&self) -> bool { self.out_of_gas }
|
pub fn out_of_gas(&self) -> bool { self.out_of_gas }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,8 +417,12 @@ impl<'a> Ext for Externalities<'a> {
|
|||||||
|
|
||||||
let mut ex = Executive::from_parent(self.state, self.info, self.engine, self.depth);
|
let mut ex = Executive::from_parent(self.state, self.info, self.engine, self.depth);
|
||||||
ex.state.inc_nonce(&self.params.address);
|
ex.state.inc_nonce(&self.params.address);
|
||||||
match ex.create(¶ms, self.substate) {
|
let mut substate = Substate::new();
|
||||||
Ok(gas_left) => (gas_left, Some(address)),
|
match ex.create(¶ms, &mut substate) {
|
||||||
|
Ok(gas_left) => {
|
||||||
|
self.substate.accrue(substate);
|
||||||
|
(gas_left, Some(address))
|
||||||
|
},
|
||||||
_ => (U256::zero(), None)
|
_ => (U256::zero(), None)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -460,8 +472,12 @@ impl<'a> Ext for Externalities<'a> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut ex = Executive::from_parent(self.state, self.info, self.engine, self.depth);
|
let mut ex = Executive::from_parent(self.state, self.info, self.engine, self.depth);
|
||||||
match ex.call(¶ms, self.substate, BytesRef::Fixed(output)) {
|
let mut substate = Substate::new();
|
||||||
Ok(gas_left) => Ok((gas + gas_left, true)), //Some(CallResult::new(gas + gas_left, true)),
|
match ex.call(¶ms, &mut substate, BytesRef::Fixed(output)) {
|
||||||
|
Ok(gas_left) => {
|
||||||
|
self.substate.accrue(substate);
|
||||||
|
Ok((gas + gas_left, true))
|
||||||
|
},
|
||||||
_ => Ok((gas, false))
|
_ => Ok((gas, false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user