Skip to content

Commit

Permalink
avoid nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Aug 10, 2024
1 parent fc8c7fa commit 5d2074e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,10 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo
got := app.mm.EndBlock(ctx, req)
upgradeHeight := int64(3)
if req.Height == upgradeHeight {
fmt.Printf("HACKHACK: v1 application should upgrade to v2 at hard-coded upgrade height %v\n", upgradeHeight)
got.ConsensusParamUpdates.Version.AppVersion = 2
fmt.Printf("v1 application should upgrade to v2 at hard-coded upgrade height %v\n", upgradeHeight)
consensusParamUpdates := app.GetConsensusParams(ctx)
consensusParamUpdates.Version.AppVersion = 2
got.ConsensusParamUpdates = consensusParamUpdates
}
if got.ConsensusParamUpdates == nil || got.ConsensusParamUpdates.Version == nil {
fmt.Printf("EndBlocker returning nil consensus param updates\n")
Expand Down

0 comments on commit 5d2074e

Please sign in to comment.