mirror of https://github.com/embarklabs/embark.git
only enabble register in dev
This commit is contained in:
parent
82bbbd6f87
commit
1f02461af1
|
@ -149,9 +149,10 @@ __embarkENS.registryAddresses = {
|
|||
__embarkENS.setProvider = function (config) {
|
||||
const self = this;
|
||||
const ERROR_MESSAGE = 'ENS is not available in this chain';
|
||||
EmbarkJS.onReady(() => {
|
||||
self.registration = config.registration;
|
||||
self.registration = config.registration;
|
||||
self.env = config.env;
|
||||
|
||||
EmbarkJS.onReady(() => {
|
||||
web3.eth.net.getId()
|
||||
.then((id) => {
|
||||
const registryAddress = self.registryAddresses[id] || config.registryAddress;
|
||||
|
@ -228,10 +229,12 @@ __embarkENS.lookup = function (address, callback) {
|
|||
__embarkENS.registerSubDomain = function (name, address, callback) {
|
||||
callback = callback || function () {};
|
||||
|
||||
if (this.env !== 'development') {
|
||||
return callback('Sub-domain registration is only available in development mode');
|
||||
}
|
||||
if (!this.registration || !this.registration.rootDomain) {
|
||||
return callback('No rootDomain is declared in config/namesystem.js (register.rootDomain). Unable to register a subdomain until then.');
|
||||
}
|
||||
|
||||
if (!address || !web3.utils.isAddress(address)) {
|
||||
return callback('You need to specify a valid address for the subdomain');
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ class ENS {
|
|||
], (err, results) => {
|
||||
// result[0] => ENSRegistry; result[1] => FIFSRegistrar; result[2] => FIFSRegistrar
|
||||
let config = {
|
||||
env: self.env,
|
||||
registration: self.registration,
|
||||
registryAbi: results[0].abiDefinition,
|
||||
registryAddress: results[0].deployedAddress,
|
||||
|
|
Loading…
Reference in New Issue