Skip to content

Commit dbca2f5

Browse files
Fix tiny error in test_call_and_callcode_gas_calculation.
1 parent e91aba1 commit dbca2f5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/frontier/opcodes/test_call_and_callcode_gas_calculation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
verify whether the provided gas was sufficient or insufficient.
2424
"""
2525

26+
import random
2627
from typing import Dict
2728

2829
import pytest
@@ -72,7 +73,10 @@ def callee_code(callee_opcode: Op) -> Bytecode:
7273
GAS <- value doesn't matter
7374
CALL/CALLCODE.
7475
"""
75-
return callee_opcode(Op.GAS(), 0xFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1, 0, 0, 0, 0)
76+
# The address needs to be random,
77+
# otherwise the calculations (empty_account_cost) are incorrect.
78+
address = f"0x{random.getrandbits(160):040x}"
79+
return callee_opcode(Op.GAS(), address, 1, 0, 0, 0, 0)
7680

7781

7882
@pytest.fixture

0 commit comments

Comments
 (0)