use setInterval to wait for deploy complete

This commit is contained in:
Jonathan Rainville 2018-07-26 08:59:34 -04:00 committed by Iuri Matias
parent 40c363a310
commit d14630f636
1 changed files with 12 additions and 6 deletions

View File

@ -17,22 +17,28 @@ config({
"args": ["$ENSRegistry", rootNode],
"onDeploy": [
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => {
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
Resolver.methods.setAddr('${rootNode}', '${address}').send();
})`
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
Resolver.methods.setAddr('${rootNode}', '${address}').send().then(() => {
global.ensTestReady = true;
});
});`
]
}
}
});
contract("ENS", function () {
this.timeout(0);
this.timeout(1000);
before(function (done) {
// Wait for onDeploy to finish
setTimeout(function () {
const wait = setInterval(() => {
if (!global.ensTestReady) {
return;
}
clearInterval(wait);
done();
}, 500);
});
});
it("should have registered embark.eth", async function () {