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

chore: fixes the description of absence index in the calculateAbsenceIndex #119

Merged
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 @@ -333,9 +333,8 @@ func (n *NamespacedMerkleTree) GetWithProof(nID namespace.ID) ([][]byte, Proof,
}

// calculateAbsenceIndex returns the index of a leaf of the tree that 1) its
// namespace ID is the largest namespace ID less than nid and 2) the namespace
// ID of the leaf to the left of it is smaller than the nid 3) the namespace ID
// of the leaf to the right of it is larger than nid.
// namespace ID is the smallest namespace ID larger than nID and 2) the
// namespace ID of the leaf to the left of it is smaller than the nID.
func (n *NamespacedMerkleTree) calculateAbsenceIndex(nID namespace.ID) int {
nidSize := n.treeHasher.NamespaceSize()
var prevLeaf []byte
Expand Down