diff --git a/CHANGELOG.md b/CHANGELOG.md index a2aecf968e..dd97bdf733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,6 +121,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ - [1156](https://github.com/umee-network/umee/pull/1156) Propagate context correctly. - [1288](https://github.com/umee-network/umee/pull/1288) Safeguards LastInterestTime against time reversals and unintended interest from hard forks. - [1357](https://github.com/umee-network/umee/pull/1357) Interptex x/0 collateral liquidity as 100% +- [1383](https://github.com/umee-network/umee/pull/1383) Remove potential panic during FeeAndPriority error case. ## [v2.0.2](https://github.com/umee-network/umee/releases/tag/v2.0.2) - 2022-05-13 diff --git a/ante/ante_test.go b/ante/ante_test.go index ed513f321f..f7b6938b37 100644 --- a/ante/ante_test.go +++ b/ante/ante_test.go @@ -21,11 +21,10 @@ import ( type IntegrationTestSuite struct { suite.Suite - app *umeeapp.UmeeApp - anteHandler sdk.AnteHandler - ctx sdk.Context - clientCtx client.Context - txBuilder client.TxBuilder + app *umeeapp.UmeeApp + ctx sdk.Context + clientCtx client.Context + txBuilder client.TxBuilder } func (s *IntegrationTestSuite) SetupTest() { diff --git a/ante/fee.go b/ante/fee.go index 1ddba04b41..cf2bbf0663 100644 --- a/ante/fee.go +++ b/ante/fee.go @@ -36,16 +36,10 @@ func FeeAndPriority(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) { return sdk.Coins{}, priority, nil } - var err error if ctx.IsCheckTx() { - err = checkFees(ctx.MinGasPrices(), providedFees, gasLimit) - } else { - err = checkFees(nil, providedFees, gasLimit) - } - if err != nil { - err = sdkerrors.Wrap(err, msgs[0].String()) + return providedFees, priority, checkFees(ctx.MinGasPrices(), providedFees, gasLimit) } - return providedFees, priority, err + return providedFees, priority, checkFees(nil, providedFees, gasLimit) } func checkFees(minGasPrices sdk.DecCoins, fees sdk.Coins, gasLimit uint64) error {