Skip to content

Commit e0847c1

Browse files
fix(tests): update XEN approval test to not fail-early on approving the zero address
1 parent 5f9538a commit e0847c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/benchmark/mainnet/test_state_xen.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from ethereum_test_tools.vm.opcode import Opcodes as Op
3333

3434

35+
# TODO: add test which writes to already existing storage
3536
@pytest.mark.valid_from("Frontier")
3637
def test_xen_approve(
3738
blockchain_test: BlockchainTestFiller,
@@ -45,6 +46,8 @@ def test_xen_approve(
4546
60_000_000 # TODO: currently hardcoded, should be read from `gas_benchmark_value`
4647
)
4748

49+
# Gas limit: 60M, 2424 SSTOREs, 300 MGas/s
50+
4851
xen_contract = 0x06450DEE7FD2FB8E39061434BABCFC05599A6FB8
4952
gas_threshold = 40_000
5053

@@ -77,8 +80,8 @@ def test_xen_approve(
7780

7881
approval_spammer_contract = pre.deploy_contract(code=approval_loop_code)
7982

80-
start_address = Hash(0)
81-
approval_value = Hash(1)
83+
start_address = Hash(0x01) # Approvals to the zero address are rejected, so start at 1
84+
approval_value = Hash(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE)
8285

8386
calldata = start_address + approval_value
8487

0 commit comments

Comments
 (0)