test(eth): cover accessList formatter on type 1, 2 and 4 transactions#3845
Open
genisis0x wants to merge 1 commit into
Open
test(eth): cover accessList formatter on type 1, 2 and 4 transactions#3845genisis0x wants to merge 1 commit into
genisis0x wants to merge 1 commit into
Conversation
…ApeWorX#3707) Issue ApeWorX#3707 flags that the transaction-param formatters lacked direct tests for several combinations the wire format actually allows. Add three focused cases that exercise the eth_sendTransaction and eth_sendRawTransaction paths together: - test_(async_)eth_send_raw_transaction_type_1_access_list — signs an EIP-2930 (gasPrice + accessList, no max-fee fields) payload locally and pushes it through eth_sendRawTransaction. Verifies the round-tripped transaction reports type 1 and preserves the access-list entries. - test_(async_)eth_send_transaction_type_2_access_list — sends an EIP-1559 payload with a populated accessList via eth_sendTransaction. Both fields go through separate formatter branches, so the combination is worth pinning. - test_(async_)set_code_transaction_with_access_list — type 4 (EIP-7702) accepts both an authorizationList and an accessList. Add a raw-signed round-trip that asserts both fields survive together, since the existing set-code test only exercises the authorizationList path. No production code changes. Tests sit alongside the existing test_eth_create_access_list (which only exercises the eth_createAccessList RPC, not the send formatters) and the existing sign_authorization_send_raw_and_send_set_code_transactions test (which only exercises authorizationList). Closes ApeWorX#3707
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #3707.
Issue #3707 flags that the transaction-param formatters lack direct tests for several
accessListcombinations the wire format actually allows. Add three focused cases (with async + sync mirrors) that exercise theeth_sendTransactionandeth_sendRawTransactionpaths together.test_(async_)eth_send_raw_transaction_type_1_access_listeth_sendRawTransactiongasPrice+accessList, no max-fee fields; the round-tripped tx reportstype == 1and preserves the access-list entriestest_(async_)eth_send_transaction_type_2_access_listeth_sendTransactionmaxFeePerGas+maxPriorityFeePerGas+accessListgo through separate formatter branches; the combination is the regression casetest_(async_)set_code_transaction_with_access_listeth_sendRawTransactionauthorizationList+accessListsurvive together on the raw signing path; the existing set-code test only exercisesauthorizationListWhy these three
The existing coverage at
web3/_utils/module_testing/eth_module.py:test_eth_create_access_listexercises theeth_createAccessListRPC and then feeds the result intoeth_sendTransaction(type 2 by default), but doesn't driveeth_sendRawTransactionand doesn't lock the tx type explicitly.test_(async_)sign_authorization_send_raw_and_send_set_code_transactionsexercisesauthorizationListon both raw + send paths, but never withaccessListattached — so a regression in the type-4 formatter that dropsaccessListwould not be caught.The three additions close exactly the gaps the issue points at without changing production code.
No production changes
Pure test additions:
web3/_utils/module_testing/eth_module.py— 6 new methods (3 async, 3 sync mirrors).web3/_utils/module_testing/eth_module.py— importAccessList+AccessListEntryfromweb3.typesfor typed literals (satisfiesTxParams.accessListdeclared asAccessList, and resolves aSequence[str]inference issue mypy raised on the dict-literal form).newsfragments/3707.internal.rst.Tests
Async mirrors are not exercised against
EthereumTesterProvider(no async tester runner exists for the eth module today — the async eth-module suite runs against the geth integration), but the implementations are direct ports of the passing sync cases withawaitadded; the geth CI pipeline will exercise them.Open question for the maintainers
Issue #3707 also wonders aloud about blob (type 3) transaction coverage. The current
eth-testerbackends don't appear to validate type-3 round trips end-to-end the way they do for the other types, so I've left that out of scope here. Happy to add it as a follow-up if a tester path is available, or punt to the geth integration suite.