Skip to content

Commit

Permalink
Add fees for mint test accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed May 8, 2022
1 parent 970eb25 commit 289b1dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/wasm/test/custom_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package wasm

import (
"encoding/json"
"github.com/osmosis-labs/osmosis/v7/x/tokenfactory/types"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -22,6 +23,10 @@ func TestMintMsg(t *testing.T) {
reflect := instantiateReflectContract(t, ctx, osmosis, lucky)
require.NotEmpty(t, reflect)

// Fund reflect contract with 100 base denom creation fees
reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
fundAccount(t, ctx, osmosis, reflect, reflectAmount)

// lucky was broke
balances := osmosis.BankKeeper.GetAllBalances(ctx, lucky)
require.Empty(t, balances)
Expand Down
7 changes: 6 additions & 1 deletion app/wasm/test/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/osmosis-labs/osmosis/v7/app/wasm"
wasmbindings "github.com/osmosis-labs/osmosis/v7/app/wasm/bindings"
"github.com/stretchr/testify/assert"
"github.com/osmosis-labs/osmosis/v7/x/tokenfactory/types"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestMint(t *testing.T) {
actor := RandomAccountAddress()
osmosis, ctx := SetupCustomApp(t, actor)

// Fund actor with 100 base denom creation fees
actorAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
fundAccount(t, ctx, osmosis, actor, actorAmount)

lucky := RandomAccountAddress()

// lucky was broke
Expand Down

0 comments on commit 289b1dd

Please sign in to comment.