diff options
Diffstat (limited to 'accounts/abi/bind')
-rw-r--r-- | accounts/abi/bind/backends/simulated.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 18e8481c5..213a4f1a7 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -24,10 +24,14 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" ) +// Default chain configuration which sets homestead phase at block 0 (i.e. no frontier) +var chainConfig = &core.ChainConfig{HomesteadBlock: big.NewInt(0)} + // This nil assignment ensures compile time that SimulatedBackend implements bind.ContractBackend. var _ bind.ContractBackend = (*SimulatedBackend)(nil) @@ -46,7 +50,7 @@ type SimulatedBackend struct { func NewSimulatedBackend(accounts ...core.GenesisAccount) *SimulatedBackend { database, _ := ethdb.NewMemDatabase() core.WriteGenesisBlockForTesting(database, accounts...) - blockchain, _ := core.NewBlockChain(database, new(core.FakePow), new(event.TypeMux)) + blockchain, _ := core.NewBlockChain(database, chainConfig, new(core.FakePow), new(event.TypeMux)) backend := &SimulatedBackend{ database: database, @@ -102,7 +106,7 @@ func (b *SimulatedBackend) ContractCall(contract common.Address, data []byte, pe data: data, } // Execute the call and return - vmenv := core.NewEnv(statedb, b.blockchain, msg, block.Header(), nil) + vmenv := core.NewEnv(statedb, chainConfig, b.blockchain, msg, block.Header(), vm.Config{}) gaspool := new(core.GasPool).AddGas(common.MaxBig) out, _, err := core.ApplyMessage(vmenv, msg, gaspool) @@ -145,7 +149,7 @@ func (b *SimulatedBackend) EstimateGasLimit(sender common.Address, contract *com data: data, } // Execute the call and return - vmenv := core.NewEnv(statedb, b.blockchain, msg, block.Header(), nil) + vmenv := core.NewEnv(statedb, chainConfig, b.blockchain, msg, block.Header(), vm.Config{}) gaspool := new(core.GasPool).AddGas(common.MaxBig) _, gas, err := core.ApplyMessage(vmenv, msg, gaspool) |