Skip to content

Commit 45c2c67

Browse files
committed
fix lint errors.
1 parent 57d2382 commit 45c2c67

10 files changed

Lines changed: 16 additions & 37 deletions

File tree

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "2" # required for golangci-lint v2+
1+
version: "2"
22

33
run:
44
tests: false

simapp/app.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ func NewSimApp(
493493
// must be passed by reference here.
494494
app.mm = module.NewManager(
495495
genutil.NewAppModule(
496-
app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx,
496+
app.AccountKeeper, app.StakingKeeper, app.DeliverTx,
497497
txConfig,
498498
),
499499
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
@@ -740,12 +740,12 @@ func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICon
740740

741741
// RegisterTxService implements the Application.RegisterTxService method.
742742
func (app *SimApp) RegisterTxService(clientCtx client.Context) {
743-
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
743+
authtx.RegisterTxService(app.GRPCQueryRouter(), clientCtx, app.Simulate, app.interfaceRegistry)
744744
}
745745

746746
// RegisterTendermintService implements the Application.RegisterTendermintService method.
747747
func (app *SimApp) RegisterTendermintService(clientCtx client.Context) {
748-
tmservice.RegisterTendermintService(clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, app.Query)
748+
tmservice.RegisterTendermintService(clientCtx, app.GRPCQueryRouter(), app.interfaceRegistry, app.Query)
749749
}
750750

751751
func (app *SimApp) RegisterNodeService(clientCtx client.Context) {

simapp/export.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,17 @@ func (app *SimApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAd
3939
AppState: appState,
4040
Validators: validators,
4141
Height: height,
42-
ConsensusParams: app.BaseApp.GetConsensusParams(ctx),
42+
ConsensusParams: app.GetConsensusParams(ctx),
4343
}, err
4444
}
4545

4646
// prepare for fresh start at zero height
4747
// NOTE zero height genesis is a temporary feature which will be deprecated
4848
//
49-
// in favour of export at a block height
49+
// in favor of export at a block height
5050
func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
51-
applyAllowedAddrs := false
52-
5351
// check if there is a allowed address list
54-
if len(jailAllowedAddrs) > 0 {
55-
applyAllowedAddrs = true
56-
}
52+
applyAllowedAddrs := len(jailAllowedAddrs) > 0
5753

5854
allowedAddrsMap := make(map[string]bool)
5955

simapp/test_helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func initAccountWithCoins(app *SimApp, ctx sdk.Context, addr sdk.AccAddress, coi
247247

248248
// CheckBalance checks the balance of an account.
249249
func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, balances sdk.Coins) {
250-
ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{})
250+
ctxCheck := app.NewContext(true, tmproto.Header{})
251251
require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr)))
252252
}
253253

@@ -257,7 +257,7 @@ func NewTestNetworkFixture() network.TestFixture {
257257
if err != nil {
258258
panic(fmt.Sprintf("failed creating temporary directory: %v", err))
259259
}
260-
defer os.RemoveAll(dir)
260+
defer os.RemoveAll(dir) //nolint:errcheck
261261

262262
app := NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(dir))
263263

simapp/test_suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type KeeperTestHelper struct {
2222
// Setup sets up basic environment for suite (App, Ctx, and test accounts)
2323
func (s *KeeperTestHelper) Setup() {
2424
s.App = SetupNoBlocks(s.T(), false)
25-
s.Ctx = s.App.BaseApp.NewContext(false, tmproto.Header{Height: 1, ChainID: "core-1", Time: time.Now().UTC()})
25+
s.Ctx = s.App.NewContext(false, tmproto.Header{Height: 1, ChainID: "core-1", Time: time.Now().UTC()})
2626

2727
s.QueryHelper = &baseapp.QueryServiceTestHelper{
2828
GRPCQueryRouter: s.App.GRPCQueryRouter(),

x/epochs/keeper/epoch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (k Keeper) IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo
7575
store := ctx.KVStore(k.storeKey)
7676

7777
iterator := sdk.KVStorePrefixIterator(store, types.KeyPrefixEpoch)
78-
defer iterator.Close()
78+
defer iterator.Close() //nolint:errcheck
7979

8080
i := int64(0)
8181

x/epochs/keeper/grpc_query.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (q Querier) EpochInfos(c context.Context, _ *types.QueryEpochsInfoRequest)
2929
ctx := sdk.UnwrapSDKContext(c)
3030

3131
return &types.QueryEpochsInfoResponse{
32-
Epochs: q.Keeper.AllEpochInfos(ctx),
32+
Epochs: q.AllEpochInfos(ctx),
3333
}, nil
3434
}
3535

@@ -45,7 +45,7 @@ func (q Querier) CurrentEpoch(c context.Context, req *types.QueryCurrentEpochReq
4545

4646
ctx := sdk.UnwrapSDKContext(c)
4747

48-
info := q.Keeper.GetEpochInfo(ctx, req.Identifier)
48+
info := q.GetEpochInfo(ctx, req.Identifier)
4949
if info.Identifier != req.Identifier {
5050
return nil, errors.New("not available identifier")
5151
}

x/epochs/module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ purpose of `epochs` module is to allow other modules to set that they
44
would like to be signaled once every period. So another module can
55
specify it wants to execute code once a week, starting at UTC-time = x.
66
`epochs` creates a generalized epoch interface to other modules so that
7-
they can easily be signalled upon such events.
7+
they can easily be signaled upon such events.
88
- Contains functionality for querying epoch.
99
- Events for BeginBlock and EndBlock.
1010
- Initialization for epoch-related infos.

x/interchainquery/module.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package interchainquery
22

33
import (
4-
"context"
54
"encoding/json"
65

76
abci "github.com/cometbft/cometbft/abci/types"
@@ -68,12 +67,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod
6867
}
6968

7069
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.
71-
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
72-
err := types.RegisterQuerySrvrHandlerClient(context.Background(), mux, types.NewQuerySrvrClient(clientCtx))
73-
if err != nil {
74-
panic(err)
75-
}
76-
}
70+
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {}
7771

7872
// GetTxCmd returns the capability module's root tx command.
7973
func (a AppModuleBasic) GetTxCmd() *cobra.Command {

x/oracle/module.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package oracle
22

33
import (
4-
"context"
54
"encoding/json"
6-
"fmt"
75

86
abci "github.com/cometbft/cometbft/abci/types"
97
"github.com/cosmos/cosmos-sdk/client"
@@ -63,21 +61,12 @@ func (AppModuleBasic) ValidateGenesis(
6361
config client.TxEncodingConfig,
6462
bz json.RawMessage,
6563
) error {
66-
var genState types.GenesisState
67-
if err := cdc.UnmarshalJSON(bz, &genState); err != nil {
68-
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
69-
}
70-
7164
return nil
7265
}
7366

7467
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the x/oracle
7568
// module.
76-
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
77-
if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
78-
panic(err)
79-
}
80-
}
69+
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {}
8170

8271
// GetTxCmd returns the x/oracle module's root tx command.
8372
func (AppModuleBasic) GetTxCmd() *cobra.Command { return nil }

0 commit comments

Comments
 (0)