forked from cerc-io/laconicd-deprecated
imp(feemarket): min-gas-multiplier parameter should accept zero value (#1120)
* min-gas-multiplier parameter should accept zero value update min-gas-multiplier validation logic * fix unit test * changelog Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
b3fa23e6cb
commit
82835307c7
@ -42,6 +42,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
* (evm) [tharsis#1118](https://github.com/tharsis/ethermint/pull/1118) Fix `Type()` `Account` method `EmptyCodeHash` comparison
|
||||
|
||||
### Improvements
|
||||
|
||||
- (feemarket) [tharsis#1120](https://github.com/tharsis/ethermint/pull/1120) Make `min-gas-multiplier` parameter accept zero value
|
||||
|
||||
## [v0.16.0] - 2022-06-06
|
||||
|
||||
### State Machine Breaking
|
||||
|
@ -189,12 +189,12 @@ func validateMinGasMultiplier(i interface{}) error {
|
||||
return fmt.Errorf("invalid parameter: nil")
|
||||
}
|
||||
|
||||
if v.IsZero() || v.IsNegative() {
|
||||
return fmt.Errorf("value cannot be zero or negative: %T", i)
|
||||
if v.IsNegative() {
|
||||
return fmt.Errorf("value cannot be negative: %s", v)
|
||||
}
|
||||
|
||||
if v.GT(sdk.OneDec()) {
|
||||
return fmt.Errorf("value cannot be greater than 1: %T", i)
|
||||
return fmt.Errorf("value cannot be greater than 1: %s", v)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -49,12 +49,17 @@ func (suite *ParamsTestSuite) TestParamsValidate() {
|
||||
true,
|
||||
},
|
||||
{
|
||||
"invalid: min gas multiplier zero",
|
||||
"valid: min gas multiplier zero",
|
||||
NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdk.ZeroDec()),
|
||||
false,
|
||||
},
|
||||
{
|
||||
"invalid: min gas multiplier is negative",
|
||||
NewParams(true, 7, 3, 2000000000, int64(544435345345435345), DefaultMinGasPrice, sdk.NewDecWithPrec(-5, 1)),
|
||||
true,
|
||||
},
|
||||
{
|
||||
"invalid: min gas multiplier",
|
||||
"invalid: min gas multiplier bigger than 1",
|
||||
NewParams(true, 7, 3, 2000000000, int64(544435345345435345), sdk.NewDecWithPrec(20, 4), sdk.NewDec(2)),
|
||||
true,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user