Skip to content

Commit 17d9295

Browse files
sonhv0212chiphamskymavis
authored andcommitted
core/state: add BalanceChangeReason to state db and state object (#74)
* core/state: add BalanceChangeReason to state object * core/state: add BalanceChangeReason to StateDB.AddBalance * core/state: add BalanceChangeReason to StateDB.SubBalance * core/state: add BalanceChangeReason to StateDB.SetBalance
1 parent 1513ae0 commit 17d9295

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/vm/evm.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ func (evm *EVM) CallCode(caller ContractRef, addr common.Address, input []byte,
325325
if !evm.Context.CanTransfer(evm.StateDB, caller.Address(), value) {
326326
return nil, gas, ErrInsufficientBalance
327327
}
328-
var snapshot = evm.StateDB.Snapshot()
328+
snapshot := evm.StateDB.Snapshot()
329329

330330
// It is allowed to call precompiles, even via delegatecall
331331
if p, isPrecompile := evm.precompile(caller, addr); isPrecompile {
@@ -376,7 +376,7 @@ func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []by
376376
if evm.depth > int(params.CallCreateDepth) {
377377
return nil, gas, ErrDepth
378378
}
379-
var snapshot = evm.StateDB.Snapshot()
379+
snapshot := evm.StateDB.Snapshot()
380380

381381
// It is allowed to call precompiles, even via delegatecall
382382
if p, isPrecompile := evm.precompile(caller, addr); isPrecompile {
@@ -425,7 +425,7 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte
425425
// after all empty accounts were deleted, so this is not required. However, if we omit this,
426426
// then certain tests start failing; stRevertTest/RevertPrecompiledTouchExactOOG.json.
427427
// We could change this, but for now it's left for legacy reasons
428-
var snapshot = evm.StateDB.Snapshot()
428+
snapshot := evm.StateDB.Snapshot()
429429

430430
// We do an AddBalance of zero here, just in order to trigger a touch.
431431
// This doesn't matter on Mainnet, where all empties are gone at the time of Byzantium,

0 commit comments

Comments
 (0)