Skip to content

Commit

Permalink
fix: remove tests and update counts
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol committed Feb 2, 2024
1 parent 2a8816f commit 86a1f93
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 100 deletions.
81 changes: 0 additions & 81 deletions pkg/node/statestore_test.go

This file was deleted.

12 changes: 5 additions & 7 deletions pkg/postage/batchstore/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func TestBatchStore_Reset(t *testing.T) {

// we expect one key in the statestore since the schema name
// will always be there.
if c != 1 {
if c != 0 {
t.Fatalf("expected only one key in statestore, got %d", c)
}
}
Expand All @@ -242,11 +242,6 @@ func TestBatchSave(t *testing.T) {
defaultDepth := uint8(8)
defaultValue := 1

type testCase struct {
add []testBatch
name string
}

// Test cases define each batches's depth, value, and the new radius
// of the reserve state after the batch is saved.
// In some cases, batches with zero values are added to check that the radius is not altered.
Expand All @@ -258,7 +253,10 @@ func TestBatchSave(t *testing.T) {
// With two batches of the same depth, the calculation is as such: log2((256 + 256) / 32) = 5.
// The ceiling function is used to round up results so the actual formula is ceil(log2(totalCommitment/node_capacity)) = R

tcs := []testCase{
tcs := []struct {
add []testBatch
name string
}{
{
name: "first batch's depth is below capacity",
add: []testBatch{
Expand Down
5 changes: 0 additions & 5 deletions pkg/statestore/mock/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package mock
import (
"encoding"
"encoding/json"
"fmt"
"strings"
"sync"

Expand All @@ -28,10 +27,6 @@ func NewStateStore() storage.StateStorer {
store: make(map[string][]byte),
}

if err := s.Put(mockSchemaNameKey, "mock_schema"); err != nil {
panic(fmt.Errorf("put schema name: %w", err))
}

return s
}

Expand Down
6 changes: 0 additions & 6 deletions pkg/statestore/storeadapter/storeadapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ func TestStateStoreAdapter(t *testing.T) {
}
})

// The test requires the state store to have
// a schema, otherwise the delete test fails.
if err := store.Put("test_schema", "name"); err != nil {
t.Fatalf("unexpected error: %v", err)
}

return store
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/statestore/test/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,5 @@ func testStoreIterator(t *testing.T, store storage.StateStorer, prefix string, s
func testEmpty(t *testing.T, store storage.StateStorer) {
t.Helper()

testStoreIterator(t, store, "", 1) // 1 because of the schema entry.
testStoreIterator(t, store, "", 0) // 1 because of the schema entry.
}

0 comments on commit 86a1f93

Please sign in to comment.