Skip to content

Commit

Permalink
chore: fix errors reported by running make lint (cosmos#21015)
Browse files Browse the repository at this point in the history
  • Loading branch information
Halimao authored Jul 22, 2024
1 parent ba7e6be commit c2df06c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions indexer/postgres/tests/init_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import (

embeddedpostgres "github.com/fergusstrange/embedded-postgres"
"github.com/hashicorp/consul/sdk/freeport"

// this is where we get our pgx database driver from
_ "github.com/jackc/pgx/v5/stdlib"
_ "github.com/jackc/pgx/v5/stdlib" // this is where we get our pgx database driver from
"github.com/stretchr/testify/require"
"gotest.tools/v3/golden"

Expand Down
6 changes: 4 additions & 2 deletions schema/decoding/decoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestMiddleware_filtered(t *testing.T) {
tl := newTestFixture(t)
listener, err := Middleware(tl.Listener, tl.resolver, MiddlewareOptions{
ModuleFilter: func(moduleName string) bool {
return moduleName == "one"
return moduleName == "one" //nolint:goconst // adding constants for this would impede readability
},
})
if err != nil {
Expand Down Expand Up @@ -176,6 +176,7 @@ type testFixture struct {
}

func newTestFixture(t *testing.T) *testFixture {
t.Helper()
res := &testFixture{}
res.Listener = appdata.Listener{
InitializeModuleData: func(data appdata.ModuleInitializationData) error {
Expand Down Expand Up @@ -246,7 +247,7 @@ func newTestMultiStore() *testMultiStore {

var _ SyncSource = &testMultiStore{}

func (ms *testMultiStore) IterateAllKVPairs(moduleName string, fn func(key []byte, value []byte) error) error {
func (ms *testMultiStore) IterateAllKVPairs(moduleName string, fn func(key, value []byte) error) error {
s, ok := ms.stores[moduleName]
if !ok {
return fmt.Errorf("don't have state for module %s", moduleName)
Expand All @@ -267,6 +268,7 @@ func (ms *testMultiStore) IterateAllKVPairs(moduleName string, fn func(key []byt
}

func (ms *testMultiStore) newTestStore(t *testing.T, modName string) *testStore {
t.Helper()
s := &testStore{
t: t,
modName: modName,
Expand Down
1 change: 0 additions & 1 deletion schema/decoding/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestModuleSetDecoderResolver_IterateAll(t *testing.T) {
objectTypes[cdc.Schema.ObjectTypes[0].Name] = true
return nil
})

if err != nil {
t.Fatalf("unexpected error: %v", err)
}
Expand Down
1 change: 0 additions & 1 deletion schema/decoding/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
// SyncSource is an interface that allows indexers to start indexing modules with pre-existing state.
// It should generally be a wrapper around the key-value store.
type SyncSource interface {

// IterateAllKVPairs iterates over all key-value pairs for a given module.
IterateAllKVPairs(moduleName string, fn func(key, value []byte) error) error
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
func setupContinousAccount(t *testing.T, ctx context.Context, ss store.KVStoreService) *ContinuousLockingAccount {
t.Helper()
deps := makeMockDependencies(ss)
owner := "owner"
owner := "owner" //nolint:goconst // adding constants for this would impede readability

acc, err := NewContinuousLockingAccount(deps)
require.NoError(t, err)
Expand Down

0 comments on commit c2df06c

Please sign in to comment.