Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[NC-1561] Remove RLPUtils from RawBlockIterator #179

Merged
merged 12 commits into from
Oct 26, 2018

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented Oct 26, 2018

PR description

This PR removes RLPUtils from RawBlockIterator, as part of the work to removing RLPUtils altogether.

In order to remove this utility, I added a BytesValue class that wraps around java.nio.ByteBuffer. The purpose of the BytesValue abstraction is to allow our apis to work generically across various types that represent byte strings, so I felt that it was worth expanding the library to support this common type. Adding another BytesValue wrapper is pretty straightforward. However, the tests were not set up to run across the various BytesValue implementations. So, I spent some time refactoring the tests to get better coverage across the different implementations as well as standardizing some behavior across implementations.

In order to support the functionality that was previously provided by RLPUtils, I also had to refactor the rlp library to extract some functionality from AbstractRLPInput so that it could be used in a static helper method in RLP.

I added tests for RawBlockIterator and additional test coverage for the areas of the rlp functionality that were refactored.

Note: Re-creating this PR after open-sourcing issues caused my previous PR to be closed: #143

Copy link
Contributor

@ekellstrand ekellstrand left a comment

Choose a reason for hiding this comment

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

lgtm

@mbaxter mbaxter merged commit f0553ef into PegaSysEng:master Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants