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

fix(rlp): len() changes as RlpIterator is consumed #766

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

achillelamb
Copy link
Contributor

@achillelamb achillelamb commented Jul 10, 2023

Fixes #761

Problem

The issue is described in #761

Solution

The RlpIterator::len function returns item_count - current_index.

Tests

No new tests were added, only changed the rlp_iter test in rlp/tests/tests.rs. You can run it with

cargo test -p rlp --test tests -- rlp_iter

Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Thanks!

@ordian ordian requested a review from niklasad1 July 10, 2023 09:42
@ordian ordian added A8-looksgood changelog Needs to be added to the changelog labels Jul 11, 2023
@ordian ordian merged commit 7194def into paritytech:master Jul 12, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A8-looksgood changelog Needs to be added to the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[rlp] RlpIterator::len() does not update when the iterator is consumed.
2 participants