cleanup...

This commit is contained in:
debris 2016-01-14 21:47:52 +01:00
parent 9cbf2427c0
commit 98ae8ce36a

View File

@ -398,7 +398,6 @@ impl<'a> Ext for Externalities<'a> {
Ok(gas_left) => (gas_left, Some(address)),
_ => (U256::zero(), None)
}
//ex.create(&params, self.substate).map(|gas_left| (gas_left, Some(address)))
}
fn call(&mut self,
@ -426,15 +425,12 @@ impl<'a> Ext for Externalities<'a> {
if gas_cost > *gas {
self.substate.out_of_gas = true;
return Err(evm::Error::OutOfGas);
//return (U256::from(-1i64 as u64), false);
}
let gas = *gas - gas_cost;
// if balance is insufficient or we are to deep, return
if self.state.balance(&self.params.address) < *value || self.depth >= self.schedule.max_depth {
//return Some(CallResult::new(gas + call_gas, true));
//return (gas + call_gas, true);
return Ok((gas + call_gas, true));
}
@ -452,13 +448,8 @@ impl<'a> Ext for Externalities<'a> {
let mut ex = Executive::from_parent(self.state, self.info, self.engine, self.depth);
match ex.call(&params, self.substate, BytesRef::Fixed(output)) {
Ok(gas_left) => Ok((gas + gas_left, true)), //Some(CallResult::new(gas + gas_left, true)),
_ => {
self.substate.out_of_gas = true;
Ok((gas, false))
//Some(CallResult::new(gas, false))
}
_ => Ok((gas, false))
}
//ex.call(&params, self.substate, BytesRef::Fixed(output)).map(|gas_left| gas + gas_left)
}
fn extcode(&self, address: &Address) -> Vec<u8> {