Skip to content

Commit

Permalink
opcode Macro unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Mar 25, 2024
1 parent 71e8b09 commit b33995b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ethereum_test_tools/tests/test_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
b"\x60\x08\x60\x07\x60\x06\x60\x05\x60\x04\x73\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+ b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x60\x01\xf0",
),
(
Om.OOG(),
bytes([0x64, 0x17, 0x48, 0x76, 0xE8, 0x00, 0x60, 0x00, 0x20]),
),
],
)
def test_opcodes(opcodes: bytes, expected: bytes):
Expand All @@ -157,6 +161,7 @@ def test_opcodes_repr():
"""
assert f"{Op.CALL}" == "CALL"
assert f"{Op.DELEGATECALL}" == "DELEGATECALL"
assert f"{Om.OOG}" == "OOG"
assert str(Op.ADD) == "ADD"


Expand All @@ -165,3 +170,5 @@ def test_macros():
Test opcode and macros interaction
"""
assert (Op.PUSH1(1) + Om.OOG) == (Op.PUSH1(1) + Op.SHA3(0, 100000000000))
for opcode in Op:
assert opcode != Om.OOG

0 comments on commit b33995b

Please sign in to comment.