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

Make triehash generic over hasher #2

Merged
merged 9 commits into from
Jul 9, 2018

Conversation

dvdplm
Copy link
Contributor

@dvdplm dvdplm commented Jul 6, 2018

Prepare triehash for use in Polkadot.

@dvdplm dvdplm requested review from rphmeier and debris and removed request for rphmeier July 6, 2018 16:15
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
Copy link
Contributor

@twittner twittner left a 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.

{
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))
Copy link
Contributor

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.

.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) )
Copy link
Contributor

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.

@dvdplm dvdplm merged commit 1803c0f into master Jul 9, 2018
@debris debris deleted the refactor/triehash-generic-over-hasher branch July 10, 2018 08:02
ordian added a commit that referenced this pull request Jan 14, 2020
dvdplm added a commit that referenced this pull request Mar 26, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants