mirror of https://github.com/embarklabs/embark.git
only set provider if provider is ENS
This commit is contained in:
parent
a3c86189fd
commit
b9363c54fa
|
@ -18,9 +18,8 @@ class ENS {
|
||||||
this.namesConfig.enabled !== true ||
|
this.namesConfig.enabled !== true ||
|
||||||
this.namesConfig.available_providers.indexOf('ens') < 0) {
|
this.namesConfig.available_providers.indexOf('ens') < 0) {
|
||||||
return;
|
return;
|
||||||
} else if (this.namesConfig.provider !== 'ens') {
|
|
||||||
this.providerNotENS = true;
|
|
||||||
}
|
}
|
||||||
|
this.doSetENSProvider = this.namesConfig.provider === 'ens';
|
||||||
|
|
||||||
this.addENSToEmbarkJS();
|
this.addENSToEmbarkJS();
|
||||||
this.configureContracts();
|
this.configureContracts();
|
||||||
|
@ -63,7 +62,10 @@ class ENS {
|
||||||
resolverAbi: results[2].abiDefinition,
|
resolverAbi: results[2].abiDefinition,
|
||||||
resolverAddress: results[2].deployedAddress
|
resolverAddress: results[2].deployedAddress
|
||||||
};
|
};
|
||||||
self.addSetProvider(config);
|
|
||||||
|
if (self.doSetENSProvider) {
|
||||||
|
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();
|
||||||
|
@ -187,9 +189,6 @@ class ENS {
|
||||||
|
|
||||||
addENSToEmbarkJS() {
|
addENSToEmbarkJS() {
|
||||||
const self = this;
|
const self = this;
|
||||||
if (self.providerNotENS) {
|
|
||||||
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…
Reference in New Issue