diff --git a/tests/helpers.ts b/tests/helpers.ts index ceb47f812..41059f66a 100644 --- a/tests/helpers.ts +++ b/tests/helpers.ts @@ -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))