fixes for review issues
This commit is contained in:
parent
daccbed9a1
commit
7ace87e50f
@ -21,7 +21,7 @@ pub struct Substate {
|
|||||||
logs: Vec<LogEntry>,
|
logs: Vec<LogEntry>,
|
||||||
/// Refund counter of SSTORE nonzero->zero.
|
/// Refund counter of SSTORE nonzero->zero.
|
||||||
refunds_count: U256,
|
refunds_count: U256,
|
||||||
/// True if transaction, or one of it's subcalls runs out of gas.
|
/// True if transaction, or one of its subcalls runs out of gas.
|
||||||
out_of_gas: bool,
|
out_of_gas: bool,
|
||||||
/// Created contracts.
|
/// Created contracts.
|
||||||
contracts_created: Vec<Address>
|
contracts_created: Vec<Address>
|
||||||
@ -293,10 +293,17 @@ impl<'a> Executive<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn revert_if_needed(&mut self, result: &evm::Result, substate: &mut Substate, backup: State) {
|
fn revert_if_needed(&mut self, result: &evm::Result, substate: &mut Substate, backup: State) {
|
||||||
if let &Err(evm::Error::OutOfGas) = result {
|
// TODO: handle other evm::Errors same as OutOfGas once they are implemented
|
||||||
|
match &result {
|
||||||
|
&Err(evm::Error::OutOfGas) => {
|
||||||
substate.out_of_gas = true;
|
substate.out_of_gas = true;
|
||||||
self.state.revert(backup);
|
self.state.revert(backup);
|
||||||
|
},
|
||||||
|
&Err(evm::Error::Internal) => (),
|
||||||
|
&Ok(_) => ()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user