Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
firelizzard18 committed Oct 3, 2023
1 parent 6d531fc commit ab80209
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions pkg/database/bpt/bpt_receipt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ func TestBPT_receipt(t *testing.T) {
var keys, values common.RandHash // use the default sequence for keys
values.SetSeed([]byte{1, 2, 3}) // use a different sequence for values
for i := 0; i < numberEntries; i++ { // For the number of Entries specified for the BPT
chainID := keys.NextAList() // Get a key, keep a list
value := values.NextA() // Get some value (don't really care what it is)
bpt.Insert(record.KeyFromHash(chainID), value) // Insert the Key with the value into the BPT
chainID := keys.NextAList() // Get a key, keep a list
value := values.NextA() // Get some value (don't really care what it is)
err := bpt.Insert(record.KeyFromHash(chainID), value) // Insert the Key with the value into the BPT
require.NoError(t, err)
}
require.NoError(t, bpt.Commit())

Expand Down
7 changes: 4 additions & 3 deletions pkg/database/bpt/bpt_savestate_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 The Accumulate Authors
// Copyright 2023 The Accumulate Authors
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
Expand Down Expand Up @@ -47,7 +47,8 @@ func TestSaveState(t *testing.T) {
hash := sha256.Sum256(value)
err := storeTx.Put(record.KeyFromHash(hash), value)
require.NoError(t, err)
bpt.Insert(record.KeyFromHash(chainID), hash) // Insert the Key with the value into the BPT
err = bpt.Insert(record.KeyFromHash(chainID), hash) // Insert the Key with the value into the BPT
require.NoError(t, err)
}
require.NoError(t, bpt.Commit())
storeTx = BDB.Begin(nil, true)
Expand All @@ -58,7 +59,7 @@ func TestSaveState(t *testing.T) {
require.NoError(t, err)
defer f.Close()

SaveSnapshotV1(bpt, f, func(key storage.Key, hash [32]byte) ([]byte, error) {
err = SaveSnapshotV1(bpt, f, func(key storage.Key, hash [32]byte) ([]byte, error) {
return storeTx.Get(record.KeyFromHash(hash))
})
require.NoError(t, err)
Expand Down
9 changes: 5 additions & 4 deletions pkg/database/bpt/iterate_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 The Accumulate Authors
// Copyright 2023 The Accumulate Authors
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
Expand Down Expand Up @@ -35,9 +35,10 @@ func GetRangeFor(t *testing.T, numberEntries, rangeNum int) {
var keys, values common.RandHash // use the default sequence for keys
values.SetSeed([]byte{1, 2, 3}) // use a different sequence for values
for i := 0; i < numberEntries; i++ { // For the number of Entries specified for the BPT
chainID := keys.NextAList() // Get a key, keep a list
value := values.NextA() // Get some value (don't really care what it is)
bpt.Insert(record.KeyFromHash(chainID), value) // Insert the Key with the value into the BPT
chainID := keys.NextAList() // Get a key, keep a list
value := values.NextA() // Get some value (don't really care what it is)
err := bpt.Insert(record.KeyFromHash(chainID), value) // Insert the Key with the value into the BPT
require.NoError(t, err)
}

cnt := 0
Expand Down

0 comments on commit ab80209

Please sign in to comment.