Skip to content

Commit

Permalink
lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Sep 25, 2024
1 parent ae2002c commit 4a3dfcc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions collections/naming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ func TestNaming(t *testing.T) {
}

func expectKeyCodecName[T any](t *testing.T, name string, cdc codec.KeyCodec[T]) {
t.Helper()
schema, err := codec.KeySchemaCodec(cdc)
require.NoError(t, err)
require.Equal(t, 1, len(schema.Fields))
require.Equal(t, name, schema.Fields[0].Name)
}

func expectValueCodecName[T any](t *testing.T, name string, cdc codec.ValueCodec[T]) {
t.Helper()
schema, err := codec.ValueSchemaCodec(cdc)
require.NoError(t, err)
require.Equal(t, 1, len(schema.Fields))
require.Equal(t, name, schema.Fields[0].Name)
}

func expectKeyCodecNames[T any](t *testing.T, cdc codec.KeyCodec[T], names ...string) {
t.Helper()
schema, err := codec.KeySchemaCodec(cdc)
require.NoError(t, err)
require.Equal(t, len(names), len(schema.Fields))
Expand Down
2 changes: 1 addition & 1 deletion schema/indexer/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func unmarshalIndexingConfig(cfg interface{}) (*IndexingConfig, error) {
return &res, err
}

func unmarshalIndexerCustomConfig(cfg interface{}, expectedType interface{}) (interface{}, error) {
func unmarshalIndexerCustomConfig(cfg, expectedType interface{}) (interface{}, error) {
typ := reflect.TypeOf(expectedType)
if reflect.TypeOf(cfg).AssignableTo(typ) {
return cfg, nil
Expand Down
1 change: 1 addition & 0 deletions schema/indexer/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func TestStart(t *testing.T) {
}

func callCommit(t *testing.T, listener appdata.Listener) {
t.Helper()
cb, err := listener.Commit(appdata.CommitData{})
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/evidence/keeper/infraction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func initFixture(tb testing.TB) *fixture {

stakingKeeper.SetHooks(stakingtypes.NewMultiStakingHooks(slashingKeeper.Hooks()))

evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)), stakingKeeper, slashingKeeper, consensusParamsKeeper, addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr))
evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithQueryRouterService(grpcQueryRouter), runtime.EnvWithMsgRouterService(msgRouter)), stakingKeeper, slashingKeeper, consensusParamsKeeper, addresscodec.NewBech32Codec(sdk.Bech32PrefixAccAddr), stakingKeeper.ConsensusAddressCodec())
router := evidencetypes.NewRouter()
router = router.AddRoute(evidencetypes.RouteEquivocation, testEquivocationHandler(evidenceKeeper))
evidenceKeeper.SetRouter(router)
Expand Down
1 change: 0 additions & 1 deletion tools/hubl/internal/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func RemoteCommand(config *config.Config, configDir string) ([]*cobra.Command, e
commands := []*cobra.Command{}

for chain, chainConfig := range config.Chains {
chain, chainConfig := chain, chainConfig

// load chain info
chainInfo := NewChainInfo(configDir, chain, chainConfig)
Expand Down
2 changes: 1 addition & 1 deletion x/evidence/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Keeper struct {
// NewKeeper creates a new Keeper object.
func NewKeeper(
cdc codec.BinaryCodec, env appmodule.Environment, stakingKeeper types.StakingKeeper,
slashingKeeper types.SlashingKeeper, ck types.ConsensusKeeper, ac address.Codec, consensusAddressCodec address.Codec,
slashingKeeper types.SlashingKeeper, ck types.ConsensusKeeper, ac, consensusAddressCodec address.Codec,
) *Keeper {
sb := collections.NewSchemaBuilder(env.KVStoreService)
k := &Keeper{
Expand Down

0 comments on commit 4a3dfcc

Please sign in to comment.