forked from cerc-io/registry-sdk
Add test to check block height for all txs
This commit is contained in:
parent
e29143b1e5
commit
ae787decb9
@ -44,9 +44,7 @@ const registryTests = () => {
|
||||
expect(quantity).toBe('10000');
|
||||
});
|
||||
|
||||
test('Get transaction info.', async () => {
|
||||
const bondAmount = '100000';
|
||||
|
||||
test('Send batch txs.', async () => {
|
||||
const accounts = await createAccounts(10);
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
@ -55,11 +53,16 @@ const registryTests = () => {
|
||||
|
||||
await registry.sendCoins({ denom: DENOM, amount, destinationAddress: accounts[i].address }, fromAccount, fee);
|
||||
}
|
||||
const bondPromises = accounts.map((account) =>
|
||||
registry.createBond({ denom: DENOM, amount: bondAmount }, account.getPrivateKey(), fee)
|
||||
);
|
||||
|
||||
await Promise.all(bondPromises);
|
||||
await Promise.all(accounts.map((account) =>
|
||||
registry.createBond({ denom: DENOM, amount: '100000' }, account.getPrivateKey(), fee)
|
||||
));
|
||||
|
||||
const laconicClient = await registry.getLaconicClient(accounts[0]);
|
||||
const bondTx = await laconicClient.searchTx('message.action="/cerc.bond.v1.MsgCreateBond"');
|
||||
|
||||
const expectedBlockHeight = bondTx[0].height;
|
||||
expect(bondTx.every(tx => tx.height === expectedBlockHeight)).toBe(true);
|
||||
});
|
||||
|
||||
const createAccounts = async (numAccounts: number): Promise<Account[]> => {
|
||||
|
Loading…
Reference in New Issue
Block a user