Skip to content

Commit

Permalink
Fix error handling and fix linting (#1507)
Browse files Browse the repository at this point in the history
* Fix error handling and fix linting.

* Update lint.yml

* Update .golangci.yml

* keep actions same as main

Co-authored-by: billy rennekamp <[email protected]>
  • Loading branch information
faddat and okwme authored Jul 11, 2022
1 parent 198fc5b commit 5609dd1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
11 changes: 5 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ run:
tests: false
skip-dirs:
- tests/e2e
timeout: 5m


linters:
disable-all: true
Expand All @@ -10,21 +12,20 @@ linters:
- deadcode
- depguard
- dogsled
# - errcheck
- errcheck
- exportloopref
- goconst
- gocritic
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- maligned
- misspell
- nakedret
- prealloc
- revive
- scopelint
- staticcheck
- structcheck
Expand All @@ -33,8 +34,6 @@ linters:
- unconvert
- unused
- unparam
# - wsl
- nolintlint

issues:
exclude-rules:
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ var (
// GaiaApp extends an ABCI application, but with most of its parameters exported.
// They are exported for convenience in creating helper functions, as object
// capabilities aren't needed for testing.
type GaiaApp struct { // nolint: golint
type GaiaApp struct { // nolint: revive
*baseapp.BaseApp
legacyAmino *codec.LegacyAmino
appCodec codec.Codec
Expand Down
16 changes: 13 additions & 3 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
feePool.CommunityPool = feePool.CommunityPool.Add(scraps...)
app.DistrKeeper.SetFeePool(ctx, feePool)

app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator())
err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator())
if err != nil {
log.Fatal(err)
}
return false
})

Expand All @@ -123,8 +126,15 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
if err != nil {
panic(err)
}
app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr)
app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr)
err = app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr)
if err != nil {
panic(err)
}
err = app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr)
if err != nil {
panic(err)
}

}

// reset context height
Expand Down

0 comments on commit 5609dd1

Please sign in to comment.