diff --git a/src/index.test.ts b/src/index.test.ts index 0d846fc..7a3c1bf 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -43,6 +43,37 @@ const registryTests = () => { expect(type).toBe(DENOM); expect(quantity).toBe('10000'); }); + + test('Get transaction info.', async () => { + const bondAmount = '100000'; + + const accounts = await createAccounts(10); + + for (let i = 0; i < 10; i++) { + const amount = (10 ** (15 - i)).toString(); + const fromAccount = i === 0 ? privateKey : accounts[i - 1].getPrivateKey(); + + 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); + }); + + const createAccounts = async (numAccounts: number): Promise => { + const accounts: Account[] = []; + + for (let i = 0; i < numAccounts; i++) { + const mnemonic = Account.generateMnemonic(); + const account = await Account.generateFromMnemonic(mnemonic); + await account.init(); + accounts.push(account); + } + + return accounts; + }; }; describe('Registry', registryTests);