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: replace static methods #3515

Merged
merged 5 commits into from
Jul 18, 2024
Merged

Trie: replace static methods #3515

merged 5 commits into from
Jul 18, 2024

Conversation

ScottyPoi
Copy link
Contributor

@ScottyPoi ScottyPoi commented Jul 17, 2024

Moving ahead with #3487

constructor methods:

Moved to constructors.ts

  • Trie.create
    • becomes createTrie
  • Trie.createFromProof
    • becomes createTrieFromProof
  • (deprecated) Trie.fromProof
    • absorbed into createTrieFromProof

static proof methods

Moved to proof/index.ts

  • Trie.verifyProof
    • becomes verifyTrieProof
  • Trie.verifyRangeProof
    • becomes verifyTrieRangeProof

--

small refactor in createTrieFromProof

new function createTrieFromProof replaces Trie.createFromProof and deprecated method Trie.fromProof

A small refactor was made, removing the optional parameter shouldVerifyRoot parameter, which defaulted to false. The new function will infer this intention by the presence of a root value passed into the (also optional) trieOpts parameter.

const shouldVerifyRoot = trieOpts?.root !== undefined

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, nice! 🙂

@holgerd77 holgerd77 merged commit f325b62 into master Jul 18, 2024
34 checks passed
@holgerd77 holgerd77 deleted the trie-statics branch July 18, 2024 07:56
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