From 93a7f324c06321023e2702f7989fdfad32573793 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 19 Sep 2020 22:27:11 -0400 Subject: apply mulit-coin universally --- core/vm/instructions.go | 6 +++--- core/vm/interface.go | 2 -- core/vm/jump_table.go | 12 ++++++------ core/vm/opcodes.go | 22 +++++++++++----------- 4 files changed, 20 insertions(+), 22 deletions(-) (limited to 'core/vm') diff --git a/core/vm/instructions.go b/core/vm/instructions.go index abfa2aa..e1eb25e 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -881,9 +881,9 @@ func opSuicide(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([ return nil, nil } -func opEMC(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]byte, error) { - return nil, interpreter.evm.StateDB.EnableMultiCoin(callContext.contract.Address()) -} +//func opEMC(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]byte, error) { +// return nil, interpreter.evm.StateDB.EnableMultiCoin(callContext.contract.Address()) +//} // following functions are used by the instruction jump table diff --git a/core/vm/interface.go b/core/vm/interface.go index 4f95423..05faac1 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -34,8 +34,6 @@ type StateDB interface { SubBalanceMultiCoin(common.Address, common.Hash, *big.Int) AddBalanceMultiCoin(common.Address, common.Hash, *big.Int) GetBalanceMultiCoin(common.Address, common.Hash) *big.Int - EnableMultiCoin(common.Address) error - IsMultiCoin(common.Address) bool GetNonce(common.Address) uint64 SetNonce(common.Address, uint64) diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 7e3e354..9b538d4 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -558,12 +558,12 @@ func newFrontierInstructionSet() JumpTable { minStack: minStack(0, 0), maxStack: maxStack(0, 0), }, - EMC: { - execute: opEMC, - constantGas: params.EMCGas, - minStack: minStack(0, 0), - maxStack: maxStack(0, 0), - }, + //EMC: { + // execute: opEMC, + // constantGas: params.EMCGas, + // minStack: minStack(0, 0), + // maxStack: maxStack(0, 0), + //}, PUSH1: { execute: opPush1, constantGas: GasFastestStep, diff --git a/core/vm/opcodes.go b/core/vm/opcodes.go index 99688b1..c5097f8 100644 --- a/core/vm/opcodes.go +++ b/core/vm/opcodes.go @@ -210,8 +210,8 @@ const ( const ( BALANCEMC = 0xcd - EMC = 0xce - CALLEX = 0xcf + //EMC = 0xce + CALLEX = 0xcf ) // 0xf0 range - closures. @@ -385,9 +385,9 @@ var opCodeToString = map[OpCode]string{ LOG4: "LOG4", // 0xf0 range. - CREATE: "CREATE", - CALL: "CALL", - EMC: "EMC", + CREATE: "CREATE", + CALL: "CALL", + //EMC: "EMC", CALLEX: "CALLEX", RETURN: "RETURN", CALLCODE: "CALLCODE", @@ -553,12 +553,12 @@ var stringToOp = map[string]OpCode{ "CREATE": CREATE, "CREATE2": CREATE2, "CALL": CALL, - "EMC": EMC, - "CALLEX": CALLEX, - "RETURN": RETURN, - "CALLCODE": CALLCODE, - "REVERT": REVERT, - "SELFDESTRUCT": SELFDESTRUCT, + //"EMC": EMC, + "CALLEX": CALLEX, + "RETURN": RETURN, + "CALLCODE": CALLCODE, + "REVERT": REVERT, + "SELFDESTRUCT": SELFDESTRUCT, } // StringToOp finds the opcode whose name is stored in `str`. -- cgit v1.2.3