fix(x/consensus)!: update cons params parsing checks (backport #21484) (#21492)

This commit is contained in:
mergify[bot] 2024-08-31 18:48:38 +02:00 committed by GitHub
parent 5d2fcfa65b
commit 5d9c02d7c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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{}