From 918aaba3465906dc54ac75814bac2da486d9372b Mon Sep 17 00:00:00 2001 From: rjl493456442 Date: Thu, 19 Jul 2018 10:13:44 +0800 Subject: [PATCH] core/vm: add opcode to string mapping --- core/vm/evm.go | 4 ++-- core/vm/opcodes.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/vm/evm.go b/core/vm/evm.go index e0d95407bc..5625246688 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -320,7 +320,7 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte } // create creates a new contract using code as deployment code. -func (evm *EVM) create(caller ContractRef, code []byte, gas uint64, value *big.Int, address common.Address) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) { +func (evm *EVM) create(caller ContractRef, code []byte, gas uint64, value *big.Int, address common.Address) ([]byte, common.Address, uint64, error) { // Depth check execution. Fail if we're trying to execute above the // limit. if evm.depth > int(params.CallCreateDepth) { @@ -360,7 +360,7 @@ func (evm *EVM) create(caller ContractRef, code []byte, gas uint64, value *big.I } start := time.Now() - ret, err = run(evm, contract, nil) + ret, err := run(evm, contract, nil) // check whether the max code size has been exceeded maxCodeSizeExceeded := evm.ChainConfig().IsEIP158(evm.BlockNumber) && len(ret) > params.MaxCodeSize diff --git a/core/vm/opcodes.go b/core/vm/opcodes.go index 65af3dbe59..84426a28a8 100644 --- a/core/vm/opcodes.go +++ b/core/vm/opcodes.go @@ -371,6 +371,7 @@ var opCodeToString = map[OpCode]string{ RETURN: "RETURN", CALLCODE: "CALLCODE", DELEGATECALL: "DELEGATECALL", + CREATE2: "CREATE2", STATICCALL: "STATICCALL", REVERT: "REVERT", SELFDESTRUCT: "SELFDESTRUCT", @@ -522,6 +523,7 @@ var stringToOp = map[string]OpCode{ "LOG3": LOG3, "LOG4": LOG4, "CREATE": CREATE, + "CREATE2": CREATE2, "CALL": CALL, "RETURN": RETURN, "CALLCODE": CALLCODE,