fix(x/gov): check right params (#19102)

This commit is contained in:
Julien Robert 2024-01-18 19:11:16 +01:00 committed by GitHub
parent 2a95a4abdd
commit 0698a9fb3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,11 +162,11 @@ func (p Params) ValidateBasic(addressCodec address.Codec) error {
if err != nil {
return fmt.Errorf("invalid expedited threshold string: %w", err)
}
if !threshold.IsPositive() {
return fmt.Errorf("expedited vote threshold must be positive: %s", threshold)
if !expeditedThreshold.IsPositive() {
return fmt.Errorf("expedited vote threshold must be positive: %s", expeditedThreshold)
}
if threshold.GT(sdkmath.LegacyOneDec()) {
return fmt.Errorf("expedited vote threshold too large: %s", threshold)
if expeditedThreshold.GT(sdkmath.LegacyOneDec()) {
return fmt.Errorf("expedited vote threshold too large: %s", expeditedThreshold)
}
if expeditedThreshold.LTE(threshold) {
return fmt.Errorf("expedited vote threshold %s, must be greater than the regular threshold %s", expeditedThreshold, threshold)