mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
add check balance method to TestApp
This commit is contained in:
parent
2d73e62773
commit
4662123105
@ -2,6 +2,9 @@ package app
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
abci "github.com/tendermint/tendermint/abci/types"
|
abci "github.com/tendermint/tendermint/abci/types"
|
||||||
"github.com/tendermint/tendermint/crypto"
|
"github.com/tendermint/tendermint/crypto"
|
||||||
@ -107,6 +110,11 @@ func (tApp TestApp) InitializeFromGenesisStates(genesisStates ...GenesisState) T
|
|||||||
return tApp
|
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.
|
// GeneratePrivKeyAddressPairsFromRand generates (deterministically) a total of n private keys and addresses.
|
||||||
// TODO only generate secp256 keys?
|
// TODO only generate secp256 keys?
|
||||||
func GeneratePrivKeyAddressPairs(n int) (keys []crypto.PrivKey, addrs []sdk.AccAddress) {
|
func GeneratePrivKeyAddressPairs(n int) (keys []crypto.PrivKey, addrs []sdk.AccAddress) {
|
||||||
|
Loading…
Reference in New Issue
Block a user