Skip to content

Commit

Permalink
gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin2112 committed Jan 19, 2017
1 parent 5ad61d2 commit f414dfc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/proof_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func dedupAndFetchNodes(tx storage.NodeReader, treeRevision int64, fetches []mer
}

if len(proofNodeIDs) < len(fetches) {
glog.V(2).Infof("deduplication saved %d node fetch(es)", len(fetches) - len(proofNodeIDs))
glog.V(2).Infof("deduplication saved %d node fetch(es)", len(fetches)-len(proofNodeIDs))
}

// Use the deduplicated list of nodeIDs in the storage fetch
Expand Down
12 changes: 6 additions & 6 deletions server/proof_fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func TestTree32InclusionProofFetchAll(t *testing.T) {
for ts := 2; ts <= 32; ts++ {
mt := treeAtSize(ts)
r := testonly.NewMultiFakeNodeReaderFromLeaves([]testonly.LeafBatch{
{TreeRevision: 3, Leaves: expandLeaves(0, ts - 1), ExpectedRoot: expectedRootAtSize(mt)},
{TreeRevision: 3, Leaves: expandLeaves(0, ts-1), ExpectedRoot: expectedRootAtSize(mt)},
})

for s := 2; s <= ts; s++ {
Expand All @@ -226,7 +226,7 @@ func TestTree32InclusionProofFetchAll(t *testing.T) {
}

// We use +1 here because of the 1 based leaf indexing of this implementation
refProof := mt.PathToRootAtSnapshot(l + 1, s)
refProof := mt.PathToRootAtSnapshot(l+1, s)

if got, want := len(proof.ProofNode), len(refProof); got != want {
t.Fatalf("(%d, %d, %d): got proof len: %d, want: %d: %v\n%v", ts, s, l, got, want, fetches, refProof)
Expand Down Expand Up @@ -265,7 +265,7 @@ func TestTree32InclusionProofFetchMultiBatch(t *testing.T) {
}

// We use +1 here because of the 1 based leaf indexing of this implementation
refProof := mt.PathToRootAtSnapshot(l + 1, s)
refProof := mt.PathToRootAtSnapshot(l+1, s)

if got, want := len(proof.ProofNode), len(refProof); got != want {
t.Fatalf("(%d, %d, %d): got proof len: %d, want: %d: %v\n%v", 32, s, l, got, want, fetches, refProof)
Expand All @@ -284,7 +284,7 @@ func TestTree32ConsistencyProofFetchAll(t *testing.T) {
for ts := 2; ts <= 32; ts++ {
mt := treeAtSize(ts)
r := testonly.NewMultiFakeNodeReaderFromLeaves([]testonly.LeafBatch{
{TreeRevision: 3, Leaves: expandLeaves(0, ts - 1), ExpectedRoot: expectedRootAtSize(mt)},
{TreeRevision: 3, Leaves: expandLeaves(0, ts-1), ExpectedRoot: expectedRootAtSize(mt)},
})

for s1 := 2; s1 < ts; s1++ {
Expand Down Expand Up @@ -334,7 +334,7 @@ func mustCreateNodeID(depth, node int64) storage.NodeID {
}

func expandLeaves(n, m int) []string {
leaves := make([]string, 0, m - n + 1)
leaves := make([]string, 0, m-n+1)
for l := n; l <= m; l++ {
leaves = append(leaves, fmt.Sprintf("Leaf %d", l))
}
Expand All @@ -349,7 +349,7 @@ func expectedRootAtSize(mt *merkle.InMemoryMerkleTree) string {
}

func treeAtSize(n int) *merkle.InMemoryMerkleTree {
leaves := expandLeaves(0, n - 1)
leaves := expandLeaves(0, n-1)
mt := merkle.NewInMemoryMerkleTree(merkle.NewRFC6962TreeHasher(crypto.NewSHA256()))

for _, leaf := range leaves {
Expand Down

0 comments on commit f414dfc

Please sign in to comment.