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 the index of leafHash in the absence proof #114

Merged
merged 1 commit into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
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 @@ -188,9 +188,8 @@ func (n *NamespacedMerkleTree) ProveRange(start, end int) (Proof, error) {
// namespace i.e., n.minNID<= n.ID <=n.maxNID and the tree does not have any
// entries with the given Namespace ID nID, this will be proven by returning the
// inclusion/range Proof of the (namespaced or rather flagged) hash of the leaf
// of the tree 1) with the largest namespace ID that is smaller 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. The nodes
// of the tree 1) with the smallest namespace ID that is larger than nID and 2)
// the namespace ID of the leaf to the left of it is smaller than the nid. The nodes
// field of the returned Proof structure is populated with the Merkle inclusion
// proof. the leafHash field of the returned Proof will contain the namespaced
// hash of such leaf. The start and end fields of the Proof are set to the
Expand Down
7 changes: 3 additions & 4 deletions proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ type Proof struct {
// leafHash are nil if the namespace is present in the NMT. In case the
// namespace to be proved is in the min/max range of the tree but absent,
// this will contain the leaf hash necessary to verify the proof of absence.
// leafHash contains a tree leaf 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.
// leafHash contains a tree leaf that 1) its 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.
leafHash []byte
// isMaxNamespaceIDIgnored is set to true if the tree from which this Proof
// was generated from is initialized with Options.IgnoreMaxNamespace ==
Expand Down