Skip to content

Commit

Permalink
fix(x/swingset): Let migration see the missing param pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 authored Oct 29, 2024
1 parent dd7845b commit 1543f79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion golang/cosmos/x/swingset/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ func (k Keeper) BlockingSend(ctx sdk.Context, action vm.Action) (string, error)
}

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, &params)
// Note the use of "IfExists"...
// migration fills in missing data with defaults,
// so it is the only consumer that should ever see a nil pair.
k.paramSpace.GetParamSetIfExists(ctx, &params)
return params
}

Expand Down

0 comments on commit 1543f79

Please sign in to comment.