Skip to content

Commit

Permalink
Merge pull request #10 from initia-labs/fix/test
Browse files Browse the repository at this point in the history
fix: ante test
  • Loading branch information
beer-1 authored Nov 10, 2023
2 parents 7bf026e + 876cd53 commit 28cb9e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x/move/ante/fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ func (suite *AnteTestSuite) TestEnsureMempoolFees() {
tx, err := suite.CreateTestTx(privs, accNums, accSeqs, suite.ctx.ChainID())
suite.Require().NoError(err)

suite.txBuilder.SetFeeAmount(atomFeeAmount)
tx2, err := suite.CreateTestTx(privs, accNums, accSeqs, suite.ctx.ChainID())
suite.Require().NoError(err)

// Set high gas price so standard test fee fails
// gas price = 0.004
basePrice := sdk.NewDecCoinFromDec(baseDenom, sdk.NewDecWithPrec(4, 3))
Expand Down Expand Up @@ -135,7 +131,9 @@ func (suite *AnteTestSuite) TestEnsureMempoolFees() {
_, _, err = fc.CheckTxFeeWithMinGasPrices(suite.ctx, tx)
suite.Require().Nil(err, "Decorator should not have errored on fee higher than local gasPrice")

_, _, err = fc.CheckTxFeeWithMinGasPrices(suite.ctx, tx2)
suite.txBuilder.SetFeeAmount(atomFeeAmount)
suite.Require().Equal(atomFeeAmount, tx.GetFee())
_, _, err = fc.CheckTxFeeWithMinGasPrices(suite.ctx, tx)
suite.Require().Nil(err, "Decorator should not have errored on fee higher than local gasPrice")

// set high base_min_gas_price to test should be failed
Expand All @@ -146,6 +144,8 @@ func (suite *AnteTestSuite) TestEnsureMempoolFees() {
baseMinGasPrice: sdk.NewDecWithPrec(4, 3),
})

suite.txBuilder.SetFeeAmount(feeAmount)
suite.Require().Equal(feeAmount, tx.GetFee())
_, _, err = fc.CheckTxFeeWithMinGasPrices(suite.ctx, tx)
suite.Require().NotNil(err, "Decorator should have errored on too low fee for local gasPrice")
}

0 comments on commit 28cb9e4

Please sign in to comment.