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

fix: ProveNamespace godoc #167

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions nmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ func (n *NamespacedMerkleTree) ProveRange(start, end int) (Proof, error) {
// ProveNamespace returns a range proof for the given NamespaceID.
//
// case 1) If the namespace nID is out of the range of the tree's min and max
// namespace i.e., (nID < n.minNID) or (n.maxNID < nID) ProveNamespace returns
// an error and does not generate any range proof, instead it returns an empty
// namespace i.e., (nID < n.minNID) or (n.maxNID < nID) ProveNamespace returns an empty
// Proof with empty nodes and the range (0,0) i.e., Proof.start = 0 and
// Proof.end = 0 to indicate that this namespace is not contained in the tree.
//
Expand Down Expand Up @@ -216,7 +215,7 @@ func (n *NamespacedMerkleTree) ProveRange(start, end int) (Proof, error) {
func (n *NamespacedMerkleTree) ProveNamespace(nID namespace.ID) (Proof, error) {
isMaxNsIgnored := n.treeHasher.IsMaxNamespaceIDIgnored()
// case 1) In the cases (n.nID < minNID) or (n.maxNID < nID), return empty
// range and no proof
// range proof
if nID.Less(n.minNID) || n.maxNID.Less(nID) {
return NewEmptyRangeProof(isMaxNsIgnored), nil
}
Expand Down