mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-02 10:25:21 +00:00
Update ENS test using global
This commit is contained in:
parent
de57e48cff
commit
51a1395316
@ -18,9 +18,7 @@ config({
|
|||||||
"onDeploy": [
|
"onDeploy": [
|
||||||
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => {
|
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => {
|
||||||
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
|
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
|
||||||
Resolver.methods.setAddr('${rootNode}', '${address}').send().then(() => {
|
Resolver.methods.setAddr('${rootNode}', '${address}').send();
|
||||||
global.ensTestReady = true;
|
|
||||||
});
|
|
||||||
});`
|
});`
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -28,21 +26,18 @@ config({
|
|||||||
});
|
});
|
||||||
|
|
||||||
contract("ENS", function () {
|
contract("ENS", function () {
|
||||||
this.timeout(1000);
|
it("should have registered embark.eth", function () {
|
||||||
|
let maxRetry = 20;
|
||||||
|
let domainAddress;
|
||||||
|
|
||||||
before(function (done) {
|
const wait = setInterval(async () => {
|
||||||
// Wait for onDeploy to finish
|
domainAddress = await Resolver.methods.addr(rootNode).call();
|
||||||
const wait = setInterval(() => {
|
if (domainAddress || maxRetry === 0) {
|
||||||
if (!global.ensTestReady) {
|
clearInterval(wait);
|
||||||
|
assert.strictEqual(domainAddress, address);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clearInterval(wait);
|
maxRetry--;
|
||||||
done();
|
|
||||||
}, 50);
|
}, 50);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should have registered embark.eth", async function () {
|
|
||||||
const domainAddress = await Resolver.methods.addr(rootNode).call();
|
|
||||||
assert.strictEqual(domainAddress, address);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user