Skip to content

Commit

Permalink
fix(x/consensus)!: update cons params parsing checks (#21484)
Browse files Browse the repository at this point in the history
(cherry picked from commit f79b380)
  • Loading branch information
MSalopek authored and mergify[bot] committed Aug 31, 2024
1 parent 5d2fcfa commit 3c10068
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/consensus/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ func (k Keeper) paramCheck(ctx context.Context, consensusParams cmtproto.Consens

paramsProto, err := k.ParamsStore.Get(ctx)
if err == nil {
// initialize version params with zero value if not set
if paramsProto.Version == nil {
paramsProto.Version = &cmtproto.VersionParams{}
}
params = cmttypes.ConsensusParamsFromProto(paramsProto)
} else if errors.Is(err, collections.ErrNotFound) {
params = cmttypes.ConsensusParams{}
Expand Down

0 comments on commit 3c10068

Please sign in to comment.