more fixes
Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
parent
bf40bdb93b
commit
793a618c12
|
@ -1,4 +1,5 @@
|
|||
const namehash = require('eth-ens-namehash');
|
||||
const Web3 = require('web3');
|
||||
/*global web3*/
|
||||
let __embarkENS = {};
|
||||
|
||||
|
@ -250,8 +251,9 @@ var registryAddresses = {
|
|||
"4": "0xe7410170f87102DF0055eB195163A03B7F2Bff4A"
|
||||
};
|
||||
|
||||
__embarkENS.setProvider = function (options) {
|
||||
__embarkENS.setProvider = function () {
|
||||
const self = this;
|
||||
|
||||
// get network id and then assign ENS contract based on that
|
||||
self.ens = web3.eth.net.getId().then(id => {
|
||||
if (registryAddresses[id] !== undefined) {
|
||||
|
@ -265,8 +267,7 @@ __embarkENS.setProvider = function (options) {
|
|||
__embarkENS.resolve = function(name) {
|
||||
const self = this;
|
||||
|
||||
if (self.ens === undefined)
|
||||
return undefined;
|
||||
if (self.ens === undefined) return undefined;
|
||||
|
||||
let node = namehash(name);
|
||||
|
||||
|
|
|
@ -41,15 +41,12 @@ class ENS {
|
|||
}
|
||||
|
||||
addSetProvider() {
|
||||
let config = JSON.stringify({
|
||||
server: this.storageConfig.host,
|
||||
port: this.storageConfig.port
|
||||
});
|
||||
let config = JSON.stringify({});
|
||||
|
||||
let code = "\nEmbarkJS.Names.setProvider('ens'," + config + ");";
|
||||
|
||||
let shouldInit = (storageConfig) => {
|
||||
return (namesConfig.provider === 'ens' && storageConfig.enabled === true);
|
||||
let shouldInit = (namesConfig) => {
|
||||
return (namesConfig.provider === 'ens' && namesConfig.enabled === true);
|
||||
};
|
||||
|
||||
this.embark.addProviderInit('names', code, shouldInit);
|
||||
|
|
Loading…
Reference in New Issue