diff --git a/app/test_common.go b/app/test_common.go index 6980260b..af345f28 100644 --- a/app/test_common.go +++ b/app/test_common.go @@ -2,6 +2,9 @@ package app import ( "math/rand" + "testing" + + "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto" @@ -107,6 +110,11 @@ func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) T return tApp } +func (tApp TestApp) CheckBalance(t *testing.T, ctx sdk.Context, owner sdk.AccAddress, expectedCoins sdk.Coins) { + actualCoins := tApp.GetAccountKeeper().GetAccount(ctx, owner).GetCoins() + require.Equal(t, expectedCoins, actualCoins) +} + // GeneratePrivKeyAddressPairsFromRand generates (deterministically) a total of n private keys and addresses. // TODO only generate secp256 keys? func GeneratePrivKeyAddressPairs(n int) (keys []crypto.PrivKey, addrs []sdk.AccAddress) {