Skip to content

Commit

Permalink
bump other addresses ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed May 14, 2024
1 parent f10b1e0 commit c7914cf
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
caller_address = 0x1000

# Address of the callee contract
callee_address = 0x200
callee_address = 0x2000

PUSH_OPCODE_COST = 3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
pytestmark = [pytest.mark.valid_from("Cancun")]

# Address of the callee contract
callee_address = 0x200
callee_address = 0x2000

SETUP_CONDITION: bytes = Op.EQ(Op.CALLDATALOAD(0), 0x01)
REENTRANT_CALL: bytes = Op.MSTORE(0, 2) + Op.SSTORE(
Expand Down
2 changes: 1 addition & 1 deletion tests/cancun/eip1153_tstore/test_tstorage_selfdestruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# Addresses
caller_address = 0x1000
copy_from_initcode_address = 0x200
copy_from_initcode_address = 0x2000
callee_address = compute_create_address(caller_address, 1)

CREATE_CODE = Op.EXTCODECOPY(
Expand Down
15 changes: 8 additions & 7 deletions tests/cancun/eip4844_blobs/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Common constants, classes & functions local to EIP-4844 tests.
"""

from dataclasses import dataclass
from typing import List, Literal, Tuple, Union

Expand Down Expand Up @@ -101,13 +102,13 @@ class BlobhashContext:
yul_compiler: Union[YulCompiler, None] = None
addresses = {
"blobhash_sstore": Address(0x1000),
"blobhash_return": Address(0x600),
"call": Address(0x200),
"delegatecall": Address(0x300),
"callcode": Address(0x800),
"staticcall": Address(0x700),
"create": Address(0x400),
"create2": Address(0x500),
"blobhash_return": Address(0x6000),
"call": Address(0x2000),
"delegatecall": Address(0x3000),
"callcode": Address(0x8000),
"staticcall": Address(0x7000),
"create": Address(0x4000),
"create2": Address(0x5000),
}

@staticmethod
Expand Down
3 changes: 2 additions & 1 deletion tests/cancun/eip4844_blobs/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Pytest (plugin) definitions local to EIP-4844 tests.
"""

import pytest

from ethereum_test_tools import Address, Block, Hash, TestPrivateKey2, Transaction, add_kzg_version
Expand Down Expand Up @@ -41,7 +42,7 @@ def non_zero_blob_gas_used_genesis_block(
Transaction(
ty=Spec.BLOB_TX_TYPE,
nonce=0,
to=Address(0x200),
to=Address(0x2000),
value=1,
gas_limit=21000,
max_fee_per_gas=tx_max_fee_per_gas,
Expand Down
2 changes: 1 addition & 1 deletion tests/cancun/eip5656_mcopy/test_mcopy_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
code_address = 0xC0DE

# Code address of the callee contract
callee_address = 0x200
callee_address = 0x2000


REFERENCE_SPEC_GIT_PATH = REFERENCE_SPEC_GIT_PATH
Expand Down
2 changes: 1 addition & 1 deletion tests/cancun/eip5656_mcopy/test_mcopy_memory_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
caller_address = 0x1000

# Code address used to perform the memory expansion.
memory_expansion_address = 0x200
memory_expansion_address = 0x2000

REFERENCE_SPEC_GIT_PATH = REFERENCE_SPEC_GIT_PATH
REFERENCE_SPEC_VERSION = REFERENCE_SPEC_VERSION
Expand Down
2 changes: 1 addition & 1 deletion tests/cancun/eip7516_blobgasfee/test_blobgasfee_opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Code address used to call the test bytecode on every test case.
code_caller_address = Address(0x1000)
code_callee_address = Address(0x200)
code_callee_address = Address(0x2000)

BLOBBASEFEE_GAS = 2

Expand Down
6 changes: 3 additions & 3 deletions tests/prague/eip3540_eof_v1/test_code_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def create3_init_container(container: Container) -> Initcode: # noqa: D103

@pytest.fixture
def create3_opcode_contract_address() -> Address: # noqa: D103
return Address(0x300)
return Address(0x3000)


@pytest.fixture
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_legacy_initcode_invalid_eof_v1_contract(_):
Address(0x1000): Account(
code=create_initcode_from_calldata,
),
Address(0x200): Account(
Address(0x2000): Account(
code=create2_initcode_from_calldata,
),
}
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_legacy_initcode_invalid_eof_v1_contract(_):
)
tx_create2_opcode = Transaction(
nonce=2,
to=Address(0x200),
to=Address(0x2000),
gas_limit=100000000,
gas_price=10,
protected=False,
Expand Down
8 changes: 4 additions & 4 deletions tests/prague/eip3540_eof_v1/test_execution_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def test_eof_functions_contract_call_succeed(
code=caller_contract,
nonce=1,
),
Address(0x200): Account(
Address(0x2000): Account(
code=container,
nonce=1,
),
Expand Down Expand Up @@ -415,7 +415,7 @@ def test_eof_functions_contract_call_fail(
code=caller_contract,
nonce=1,
),
Address(0x200): Account(
Address(0x2000): Account(
code=container,
nonce=1,
),
Expand Down Expand Up @@ -459,7 +459,7 @@ def test_eof_functions_contract_call_within_deep_nested(
Address(0x1000): Account(
code=contract_call_within_deep_nested_callf,
),
Address(0x200): Account(
Address(0x2000): Account(
code=Op.SSTORE(0, 1) + Op.STOP(),
),
}
Expand All @@ -473,7 +473,7 @@ def test_eof_functions_contract_call_within_deep_nested(
)
post = {
Address(0x1000): Account(storage={i: 1 for i in range(MAX_CODE_SECTIONS)}),
Address(0x200): Account(
Address(0x2000): Account(
storage={
0: 1,
}
Expand Down
2 changes: 1 addition & 1 deletion tests/prague/eip7480_data_section/test_data_opcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_data_section_succeed(
code=caller_contract,
nonce=1,
),
Address(0x200): Account(
Address(0x2000): Account(
code=container,
nonce=1,
),
Expand Down
4 changes: 2 additions & 2 deletions tests/shanghai/eip3855_push0/test_push0.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def test_push0_during_staticcall(
"""
Test PUSH0 during STATICCALL.
"""
addr_2 = Address(0x200)
addr_2 = Address(0x2000)

code_1 = (
Op.SSTORE(0, Op.STATICCALL(100000, 0x200, 0, 0, 0, 0))
Op.SSTORE(0, Op.STATICCALL(100000, 0x2000, 0, 0, 0, 0))
+ Op.SSTORE(0, 1)
+ Op.RETURNDATACOPY(0x1F, 0, 1)
+ Op.SSTORE(1, Op.MLOAD(0))
Expand Down
Loading

0 comments on commit c7914cf

Please sign in to comment.