Skip to content

test_tx_nonce_overflow()

Documentation for tests/frontier/validation/test_transaction.py::test_tx_nonce_overflow@5fa5938b.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/frontier/validation/test_transaction.py::test_tx_nonce_overflow --fork Amsterdam

Test that a transaction with a nonce that does not fit in 64 bits is rejected at deserialization.

Source code in tests/frontier/validation/test_transaction.py
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
@pytest.mark.exception_test
def test_tx_nonce_overflow(
    transaction_test: TransactionTestFiller,
    pre: Alloc,
    fork: BaseFork,
) -> None:
    """
    Test that a transaction with a nonce that does not fit in 64 bits is
    rejected at deserialization.
    """
    tx = Transaction(
        to=pre.nonexistent_account(),
        nonce=2**64,
        gas_limit=fork.transaction_intrinsic_cost_calculator()(),
        sender=pre.fund_eoa(),
        protected=False,
        error=TransactionException.NONCE_OVERFLOW,
    )

    transaction_test(pre=pre, tx=tx)

Parametrized Test Cases

This test generates 1 parametrized test case across 16 forks.