debugging statements for provisionBondId (#34)

* debugging statements for provisionBondId

* always create new bond with provisionBondId helper call
This commit is contained in:
Michael 2023-03-06 16:30:04 -05:00 committed by GitHub
parent db3f9707d2
commit 81f45e95a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,13 +24,18 @@ export const getBaseConfig = async (path: string) => {
* Provision a bond for record registration. * Provision a bond for record registration.
*/ */
export const provisionBondId = async (registry: Registry, privateKey: string, fee: Fee) => { export const provisionBondId = async (registry: Registry, privateKey: string, fee: Fee) => {
let bonds = await registry.queryBonds(); // let bonds = await registry.queryBonds();
if (!bonds.length) { // console.log("found bonds: " + bonds.length)
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); // if (!bonds.length) {
bonds = await registry.queryBonds(); // 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 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 = () => { export const getConfig = () => {