Skip to content

Commit

Permalink
Add mint same denom twice check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed May 10, 2022
1 parent bff2f7e commit 44f26ed
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/wasm/test/custom_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@ func TestMintMsg(t *testing.T) {
queryCustom(t, ctx, osmosis, reflect, query, &resp)

require.Equal(t, resp.Denom, coin.Denom)

// mint the same denom again
err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
require.NoError(t, err)

balances = osmosis.BankKeeper.GetAllBalances(ctx, lucky)
require.Len(t, balances, 1)
coin = balances[0]
require.Equal(t, amount.MulRaw(2), coin.Amount)
require.Contains(t, coin.Denom, "factory/")

// query the denom and see if it matches
query = wasmbindings.OsmosisQuery{
FullDenom: &wasmbindings.FullDenom{
Contract: reflect.String(),
SubDenom: "SUN",
},
}
resp = wasmbindings.FullDenomResponse{}
queryCustom(t, ctx, osmosis, reflect, query, &resp)

require.Equal(t, resp.Denom, coin.Denom)
}

type BaseState struct {
Expand Down

0 comments on commit 44f26ed

Please sign in to comment.