small cleanups
This commit is contained in:
parent
01de35aab9
commit
bb9f058b15
|
@ -3,6 +3,8 @@ const utils = require('../../utils/utils.js');
|
|||
const namehash = require('eth-ens-namehash');
|
||||
const async = require('async');
|
||||
|
||||
const reverseAddrSuffix = '.addr.reverse';
|
||||
|
||||
class ENS {
|
||||
constructor(embark, _options) {
|
||||
this.logger = embark.logger;
|
||||
|
@ -90,7 +92,7 @@ class ENS {
|
|||
|
||||
async.each(Object.keys(self.registration.subdomains), (subDomainName, eachCb) => {
|
||||
const address = self.registration.subdomains[subDomainName];
|
||||
const reverseNode = utils.soliditySha3(address.toLowerCase().substr(2) + '.addr.reverse');
|
||||
const reverseNode = utils.soliditySha3(address.toLowerCase().substr(2) + reverseAddrSuffix);
|
||||
register(ens, registrar, resolver, defaultAccount, subDomainName, self.registration.rootDomain,
|
||||
reverseNode, address, self.logger, eachCb);
|
||||
}, cb);
|
||||
|
@ -197,7 +199,7 @@ class ENS {
|
|||
"onDeploy": [
|
||||
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => {
|
||||
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
|
||||
var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '.addr.reverse');
|
||||
var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '${reverseAddrSuffix}');
|
||||
ENSRegistry.methods.setResolver(reverseNode, "$Resolver").send();
|
||||
Resolver.methods.setAddr('${rootNode}', web3.eth.defaultAccount).send();
|
||||
Resolver.methods.setName(reverseNode, '${this.registration.rootDomain}').send();
|
||||
|
|
|
@ -32,7 +32,7 @@ contract("ENS", function () {
|
|||
// Wait for onDeploy to finish
|
||||
setTimeout(function () {
|
||||
done();
|
||||
}, 100);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
it("should have registered embark.eth", async function () {
|
||||
|
|
Loading…
Reference in New Issue