diff options
author | Joel Burget <joelburget@gmail.com> | 2017-08-11 19:29:32 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-11 19:29:32 +0800 |
commit | 833eeb9f23e6808377f0414f0db4a731b134fe9f (patch) | |
tree | aa572dc81a9aa1e690489caaa854661de9c6d62e /core | |
parent | 2b422b1a47e9b2a0f3d7ecf7063eef2e59cc082e (diff) | |
download | dexon-833eeb9f23e6808377f0414f0db4a731b134fe9f.tar dexon-833eeb9f23e6808377f0414f0db4a731b134fe9f.tar.gz dexon-833eeb9f23e6808377f0414f0db4a731b134fe9f.tar.bz2 dexon-833eeb9f23e6808377f0414f0db4a731b134fe9f.tar.lz dexon-833eeb9f23e6808377f0414f0db4a731b134fe9f.tar.xz dexon-833eeb9f23e6808377f0414f0db4a731b134fe9f.tar.zst dexon-833eeb9f23e6808377f0414f0db4a731b134fe9f.zip |
core/vm/runtime: remove unused state parameter to NewEnv (#14953)
* core: Remove unused `state` parameter to `NewEnv`.
`cfg.State` is used instead.
* core/vm/runtime: remove unused import
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/runtime/env.go | 3 | ||||
-rw-r--r-- | core/vm/runtime/runtime.go | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/core/vm/runtime/env.go b/core/vm/runtime/env.go index 7b41fe85a..818da1be2 100644 --- a/core/vm/runtime/env.go +++ b/core/vm/runtime/env.go @@ -21,11 +21,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/vm" ) -func NewEnv(cfg *Config, state *state.StateDB) *vm.EVM { +func NewEnv(cfg *Config) *vm.EVM { context := vm.Context{ CanTransfer: core.CanTransfer, Transfer: core.Transfer, diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 44cde4f70..edbf54176 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -106,7 +106,7 @@ func Execute(code, input []byte, cfg *Config) ([]byte, *state.StateDB, error) { } var ( address = common.StringToAddress("contract") - vmenv = NewEnv(cfg, cfg.State) + vmenv = NewEnv(cfg) sender = vm.AccountRef(cfg.Origin) ) cfg.State.CreateAccount(address) @@ -136,7 +136,7 @@ func Create(input []byte, cfg *Config) ([]byte, common.Address, uint64, error) { cfg.State, _ = state.New(common.Hash{}, state.NewDatabase(db)) } var ( - vmenv = NewEnv(cfg, cfg.State) + vmenv = NewEnv(cfg) sender = vm.AccountRef(cfg.Origin) ) @@ -158,7 +158,7 @@ func Create(input []byte, cfg *Config) ([]byte, common.Address, uint64, error) { func Call(address common.Address, input []byte, cfg *Config) ([]byte, uint64, error) { setDefaults(cfg) - vmenv := NewEnv(cfg, cfg.State) + vmenv := NewEnv(cfg) sender := cfg.State.GetOrNewStateObject(cfg.Origin) // Call the code with the given configuration. |