Skip to content

Add transaction tests for type 1 and type 2 with accessList (Fixes #3707) #3737

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

Closed
wants to merge 1 commit into from
Closed
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
45 changes: 45 additions & 0 deletions tests/core/eth-module/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,3 +588,48 @@ async def test_async_send_set_code_transaction(async_w3, async_math_contract):

reset_code = await async_w3.eth.get_code(acct.address)
assert reset_code == HexBytes("0x")


def test_send_type1_transaction_with_access_list(w3):
txn = {
"from": w3.eth.accounts[0],
"to": w3.eth.accounts[1],
"gas": 50000,
"gasPrice": w3.to_wei(1, "gwei"),
"accessList": [
{
"address": w3.eth.accounts[2],
"storageKeys": [
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
}
],
}

tx_hash = w3.eth.send_transaction(txn)
receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
assert receipt["status"] == 1
assert receipt["transactionHash"] == tx_hash


def test_send_type2_transaction_with_access_list(w3):
txn = {
"from": w3.eth.accounts[0],
"to": w3.eth.accounts[1],
"gas": 50000,
"maxFeePerGas": w3.to_wei(2, "gwei"),
"maxPriorityFeePerGas": w3.to_wei(1, "gwei"),
"accessList": [
{
"address": w3.eth.accounts[2],
"storageKeys": [
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
}
],
}

tx_hash = w3.eth.send_transaction(txn)
receipt = w3.eth.wait_for_transaction_receipt(tx_hash)
assert receipt["status"] == 1
assert receipt["transactionHash"] == tx_hash