Skip to content

Commit

Permalink
adjust lint
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Feb 3, 2024
1 parent e482b42 commit 00a70f5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
15 changes: 9 additions & 6 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
if err != nil {
panic(err)
}
_, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr)

if _, err = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr); err != nil {
panic(err)
}
}

// clear validator slash events
Expand Down Expand Up @@ -121,10 +124,7 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
if err != nil {
panic(err)
}
delAddr, err := sdk.AccAddressFromBech32(del.DelegatorAddress)
if err != nil {
panic(err)
}
delAddr := sdk.MustAccAddressFromBech32(del.DelegatorAddress)

if err := app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil {
// never called as BeforeDelegationCreated always returns nil
Expand Down Expand Up @@ -185,7 +185,10 @@ func (app *BandApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
counter++
}

iter.Close()
if err := iter.Close(); err != nil {
app.Logger().Error("error while closing the key-value store reverse prefix iterator: ", err)
return
}

_, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion benchmark/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ func InitializeBenchmarkApp(tb testing.TB, maxGasPerBlock int64) *BenchmarkApp {
ba.Did = uint64(did)

// activate oracle
_, _, _ = ba.DeliverMsg(ba.Validator, GenMsgActivate(ba.Validator))
_, _, err = ba.DeliverMsg(ba.Validator, GenMsgActivate(ba.Validator))
require.NoError(tb, err)

ba.CallEndBlock()
ba.Commit()
Expand Down
3 changes: 2 additions & 1 deletion testing/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ func (chain *TestChain) SendReport(
chain.NextBlock()

// increment sequence for successful transaction execution
_ = senderAccount.SetSequence(senderAccount.GetSequence() + 1)
err = senderAccount.SetSequence(senderAccount.GetSequence() + 1)
require.NoError(chain.t, err)

chain.Coordinator.IncrementTime()

Expand Down
4 changes: 3 additions & 1 deletion x/globalfee/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ func (a AppModuleBasic) ValidateGenesis(
}

func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
_ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
panic(err)
}
}

func (a AppModuleBasic) GetTxCmd() *cobra.Command {
Expand Down
4 changes: 3 additions & 1 deletion x/oracle/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the oracle module.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
_ = types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
panic(err)
}
}

// GetTxCmd returns cobra CLI command to send txs for this module (SDK AppModuleBasic interface).
Expand Down

0 comments on commit 00a70f5

Please sign in to comment.