Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Bryce committed Oct 28, 2024
1 parent 781f573 commit 43b7024
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion massifs/rootsigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
// Allocation in this range MUST be co-ordinated datatrails wide.
// Remembering that the range is *negative* we allocate the tag by
// subtracting the IANA registered tag for marking COSE Receipts proof data.
SealPeakReceiptsLabel = int64(COSEPrivateStart - VDSCoseReceiptProofsTag)
SealPeakReceiptsLabel = COSEPrivateStart - VDSCoseReceiptProofsTag
)

// MMRState defines the details we include in our signed commitment to the head log state.
Expand Down
11 changes: 5 additions & 6 deletions mmr/includedroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ package mmr

import "hash"


// IncludedRoot calculates the accumulator peak for the provided
// proof and node value. Note that both interior and leaf nodes are handled
// identically
//
// Arguments:
// * i is the index the nodeHash is to be shown at
// * nodehash the value whose inclusion is to be shown
// * proof is the path of ibling values committing i. They recreate the unique
// accumulator peak that committed i to the MMR state from which the proof was
// produced.
// - i is the index the nodeHash is to be shown at
// - nodehash the value whose inclusion is to be shown
// - proof is the path of ibling values committing i. They recreate the unique
// accumulator peak that committed i to the MMR state from which the proof was
// produced.
func IncludedRoot(hasher hash.Hash, i uint64, nodeHash []byte, proof [][]byte) []byte {

root := nodeHash
Expand Down
2 changes: 1 addition & 1 deletion mmr/peaks.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func PeakIndex(leafCount uint64, d int) int {

// (a - 1) - (n -1) = a - 1 - n + 1 = a - n

return int(bits.OnesCount64(leafCount)) - n
return bits.OnesCount64(leafCount) - n
}

// TopPeak returns the smallest, leftmost, peak containing *or equal to* i
Expand Down
2 changes: 1 addition & 1 deletion mmr/printers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func proofPathStringer(path [][]byte, sep string) string {
}
func proofPathsStringer(paths [][][]byte, sep string) string {

spaths := make([]string, len(paths))
spaths := make([]string, 0, len(paths))

for _, path := range paths {
spaths = append(spaths, fmt.Sprintf("[%s]", proofPathStringer(path, sep)))
Expand Down

0 comments on commit 43b7024

Please sign in to comment.