cleanup...
This commit is contained in:
parent
9cbf2427c0
commit
98ae8ce36a
@ -398,7 +398,6 @@ impl<'a> Ext for Externalities<'a> {
|
|||||||
Ok(gas_left) => (gas_left, Some(address)),
|
Ok(gas_left) => (gas_left, Some(address)),
|
||||||
_ => (U256::zero(), None)
|
_ => (U256::zero(), None)
|
||||||
}
|
}
|
||||||
//ex.create(¶ms, self.substate).map(|gas_left| (gas_left, Some(address)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn call(&mut self,
|
fn call(&mut self,
|
||||||
@ -426,15 +425,12 @@ impl<'a> Ext for Externalities<'a> {
|
|||||||
if gas_cost > *gas {
|
if gas_cost > *gas {
|
||||||
self.substate.out_of_gas = true;
|
self.substate.out_of_gas = true;
|
||||||
return Err(evm::Error::OutOfGas);
|
return Err(evm::Error::OutOfGas);
|
||||||
//return (U256::from(-1i64 as u64), false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let gas = *gas - gas_cost;
|
let gas = *gas - gas_cost;
|
||||||
|
|
||||||
// if balance is insufficient or we are to deep, return
|
// if balance is insufficient or we are to deep, return
|
||||||
if self.state.balance(&self.params.address) < *value || self.depth >= self.schedule.max_depth {
|
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));
|
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);
|
let mut ex = Executive::from_parent(self.state, self.info, self.engine, self.depth);
|
||||||
match ex.call(¶ms, self.substate, BytesRef::Fixed(output)) {
|
match ex.call(¶ms, self.substate, BytesRef::Fixed(output)) {
|
||||||
Ok(gas_left) => Ok((gas + gas_left, true)), //Some(CallResult::new(gas + gas_left, true)),
|
Ok(gas_left) => Ok((gas + gas_left, true)), //Some(CallResult::new(gas + gas_left, true)),
|
||||||
_ => {
|
_ => Ok((gas, false))
|
||||||
self.substate.out_of_gas = true;
|
|
||||||
Ok((gas, false))
|
|
||||||
//Some(CallResult::new(gas, false))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//ex.call(¶ms, self.substate, BytesRef::Fixed(output)).map(|gas_left| gas + gas_left)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn extcode(&self, address: &Address) -> Vec<u8> {
|
fn extcode(&self, address: &Address) -> Vec<u8> {
|
||||||
|
Loading…
Reference in New Issue
Block a user