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

Clean up merkleDB interface and duplicate code #2445

Merged
merged 36 commits into from
Dec 28, 2023
Merged

Conversation

dboehm-avalabs
Copy link
Contributor

Currently the database constructs a view to accomplish a few tasks. With some small adjustments, that is no longer required. Also cleaning up the trie interfaces a little bit. We don't really use a readonlytrie anywhere and the full name of the View is merkleDB.View which I think is pretty clear.

@dboehm-avalabs dboehm-avalabs changed the title [WIP] Clean up merkleDB interface and duplicate code Clean up merkleDB interface and duplicate code Dec 13, 2023
x/merkledb/trie.go Outdated Show resolved Hide resolved
x/merkledb/db.go Outdated Show resolved Hide resolved
x/merkledb/trie.go Outdated Show resolved Hide resolved
}

// Returns a proof that [bytesPath] is in or not in trie [t].
func getProof[T Trie](t T, key []byte) (*Proof, error) {

Choose a reason for hiding this comment

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

These functions are tested indirectly elsewhere, but it would probably be a good idea to test them directly, too

@danlaine
Copy link

Also can you please update the README to change references to trieView to view?

@danlaine danlaine added this pull request to the merge queue Dec 28, 2023
Merged via the queue into dev with commit 0c7ff5a Dec 28, 2023
18 checks passed
@danlaine danlaine deleted the CleanUpInterfaces branch December 28, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants