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

example: add EIP-1559 tx example #42

Merged
merged 1 commit into from
May 29, 2024
Merged

example: add EIP-1559 tx example #42

merged 1 commit into from
May 29, 2024

Conversation

zzzzzzch
Copy link
Contributor

hi it is a great lib. I found that EIP-1559 transaction is absent in example dir, so the code was added for this purpose. Most of the variables and values in this example are copied from legacy-transaction.c.

But I'm not sure about one thing: when access_list is empty, do I need to add it when constructing RLP? After my test, it seems that it can be added or not (I temporarily commented this in the example)

@zzzzzzch zzzzzzch changed the title example: add eip1559 tx example example: add EIP-1559 tx example May 29, 2024
@mhw0
Copy link
Owner

mhw0 commented May 29, 2024

hi it is a great lib. I found that EIP-1559 transaction is absent in example dir, so the code was added for this purpose. Most of the variables and values in this example are copied from legacy-transaction.c.

Hello, thank you for the PR.

But I'm not sure about one thing: when access_list is empty, do I need to add it when constructing RLP? After my test, it seems that it can be added or not (I temporarily commented this in the example)

ok(eth_rlp_array(&rlp0));
  // ok(eth_rlp_hex(&rlp0, &accees_list, NULL)); // empty for access_list
ok(eth_rlp_array_end(&rlp0));

you're already declaring empty array here before encoding empty hex (0x)

these are basically the same thing:

ok(eth_rlp_array(&rlp0));
ok(eth_rlp_array_end(&rlp0));
// and 
ok(eth_rlp_hex(&rlp0, &accees_list, NULL)); // empty for access_list

@mhw0
Copy link
Owner

mhw0 commented May 29, 2024

Hopefully you tested the code, merging it!

@mhw0 mhw0 merged commit 3efa6cf into mhw0:dev May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants