From 3cb01bca637d42fc0c1296e3a2a69f64a66b68c5 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Mon, 20 Feb 2023 08:41:12 -0500 Subject: [PATCH] always create new bond with provisionBondId helper call --- src/testing/helper.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/testing/helper.ts b/src/testing/helper.ts index a3e87a2..9ddaed2 100644 --- a/src/testing/helper.ts +++ b/src/testing/helper.ts @@ -24,15 +24,18 @@ export const getBaseConfig = async (path: string) => { * Provision a bond for record registration. */ export const provisionBondId = async (registry: Registry, privateKey: string, fee: Fee) => { - let bonds = await registry.queryBonds(); - console.log("found bonds: " + bonds.length) - if (!bonds.length) { - await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); - bonds = await registry.queryBonds(); - console.log("created bond and got back: " + bonds.length) - } - - return bonds[0].id; + // let bonds = await registry.queryBonds(); + // console.log("found bonds: " + bonds.length) + // if (!bonds.length) { + // await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); + // bonds = await registry.queryBonds(); + // console.log("created bond and got back: " + bonds.length) + // } + let bondId: string; + bondId = await registry.getNextBondId(privateKey); + await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); + return bondId + //return bonds[0].id; }; export const getConfig = () => {