Skip to content

Commit

Permalink
fix: ProveNamespace godoc (#167)
Browse files Browse the repository at this point in the history
Closes #123
  • Loading branch information
rootulp authored Mar 30, 2023
1 parent eb012d0 commit fc5ccb4
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit fc5ccb4

Please sign in to comment.