Skip to content

Commit 5a23f0a

Browse files
committed
mssmt: use Node interface instead of LeafNode concrete type in func sigs
Replaced usages of the LeafNode concrete type with the more general Node interface in function signatures where applicable. This adds flexibility which will become useful in a future itest.
1 parent 1f576a2 commit 5a23f0a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mssmt/proof.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewProof(nodes []Node) *Proof {
4242
}
4343

4444
// Root returns the root node obtained by walking up the tree.
45-
func (p Proof) Root(key [32]byte, leaf *LeafNode) *BranchNode {
45+
func (p Proof) Root(key [32]byte, leaf Node) *BranchNode {
4646
// Note that we don't need to check the error here since the only point
4747
// where the error could come from is the passed iterator which is nil.
4848
node, _ := walkUp(&key, leaf, p.Nodes, nil)

mssmt/tree.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ func (t *FullTree) walkDown(tx TreeStoreViewTx, key *[hashSize]byte,
145145

146146
// walkUp walks up from the `start` leaf node up to the root with the help of
147147
// `siblings`. The root branch node computed is returned.
148-
func walkUp(key *[hashSize]byte, start *LeafNode, siblings []Node,
148+
func walkUp(key *[hashSize]byte, start Node, siblings []Node,
149149
iter iterFunc) (*BranchNode, error) {
150150

151-
var current Node = start
151+
var current = start
152152
for i := lastBitIndex; i >= 0; i-- {
153153
sibling := siblings[lastBitIndex-i]
154154
var parent Node

0 commit comments

Comments
 (0)