Skip to content

Commit

Permalink
lowercase things
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjit-bhat committed Jun 22, 2024
1 parent 0b0fb75 commit 82765d9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions merkle/merkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ type Digest = []byte
// Binds an id down the tree to a particular node hash.
type pathProof struct {
id Id
NodeHash []byte
Digest Digest
ChildHashes [][][]byte
nodeHash []byte
digest Digest
childHashes [][][]byte
}

type Proof = [][][]byte
Expand All @@ -108,14 +108,14 @@ func isValidHashSl(data [][]byte) bool {

func (p *pathProof) check() errorTy {
var err = errNone
var currHash []byte = p.NodeHash
proofLen := uint64(len(p.ChildHashes))
var currHash []byte = p.nodeHash
proofLen := uint64(len(p.childHashes))
// Goose doesn't support general loops, so re-write this way.
// TODO: try writing with general loop syntax.
var loopIdx = uint64(0)
for ; loopIdx < proofLen; loopIdx++ {
pathIdx := proofLen - 1 - loopIdx
children := p.ChildHashes[pathIdx]
children := p.childHashes[pathIdx]
if uint64(len(children)) != numChildren-1 {
err = errSome
continue
Expand All @@ -139,7 +139,7 @@ func (p *pathProof) check() errorTy {
if err {
return errSome
}
if !std.BytesEqual(currHash, p.Digest) {
if !std.BytesEqual(currHash, p.digest) {
return errSome
}
return errNone
Expand Down Expand Up @@ -175,9 +175,9 @@ func CheckProof(proofTy ProofTy, proof Proof, id Id, val Val, digest Digest) err

pathProof := &pathProof{
id: idPref,
NodeHash: nodeHash,
Digest: digest,
ChildHashes: proof,
nodeHash: nodeHash,
digest: digest,
childHashes: proof,
}
return pathProof.check()
}
Expand Down

0 comments on commit 82765d9

Please sign in to comment.