feat: compute world state#122
Merged
Merged
Conversation
…pute-world-state
MegaRedHand
reviewed
Jul 8, 2024
Comment on lines
+17
to
+21
| fn encode_to_vec(&self) -> Vec<u8> { | ||
| let mut buf = Vec::new(); | ||
| self.encode(&mut buf); | ||
| buf | ||
| } |
Collaborator
There was a problem hiding this comment.
We can have this as a standalone generic function:
/// Function for encoding a value to RLP.
/// For encoding the value into a buffer directly, use [`RLPEncode::encode`].
pub fn encode<T: RLPEncode>(value: T) -> Vec<u8> {
let mut buf = Vec::new();
value.encode(&mut buf);
buf
}
Contributor
Author
There was a problem hiding this comment.
Why not have it as part of the trait? It is more legible and it is a common use case
Collaborator
There was a problem hiding this comment.
Having it in the trait lets implementors override the default implementation. However, since it's for internal use this won't happen so let's leave it inside the trait.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Obtain world state from account info stored in db
Description
Closes #44