Skip to content

Commit

Permalink
test: Update multi-fee coin test for both ukava and usdt
Browse files Browse the repository at this point in the history
  • Loading branch information
drklee3 committed Sep 26, 2024
1 parent 5d4c339 commit def00fd
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion app/ante/fee_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ func TestDeductFees(t *testing.T) {
"",
},
{
"valid single fee, multiple min gas prices",
// Existing gas coin unaffected
"valid single ukava fee, multiple min gas prices",
func(s *AnteTestSuite) {
s.bankKeeper.EXPECT().
SendCoinsFromAccountToModule(
Expand All @@ -174,6 +175,11 @@ func TestDeductFees(t *testing.T) {
},
sdk.NewDecCoins(
sdk.NewDecCoinFromDec("ukava", sdk.MustNewDecFromStr("0.001")),
// akava is removed from the min gas prices in `EvmMinGasFilter`
// but only to support 0ukava gas prices. Ensuring that the fee
// still works as expected even if it is present in case
// `EvmMinGasFilter` is removed.
sdk.NewDecCoinFromDec("akava", sdk.MustNewDecFromStr("10000000000")),
sdk.NewDecCoinFromDec("usdt", sdk.MustNewDecFromStr("0.003")),
),
legacytx.NewStdFee( //nolint:staticcheck // deprecated StdFee still in use
Expand All @@ -182,6 +188,29 @@ func TestDeductFees(t *testing.T) {
),
"",
},
{
"valid single usdt fee, multiple min gas prices",
func(s *AnteTestSuite) {
s.bankKeeper.EXPECT().
SendCoinsFromAccountToModule(
gomock.Any(),
gomock.Any(),
gomock.Any(),
gomock.Any(),
).
Return(nil)
},
sdk.NewDecCoins(
sdk.NewDecCoinFromDec("ukava", sdk.MustNewDecFromStr("0.001")),
sdk.NewDecCoinFromDec("akava", sdk.MustNewDecFromStr("10000000000")),
sdk.NewDecCoinFromDec("usdt", sdk.MustNewDecFromStr("0.003")),
),
legacytx.NewStdFee( //nolint:staticcheck // deprecated StdFee still in use
100000,
sdk.NewCoins(sdk.NewInt64Coin("usdt", 100)),
),
"",
},
{
"insufficient single fee, multiple min gas prices",
func(_ *AnteTestSuite) {},
Expand Down

0 comments on commit def00fd

Please sign in to comment.