mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-22 11:40:09 +00:00
Merge pull request #675 from embark-framework/bug_fix/disable-ens
disable ens if it is not enabled
This commit is contained in:
commit
686fd4bdb6
@ -14,6 +14,13 @@ class ENS {
|
|||||||
this.registration = this.namesConfig.register || {};
|
this.registration = this.namesConfig.register || {};
|
||||||
this.embark = embark;
|
this.embark = embark;
|
||||||
|
|
||||||
|
if (this.namesConfig === {} ||
|
||||||
|
this.namesConfig.enabled !== true ||
|
||||||
|
this.namesConfig.available_providers.indexOf('ens') < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.doSetENSProvider = this.namesConfig.provider === 'ens';
|
||||||
|
|
||||||
this.addENSToEmbarkJS();
|
this.addENSToEmbarkJS();
|
||||||
this.configureContracts();
|
this.configureContracts();
|
||||||
this.registerEvents();
|
this.registerEvents();
|
||||||
@ -55,7 +62,10 @@ class ENS {
|
|||||||
resolverAbi: results[2].abiDefinition,
|
resolverAbi: results[2].abiDefinition,
|
||||||
resolverAddress: results[2].deployedAddress
|
resolverAddress: results[2].deployedAddress
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (self.doSetENSProvider) {
|
||||||
self.addSetProvider(config);
|
self.addSetProvider(config);
|
||||||
|
}
|
||||||
|
|
||||||
if (!self.env === 'development' || !self.registration || !self.registration.subdomains || !Object.keys(self.registration.subdomains).length) {
|
if (!self.env === 'development' || !self.registration || !self.registration.subdomains || !Object.keys(self.registration.subdomains).length) {
|
||||||
return cb();
|
return cb();
|
||||||
@ -179,14 +189,6 @@ class ENS {
|
|||||||
|
|
||||||
addENSToEmbarkJS() {
|
addENSToEmbarkJS() {
|
||||||
const self = this;
|
const self = this;
|
||||||
// TODO: make this a shouldAdd condition
|
|
||||||
if (this.namesConfig === {}) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((this.namesConfig.available_providers.indexOf('ens') < 0) && (this.namesConfig.provider !== 'ens' || this.namesConfig.enabled !== true)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get namehash, import it into file
|
// get namehash, import it into file
|
||||||
self.events.request("version:get:eth-ens-namehash", function (EnsNamehashVersion) {
|
self.events.request("version:get:eth-ens-namehash", function (EnsNamehashVersion) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user