From 1b30e641584381a64a6840fbbfb87859f1185b7d Mon Sep 17 00:00:00 2001 From: minh-bq <97180373+minh-bq@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:55:54 +0700 Subject: [PATCH] core/vm: make all opcodes proper type (#30925) (#658) commit https://github.com/ethereum/go-ethereum/commit/5b9a3ea9d2930eb2228c5203d1afe40776e70af3. Noticed this omission while doing some work on goevmlab. We don't properly type some of the opcodes, but apparently implicit casting works in all the internal usecases. This makes the debugger show the name of those missing type opcodes instead of just hexadecimal value. Co-authored-by: Martin HS --- core/vm/opcodes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/vm/opcodes.go b/core/vm/opcodes.go index e64112361..9c9842dd4 100644 --- a/core/vm/opcodes.go +++ b/core/vm/opcodes.go @@ -166,7 +166,7 @@ const ( // 0x80 range - dups. const ( - DUP1 = 0x80 + iota + DUP1 OpCode = 0x80 + iota DUP2 DUP3 DUP4 @@ -186,7 +186,7 @@ const ( // 0x90 range - swaps. const ( - SWAP1 = 0x90 + iota + SWAP1 OpCode = 0x90 + iota SWAP2 SWAP3 SWAP4