-
Notifications
You must be signed in to change notification settings - Fork 34
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: add trie db wrapper; refactor trienode #588
trie: add trie db wrapper; refactor trienode #588
Conversation
a43b785
to
084eac9
Compare
084eac9
to
16d80b1
Compare
16d80b1
to
bc1961d
Compare
noted, it will split trie/database.go -> into trie/triedb/<hashdb/pathdb> structure. |
// Node is a wrapper which contains the encoded blob of the trie node and its | ||
// unique hash identifier. It is general enough that can be used to represent | ||
// trie nodes corresponding to different trie implementations. | ||
type Node struct { |
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.
Rename from memoryNode-> Node
} | ||
|
||
// AddLeaf adds the provided leaf node into set. | ||
func (set *NodeSet) AddLeaf(parent common.Hash, blob []byte) { |
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.
before, they init leaf obj and pass directly here.
func (set *NodeSet) addLeaf(leaf *leaf) {
set.leaves = append(set.leaves, leaf)
}
} | ||
//} else { |
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.
hm Why we comment here. ?
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.
It will be later enabled for path based scheme
trie: change name WithPrev => NodeWithPrev rawdb: add schema_test
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
4a72920
into
axieinfinity:path-base-implementing
* trie: add wrapper for database * trie: refactor trie node * all: fix test * rawdb, trie: fix comment trie: change name WithPrev => NodeWithPrev rawdb: add schema_test
* trie: add wrapper for database * trie: refactor trie node * all: fix test * rawdb, trie: fix comment trie: change name WithPrev => NodeWithPrev rawdb: add schema_test
* trie: add wrapper for database * trie: refactor trie node * all: fix test * rawdb, trie: fix comment trie: change name WithPrev => NodeWithPrev rawdb: add schema_test
References:
Changes: