mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
back to promisification
Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
parent
ca5a60b5f0
commit
a9a460f10e
@ -172,11 +172,11 @@ __embarkENS.resolve = function (name) {
|
|||||||
}).catch(err => err);
|
}).catch(err => err);
|
||||||
};
|
};
|
||||||
|
|
||||||
__embarkENS.lookup = function (address, cb) {
|
__embarkENS.lookup = function (address) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (!self.ens) {
|
if (!self.ens) {
|
||||||
console.log("ENS provider not set. Exitting.");
|
console.log("ENS provider not set. Exiting.")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (address.startsWith("0x")) address = address.slice(2);
|
if (address.startsWith("0x")) address = address.slice(2);
|
||||||
@ -186,10 +186,5 @@ __embarkENS.lookup = function (address, cb) {
|
|||||||
return self.ens.methods.resolver(node).call().then((resolverAddress) => {
|
return self.ens.methods.resolver(node).call().then((resolverAddress) => {
|
||||||
let resolverContract = new web3.eth.Contract(self.resolverInterface, resolverAddress);
|
let resolverContract = new web3.eth.Contract(self.resolverInterface, resolverAddress);
|
||||||
return resolverContract.methods.name(node).call();
|
return resolverContract.methods.name(node).call();
|
||||||
}).then((name) => {
|
}).catch(err => err);
|
||||||
if (name === "" || name === undefined) {
|
|
||||||
return cb(new Error("Name not found"));
|
|
||||||
}
|
|
||||||
return cb(null, name);
|
|
||||||
}).catch(cb);
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user