mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 09:46:37 +00:00
catch error and warn if no provider
This commit is contained in:
parent
fd1b9d80f9
commit
6991215b40
@ -261,14 +261,19 @@ __embarkENS.setProvider = function () {
|
|||||||
self.ens = new web3.eth.Contract(self.registryInterface, registryAddresses[id]);
|
self.ens = new web3.eth.Contract(self.registryInterface, registryAddresses[id]);
|
||||||
}
|
}
|
||||||
// todo: deploy at this point
|
// todo: deploy at this point
|
||||||
return undefined;
|
}).catch(e => {
|
||||||
});
|
if (e.message.indexOf('Provider not set or invalid') > -1) {
|
||||||
|
console.warn('ENS is not available in this chain');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.error(e);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
__embarkENS.resolve = function(name) {
|
__embarkENS.resolve = function(name) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (self.ens === undefined) return undefined;
|
if (self.ens === undefined) return;
|
||||||
|
|
||||||
let node = namehash.hash(name);
|
let node = namehash.hash(name);
|
||||||
|
|
||||||
@ -283,7 +288,7 @@ __embarkENS.resolve = function(name) {
|
|||||||
__embarkENS.lookup = function(address) {
|
__embarkENS.lookup = function(address) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (self.ens === undefined) return undefined;
|
if (self.ens === undefined) return;
|
||||||
|
|
||||||
if (address.startsWith("0x")) address = address.slice(2);
|
if (address.startsWith("0x")) address = address.slice(2);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user