diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b5f366dd52..7352c385c01e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Bug Fixes + +* (x/mint) [#12384](https://github.com/cosmos/cosmos-sdk/pull/12384) Ensure `GoalBonded` must be positive when performing `x/mint` parameter validation. + ## [v0.45.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.6) - 2022-06-28 ### Improvements diff --git a/x/mint/types/params.go b/x/mint/types/params.go index f0f9ef494bb9..be3d189c4e3b 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -171,8 +171,8 @@ func validateGoalBonded(i interface{}) error { return fmt.Errorf("invalid parameter type: %T", i) } - if v.IsNegative() { - return fmt.Errorf("goal bonded cannot be negative: %s", v) + if v.IsNegative() || v.IsZero() { + return fmt.Errorf("goal bonded must be positive: %s", v) } if v.GT(sdk.OneDec()) { return fmt.Errorf("goal bonded too large: %s", v)