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

fake_node_reader: Remove unused field #1631

Merged
merged 1 commit into from
May 23, 2019
Merged
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
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