-
Notifications
You must be signed in to change notification settings - Fork 235
[rlp] fix nested unbounded lists #203
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
Conversation
@@ -335,6 +334,7 @@ impl RlpStream { | |||
let len = self.buffer.len() - list.position; | |||
self.encoder().insert_list_payload(len, list.position); | |||
self.note_appended(1); | |||
self.finished_list = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fix is here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -326,7 +325,7 @@ impl RlpStream { | |||
BasicEncoder::new(self) | |||
} | |||
|
|||
/// Finalize current ubnbound list. Panics if no unbounded list has been opened. | |||
/// Finalize current unbounded list. Panics if no unbounded list has been opened. | |||
pub fn complete_unbounded_list(&mut self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated, but maybe this should be called finalize_unbounded_list()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both sounds fine to me, but I'm not a native speaker. Also, I'd like to avoid breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"complete" can be both the imperative form of the verb as in "complete your homework before dinner!" or be and adjective "a complete list of my belongings".
"finalize" does not have this ambiguity.
In this context the ambiguity makes it unclear if the method returns an unbounded list of something that is complete, or that it takes an unbounded list and completes it.
We can add a copy named finalize_unbounded_list
and deprecate this one. In another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened #204
* master: [plain_hasher] Migrate to 2018 edition (#213) [ethbloom] Improve ethbloom (#215) [rlp] fix nested unbounded lists (#203) stabilize parity-bytes in no_std environment (#212) Speed up hex serialization, support Serde `with`, and fix warnings (#208) [ethbloom, ethereum-types,kvdb] migrate to 2018 edition (#205) Introduce `ContractAddress` newtype instead of scheme enum (#200)
Fixes #105.