-
Notifications
You must be signed in to change notification settings - Fork 223
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
Make triehash generic over hasher #2
Conversation
Bump patricia_trie to v0.2.1
* master: Bump triehash to v0.1.1 Prepare triehash for cargo publication
Add keccak-hasher test-helper as a test dep
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. There are some lines with trailing whitespace.
triehash/src/lib.rs
Outdated
{ | ||
let gen_input: Vec<_> = input | ||
// first put elements into btree to sort them and to remove duplicates | ||
.into_iter() | ||
.map(|(k, v)| (keccak(k), v)) | ||
.map(|(k, v)| (H::hash(&k.as_ref()), v)) |
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.
Just k.as_ref()
should be enough.
triehash/src/lib.rs
Outdated
.collect::<BTreeMap<_, _>>() | ||
// then move them to a vector | ||
.into_iter() | ||
.map(|(k, v)| (as_nibbles(&k), v) ) | ||
.map(|(k, v)| (as_nibbles(&k.as_ref()), v) ) |
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.
Just k.as_ref()
should be enough.
* kvdb-rocksdb: no overlay experiment * kvdb-rocksdb: remove unused dep * kvdb-rocksdb: panic on write failure * kvdb: remove write_buffered and flush * kvdb: update changelog * kvdb-rocksdb: update changelog * kvdb-web: update changelog * kvdb-memory: update changelog * kvdb-rocksdb: fix the bench * kvdb-rocksdb: fix the bench #2 * kvdb: cargo fmt * Apply suggestions from code review Co-Authored-By: David <dvdplm@gmail.com> * kvdb-rocksdb: s/acquired_val/value * kvdb-rocksdb: update the changelog Co-authored-by: David <dvdplm@gmail.com>
Prepare
triehash
for use in Polkadot.