Apply linter suggestions
This commit is contained in:
parent
1c3879f7a8
commit
b13e1b8ba6
|
@ -5,7 +5,7 @@ const debounce = require('debounce')
|
||||||
const copyToClipboard = require('copy-to-clipboard')
|
const copyToClipboard = require('copy-to-clipboard')
|
||||||
const ENS = require('ethjs-ens')
|
const ENS = require('ethjs-ens')
|
||||||
const networkMap = require('ethjs-ens/lib/network-map.json')
|
const networkMap = require('ethjs-ens/lib/network-map.json')
|
||||||
const RNSRegistryData = require('@rsksmart/rns-registry/RNSRegistryData.json');
|
const RNSRegistryData = require('@rsksmart/rns-registry/RNSRegistryData.json')
|
||||||
const ensRE = /.+\..+$/
|
const ensRE = /.+\..+$/
|
||||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
||||||
const log = require('loglevel')
|
const log = require('loglevel')
|
||||||
|
@ -95,7 +95,7 @@ EnsInput.prototype.componentDidMount = function () {
|
||||||
this.ens = new ENS({ provider, network })
|
this.ens = new ENS({ provider, network })
|
||||||
this.checkName = debounce(this.lookupEnsName.bind(this, 'ENS'), 200)
|
this.checkName = debounce(this.lookupEnsName.bind(this, 'ENS'), 200)
|
||||||
} else if (networkHasRnsSupport) {
|
} else if (networkHasRnsSupport) {
|
||||||
const registryAddress = getRnsRegistryAddress(network);
|
const registryAddress = getRnsRegistryAddress(network)
|
||||||
const provider = global.ethereumProvider
|
const provider = global.ethereumProvider
|
||||||
this.ens = new ENS({ provider, network, registryAddress })
|
this.ens = new ENS({ provider, network, registryAddress })
|
||||||
this.checkName = debounce(this.lookupEnsName.bind(this, 'RNS'), 200)
|
this.checkName = debounce(this.lookupEnsName.bind(this, 'RNS'), 200)
|
||||||
|
@ -129,8 +129,8 @@ EnsInput.prototype.lookupEnsName = function (nameService) {
|
||||||
toError: null,
|
toError: null,
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
(isValidENSAddress(recipient) || isValidRNSAddress(recipient))
|
(isValidENSAddress(recipient) || isValidRNSAddress(recipient)) &&
|
||||||
&& reason.message === 'ENS name not defined.'
|
reason.message === 'ENS name not defined.'
|
||||||
) {
|
) {
|
||||||
setStateObj.hoverText = `${nameService} name not found`
|
setStateObj.hoverText = `${nameService} name not found`
|
||||||
setStateObj.toError = `${nameService.toLowerCase()}NameNotFound`
|
setStateObj.toError = `${nameService.toLowerCase()}NameNotFound`
|
||||||
|
@ -215,17 +215,17 @@ function getNetworkEnsSupport (network) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNetworkRnsSupport (network) {
|
function getNetworkRnsSupport (network) {
|
||||||
return (network == RSK_CODE || network == RSK_TESTNET_CODE);
|
return (network === RSK_CODE || network === RSK_TESTNET_CODE)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRnsRegistryAddress (network) {
|
function getRnsRegistryAddress (network) {
|
||||||
if (network == RSK_CODE) {
|
if (network === RSK_CODE) {
|
||||||
return RNSRegistryData.address.rskMainnet;
|
return RNSRegistryData.address.rskMainnet
|
||||||
}
|
}
|
||||||
|
|
||||||
if (network == RSK_TESTNET_CODE) {
|
if (network === RSK_TESTNET_CODE) {
|
||||||
return RNSRegistryData.address.rskTestnet;
|
return RNSRegistryData.address.rskTestnet
|
||||||
};
|
};
|
||||||
|
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue