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

feat: add trie root fns for exact sized iter #77

Closed
wants to merge 2 commits into from

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Dec 11, 2024

for receipts we usually have the case where we have Vec<Receipt> but we need ReceiptWithBloom<Receipt> to calculate the trie root

it would be beneficial to use an iterator for these cases and avoid the collect in map(ReceiptWithBloom).collect

let index = adjust_index_for_rlp(i, items_len);

let index_buffer = alloy_rlp::encode_fixed_size(&index);

value_buffer.clear();
encode(&items[index], &mut value_buffer);
encode(item, &mut value_buffer);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh right this is why it doesn't work, it doesn't encode in order

@DaniPopes
Copy link
Member

cc @rkrasiuk

@DaniPopes DaniPopes closed this Dec 12, 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