Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): EIP-7702: update auth.chainid in set code txs to u256 #1026

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/prague/eip7702_set_code_tx/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Spec:
DELEGATION_DESIGNATION_READING = Bytes("ef01")
RESET_DELEGATION_ADDRESS = Address(0)

MAX_CHAIN_ID = 2**64 - 1
MAX_AUTH_CHAIN_ID = 2**256 - 1
MAX_NONCE = 2**64 - 1

@staticmethod
Expand Down
11 changes: 5 additions & 6 deletions tests/prague/eip7702_set_code_tx/test_invalid_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ def test_invalid_auth_signature(


@pytest.mark.parametrize(
"chain_id",
"auth_chain_id",
[
pytest.param(Spec.MAX_CHAIN_ID + 1, id="chain_id=2**64"),
pytest.param(2**256, id="chain_id=2**256"),
pytest.param(Spec.MAX_AUTH_CHAIN_ID + 1, id="auth_chain_id=2**256"),
],
)
@pytest.mark.parametrize(
Expand All @@ -115,10 +114,10 @@ def test_invalid_auth_signature(
pytest.param(Address(1), id="non_zero_address"),
],
)
def test_invalid_tx_invalid_chain_id(
def test_invalid_tx_invalid_auth_chain_id(
transaction_test: TransactionTestFiller,
pre: Alloc,
chain_id: int,
auth_chain_id: int,
delegate_address: Address,
):
"""
Expand All @@ -128,7 +127,7 @@ def test_invalid_tx_invalid_chain_id(
authorization = AuthorizationTuple(
address=delegate_address,
nonce=0,
chain_id=chain_id,
chain_id=auth_chain_id,
signer=pre.fund_eoa(auth_account_start_balance),
)

Expand Down
8 changes: 4 additions & 4 deletions tests/prague/eip7702_set_code_tx/test_set_code_txs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2274,16 +2274,16 @@ def test_signature_s_out_of_range(


@pytest.mark.parametrize(
"chain_id",
"auth_chain_id",
[
pytest.param(Spec.MAX_CHAIN_ID, id="chain_id=2**64-1"),
pytest.param(Spec.MAX_AUTH_CHAIN_ID, id="auth_chain_id=2**256-1"),
pytest.param(2, id="chain_id=2"),
],
)
def test_valid_tx_invalid_chain_id(
state_test: StateTestFiller,
pre: Alloc,
chain_id: int,
auth_chain_id: int,
):
"""
Test sending a transaction where the chain id field does not match the current chain's id.
Expand All @@ -2299,7 +2299,7 @@ def test_valid_tx_invalid_chain_id(
authorization = AuthorizationTuple(
address=set_code_to_address,
nonce=0,
chain_id=chain_id,
chain_id=auth_chain_id,
signer=auth_signer,
)

Expand Down
Loading