Skip to content

Commit 3785564

Browse files
committed
fix _eq_ compare for opcodes and macros
1 parent 84e3072 commit 3785564

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ethereum_test_tools/vm/opcode.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@ def __str__(self) -> str:
6666
def __eq__(self, other):
6767
"""
6868
Required to differentiate between SELFDESTRUCT and SENDALL type of cases
69-
And to register the Macro opcodes which are defined from same bytes
69+
And to compare with the Macro opcodes
7070
"""
7171
if isinstance(other, OpcodeMacroBase):
7272
return self._name_ == other._name_
73-
return False
73+
if isinstance(other, bytes):
74+
return bytes(self) == other
75+
return NotImplementedError(f"Unsupported type for comparison f{type(other)}")
7476

7577

7678
class Opcode(OpcodeMacroBase):

0 commit comments

Comments
 (0)