From cca71a1c66681b367b282d3eb5153a15d50bbb69 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 18 Jun 2018 14:57:43 -0500 Subject: [PATCH] back to promisification Signed-off-by: VoR0220 --- lib/modules/ens/embarkjs.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/modules/ens/embarkjs.js b/lib/modules/ens/embarkjs.js index 0ed09e55..b7db4ba6 100644 --- a/lib/modules/ens/embarkjs.js +++ b/lib/modules/ens/embarkjs.js @@ -198,11 +198,11 @@ __embarkENS.resolve = function (name) { }).catch(err => err); }; -__embarkENS.lookup = function (address, cb) { +__embarkENS.lookup = function (address) { const self = this; if (!self.ens) { - console.log("ENS provider not set. Exitting."); + console.log("ENS provider not set. Exiting.") return; } if (address.startsWith("0x")) address = address.slice(2); @@ -212,10 +212,5 @@ __embarkENS.lookup = function (address, cb) { return self.ens.methods.resolver(node).call().then((resolverAddress) => { let resolverContract = new EmbarkJS.Contract({abi: self.resolverInterface, address: resolverAddress}); return resolverContract.methods.name(node).call(); - }).then((name) => { - if (name === "" || name === undefined) { - return cb(new Error("Name not found")); - } - return cb(null, name); - }).catch(cb); + }).catch(err => err); };