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

trie: convert constructor to options interface, remove deprecated setRoot #1874

Merged
merged 2 commits into from
May 2, 2022

Conversation

ryanio
Copy link
Contributor

@ryanio ryanio commented Apr 30, 2022

Completes tasks in #1717:

  • Replace constructor options with an options dict (like in other libraries), add an options type
  • Remove deprecated Trie.setRoot() function

extra:

  • Removes assert usage, preferring normal errors

@codecov
Copy link

codecov bot commented Apr 30, 2022

Codecov Report

Merging #1874 (9ba130b) into develop (d99f928) will decrease coverage by 0.00%.
The diff coverage is 83.33%.

Impacted file tree graph

Flag Coverage Δ
block 85.17% <ø> (ø)
blockchain 83.06% <ø> (ø)
client 77.45% <100.00%> (+0.08%) ⬆️
common 94.94% <ø> (ø)
devp2p 82.94% <ø> (-0.14%) ⬇️
ethash 90.71% <ø> (ø)
statemanager 84.07% <ø> (ø)
trie 80.17% <82.35%> (-0.18%) ⬇️
tx 92.48% <ø> (ø)
util 89.16% <ø> (ø)
vm 82.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -735,7 +750,7 @@ export class Trie {
*/
copy(): Trie {
const db = this.db.copy()
return new Trie(db._leveldb, this.root)
return new Trie({ db: db._leveldb, root: this.root, deleteFromDB: this._deleteFromDB })
Copy link
Member

Choose a reason for hiding this comment

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

Ah, that's all a lot nicer, great to see this. 👍 🙂

@holgerd77 holgerd77 merged commit 78ac377 into develop May 2, 2022
@holgerd77 holgerd77 deleted the trie-constructor-options branch May 2, 2022 12:37
holgerd77 pushed a commit that referenced this pull request May 4, 2022
…Root (#1874)

* trie: add constructor options interface

* remove assert use, remove deprecated setRoot
g11tech pushed a commit that referenced this pull request Jun 2, 2022
…Root (#1874)

* trie: add constructor options interface

* remove assert use, remove deprecated setRoot
g11tech pushed a commit that referenced this pull request Jun 2, 2022
…Root (#1874)

* trie: add constructor options interface

* remove assert use, remove deprecated setRoot
g11tech pushed a commit that referenced this pull request Jun 2, 2022
…Root (#1874)

* trie: add constructor options interface

* remove assert use, remove deprecated setRoot
g11tech pushed a commit that referenced this pull request Jun 3, 2022
…Root (#1874)

* trie: add constructor options interface

* remove assert use, remove deprecated setRoot
holgerd77 pushed a commit that referenced this pull request Jun 8, 2022
…Root (#1874)

* trie: add constructor options interface

* remove assert use, remove deprecated setRoot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants