review comments

This commit is contained in:
Jonathan Rainville 2018-11-28 12:39:54 -05:00
parent c64c093a48
commit 9e69a7257e

View File

@ -2,7 +2,6 @@
let __embarkENS = {};
const NOT_REGISTERED_ERROR = 'Name not yet registered';
// resolver interface
__embarkENS.resolverInterface = [
{
@ -193,7 +192,7 @@ __embarkENS.resolve = function (name, callback) {
return this.ens.methods.resolver(node).call()
.then(resolverAddress => {
if (resolverAddress === voidAddress) {
return cb(NOT_REGISTERED_ERROR);
return cb('Name not yet registered');
}
let resolverContract = new EmbarkJS.Blockchain.Contract({
abi: this.resolverInterface,
@ -202,9 +201,7 @@ __embarkENS.resolve = function (name, callback) {
});
return resolverContract.methods.addr(node).call(cb);
})
.catch(err => {
cb(err);
});
.catch(cb);
};
__embarkENS.lookup = function (address, callback) {
@ -239,9 +236,7 @@ __embarkENS.lookup = function (address, callback) {
});
return resolverContract.methods.name(node).call(cb);
})
.catch(err => {
cb(err);
});
.catch(cb);
};
__embarkENS.registerSubDomain = function (name, address, callback) {