Skip to content

Commit

Permalink
Reconnecting before deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed May 27, 2022
1 parent f2ab905 commit aac1968
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ export const setupProxy = (contract, proxy): Contract => {
return patchContractMethods(proxied_contract);
}

function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

export const setupContract = async (name, constructor, ...args) => {
await api.disconnect();
await timeout(100);
await api.connect();
const one = new BN(10).pow(new BN(api.registry.chainDecimals[0]))
const signers = await getSigners()
const defaultSigner = await getRandomSigner(signers[0], one.muln(10))
Expand Down

0 comments on commit aac1968

Please sign in to comment.