aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpldespaigne <pldespaigne@cascade8.com>2019-04-04 20:07:24 +0800
committerpldespaigne <pldespaigne@cascade8.com>2019-04-04 20:07:24 +0800
commitb26a59dbbe2666640529f7ae0a86bd5a2da3f607 (patch)
treeac42fb8c6fd7a7371a877b34698eeb1e6451fc25
parentcf4eac3f2c693269e8a5025d4f5f2240d7be13e7 (diff)
downloadtangerine-wallet-browser-b26a59dbbe2666640529f7ae0a86bd5a2da3f607.tar
tangerine-wallet-browser-b26a59dbbe2666640529f7ae0a86bd5a2da3f607.tar.gz
tangerine-wallet-browser-b26a59dbbe2666640529f7ae0a86bd5a2da3f607.tar.bz2
tangerine-wallet-browser-b26a59dbbe2666640529f7ae0a86bd5a2da3f607.tar.lz
tangerine-wallet-browser-b26a59dbbe2666640529f7ae0a86bd5a2da3f607.tar.xz
tangerine-wallet-browser-b26a59dbbe2666640529f7ae0a86bd5a2da3f607.tar.zst
tangerine-wallet-browser-b26a59dbbe2666640529f7ae0a86bd5a2da3f607.zip
renaming registrar into registry
-rw-r--r--app/scripts/lib/ens-ipfs/contracts/registry.js (renamed from app/scripts/lib/ens-ipfs/contracts/registrar.js)0
-rw-r--r--app/scripts/lib/ens-ipfs/resolver.js16
2 files changed, 8 insertions, 8 deletions
diff --git a/app/scripts/lib/ens-ipfs/contracts/registrar.js b/app/scripts/lib/ens-ipfs/contracts/registry.js
index 99ca24458..99ca24458 100644
--- a/app/scripts/lib/ens-ipfs/contracts/registrar.js
+++ b/app/scripts/lib/ens-ipfs/contracts/registry.js
diff --git a/app/scripts/lib/ens-ipfs/resolver.js b/app/scripts/lib/ens-ipfs/resolver.js
index b98566190..18f7704c3 100644
--- a/app/scripts/lib/ens-ipfs/resolver.js
+++ b/app/scripts/lib/ens-ipfs/resolver.js
@@ -2,7 +2,7 @@ const namehash = require('eth-ens-namehash')
const multihash = require('multihashes')
const Eth = require('ethjs-query')
const EthContract = require('ethjs-contract')
-const registrarAbi = require('./contracts/registrar')
+const registryAbi = require('./contracts/registry')
const resolverAbi = require('./contracts/resolver')
module.exports = resolveEnsToIpfsContentId
@@ -12,15 +12,15 @@ async function resolveEnsToIpfsContentId ({ provider, name }) {
const eth = new Eth(provider)
const hash = namehash.hash(name)
const contract = new EthContract(eth)
- // lookup registrar
+ // lookup registry
const chainId = Number.parseInt(await eth.net_version(), 10)
- const registrarAddress = getRegistrarForChainId(chainId)
- if (!registrarAddress) {
- throw new Error(`EnsIpfsResolver - no known ens-ipfs registrar for chainId "${chainId}"`)
+ const registryAddress = getRegistryForChainId(chainId)
+ if (!registryAddress) {
+ throw new Error(`EnsIpfsResolver - no known ens-ipfs registry for chainId "${chainId}"`)
}
- const Registrar = contract(registrarAbi).at(registrarAddress)
+ const Registry = contract(registryAbi).at(registryAddress)
// lookup resolver
- const resolverLookupResult = await Registrar.resolver(hash)
+ const resolverLookupResult = await Registry.resolver(hash)
const resolverAddress = resolverLookupResult[0]
if (hexValueIsEmpty(resolverAddress)) {
throw new Error(`EnsIpfsResolver - no resolver found for name "${name}"`)
@@ -42,7 +42,7 @@ function hexValueIsEmpty (value) {
return [undefined, null, '0x', '0x0', '0x0000000000000000000000000000000000000000000000000000000000000000'].includes(value)
}
-function getRegistrarForChainId (chainId) {
+function getRegistryForChainId (chainId) {
switch (chainId) {
// mainnet
case 1: