applied suggestion

This commit is contained in:
Marius van der Wijden 2025-02-04 10:41:19 +01:00
parent 10cd083c78
commit 30b642bc51
2 changed files with 4 additions and 3 deletions

View File

@ -17,8 +17,8 @@
package core package core
import ( import (
"errors"
"bytes" "bytes"
"errors"
"fmt" "fmt"
"math" "math"
"math/big" "math/big"

View File

@ -485,7 +485,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil { if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil {
evm.Config.Tracer.OnGasChange(gas, gas-statelessGas, tracing.GasChangeWitnessContractCollisionCheck) evm.Config.Tracer.OnGasChange(gas, gas-statelessGas, tracing.GasChangeWitnessContractCollisionCheck)
} }
contract.Gas = contract.Gas - statelessGas gas = gas - statelessGas
} }
// We add this to the access list _before_ taking a snapshot. Even if the // We add this to the access list _before_ taking a snapshot. Even if the
@ -533,9 +533,10 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil { if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil {
evm.Config.Tracer.OnGasChange(gas, gas-statelessGas, tracing.GasChangeWitnessContractInit) evm.Config.Tracer.OnGasChange(gas, gas-statelessGas, tracing.GasChangeWitnessContractInit)
} }
contract.Gas = contract.Gas - statelessGas gas = gas - statelessGas
} }
evm.Context.Transfer(evm.StateDB, caller.Address(), address, value) evm.Context.Transfer(evm.StateDB, caller.Address(), address, value)
contract.Gas = gas
ret, err = evm.initNewContract(contract, address, value, input, isInitcodeEOF) ret, err = evm.initNewContract(contract, address, value, input, isInitcodeEOF)
if err != nil && (evm.chainRules.IsHomestead || err != ErrCodeStoreOutOfGas) { if err != nil && (evm.chainRules.IsHomestead || err != ErrCodeStoreOutOfGas) {