Skip to content

Commit

Permalink
fake_node_reader: Remove unused field (#1631)
Browse files Browse the repository at this point in the history
  • Loading branch information
pav-kv authored May 23, 2019
1 parent 1b7918a commit 580ab86
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions storage/testonly/fake_node_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ import (
// NodeID -> Node mappings and will return only those. Requesting any other nodes results in
// an error. For use in tests only, does not implement any other storage APIs.
type FakeNodeReader struct {
treeSize int64
treeRevision int64
nodeMap map[string]storage.Node
}

// NewFakeNodeReader creates and returns a FakeNodeReader with the supplied nodes
// assuming that all the nodes are at a specified tree revision. All the node IDs
// must be distinct.
func NewFakeNodeReader(nodes []storage.Node, treeSize, treeRevision int64) *FakeNodeReader {
func NewFakeNodeReader(nodes []storage.Node, treeRevision int64) *FakeNodeReader {
nodeMap := make(map[string]storage.Node)

for _, node := range nodes {
Expand All @@ -54,7 +53,7 @@ func NewFakeNodeReader(nodes []storage.Node, treeSize, treeRevision int64) *Fake
nodeMap[id] = node
}

return &FakeNodeReader{nodeMap: nodeMap, treeSize: treeSize, treeRevision: treeRevision}
return &FakeNodeReader{nodeMap: nodeMap, treeRevision: treeRevision}
}

// GetMerkleNodes implements the corresponding NodeReader API.
Expand Down Expand Up @@ -146,7 +145,7 @@ func NewMultiFakeNodeReaderFromLeaves(batches []LeafBatch) *MultiFakeNodeReader
nodes = append(nodes, node)
}

readers = append(readers, *NewFakeNodeReader(nodes, tree.Size(), batch.TreeRevision))
readers = append(readers, *NewFakeNodeReader(nodes, batch.TreeRevision))
}

return NewMultiFakeNodeReader(readers)
Expand Down

0 comments on commit 580ab86

Please sign in to comment.