Add support for using auto fee calculation #22

Merged
nabarun merged 19 commits from deep-stack/registry-sdk:iv-add-tx-info-test into main 2024-09-06 09:07:58 +00:00
Showing only changes of commit b7795b8327 - Show all commits

View File

@ -44,9 +44,7 @@ const registryTests = () => {
expect(quantity).toBe('10000'); expect(quantity).toBe('10000');
}); });
test('Get transaction info.', async () => { test('Send batch txs.', async () => {
const bondAmount = '100000';
const accounts = await createAccounts(10); const accounts = await createAccounts(10);
for (let i = 0; i < 10; i++) { 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); 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[]> => { const createAccounts = async (numAccounts: number): Promise<Account[]> => {