Skip to content

Commit

Permalink
Reset selfdestruct on revert
Browse files Browse the repository at this point in the history
Fixes test TouchToEmptyAccountRevert3 on Constantinople
  • Loading branch information
mattdean-digicatapult committed Nov 16, 2018
1 parent 839417d commit 70dd74a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/opFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,13 @@ function checkOutOfGas (runState, callOptions) {

// sets up and calls runCall
function makeCall (runState, callOptions, localOpts, cb) {
var selfdestruct = Object.assign({}, runState.selfdestruct)
callOptions.caller = callOptions.caller || runState.address
callOptions.origin = runState.origin
callOptions.gasPrice = runState.gasPrice
callOptions.block = runState.block
callOptions.static = callOptions.static || false
callOptions.selfdestruct = runState.selfdestruct
callOptions.selfdestruct = selfdestruct
callOptions.storageReader = runState.storageReader

// increment the runState.depth
Expand Down Expand Up @@ -1053,6 +1054,7 @@ function makeCall (runState, callOptions, localOpts, cb) {
}

if (!results.vm.exceptionError) {
Object.assign(runState.selfdestruct, selfdestruct)
// update stateRoot on current contract
runState.stateManager.getAccount(runState.address, function (err, account) {
if (err) return cb(err)
Expand Down

0 comments on commit 70dd74a

Please sign in to comment.