diff options
author | Martin Holst Swende <martin@swende.se> | 2017-06-07 23:09:08 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2017-06-07 23:09:08 +0800 |
commit | 80f7c6c2996ad47f70a5070c400b1fd87a20c59c (patch) | |
tree | 8ad4108832ddd5e0b0c2223ebef8c5dad26ad3cd /core/vm/runtime/runtime.go | |
parent | bc24b7a91218ab34f10a145467f6ef380a5d22aa (diff) | |
download | dexon-80f7c6c2996ad47f70a5070c400b1fd87a20c59c.tar dexon-80f7c6c2996ad47f70a5070c400b1fd87a20c59c.tar.gz dexon-80f7c6c2996ad47f70a5070c400b1fd87a20c59c.tar.bz2 dexon-80f7c6c2996ad47f70a5070c400b1fd87a20c59c.tar.lz dexon-80f7c6c2996ad47f70a5070c400b1fd87a20c59c.tar.xz dexon-80f7c6c2996ad47f70a5070c400b1fd87a20c59c.tar.zst dexon-80f7c6c2996ad47f70a5070c400b1fd87a20c59c.zip |
cmd/evm: add --prestate, --sender, --json flags for fuzzing (#14476)
Diffstat (limited to 'core/vm/runtime/runtime.go')
-rw-r--r-- | core/vm/runtime/runtime.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 94265626f..aa386a995 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -125,7 +125,7 @@ func Execute(code, input []byte, cfg *Config) ([]byte, *state.StateDB, error) { } // Create executes the code using the EVM create method -func Create(input []byte, cfg *Config) ([]byte, common.Address, error) { +func Create(input []byte, cfg *Config) ([]byte, common.Address, uint64, error) { if cfg == nil { cfg = new(Config) } @@ -141,13 +141,13 @@ func Create(input []byte, cfg *Config) ([]byte, common.Address, error) { ) // Call the code with the given configuration. - code, address, _, err := vmenv.Create( + code, address, leftOverGas, err := vmenv.Create( sender, input, cfg.GasLimit, cfg.Value, ) - return code, address, err + return code, address, leftOverGas, err } // Call executes the code given by the contract's address. It will return the @@ -155,14 +155,14 @@ func Create(input []byte, cfg *Config) ([]byte, common.Address, error) { // // Call, unlike Execute, requires a config and also requires the State field to // be set. -func Call(address common.Address, input []byte, cfg *Config) ([]byte, error) { +func Call(address common.Address, input []byte, cfg *Config) ([]byte, uint64, error) { setDefaults(cfg) vmenv := NewEnv(cfg, cfg.State) sender := cfg.State.GetOrNewStateObject(cfg.Origin) // Call the code with the given configuration. - ret, _, err := vmenv.Call( + ret, leftOverGas, err := vmenv.Call( sender, address, input, @@ -170,5 +170,5 @@ func Call(address common.Address, input []byte, cfg *Config) ([]byte, error) { cfg.Value, ) - return ret, err + return ret, leftOverGas, err } |