aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui/lib/contract-namer.js
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-02-21 20:24:32 +0800
committerGitHub <noreply@github.com>2019-02-21 20:24:32 +0800
commit65bfdeedc77e51dea28ef643b5ea9d50a8569c81 (patch)
tree91859eabd9280c19131a403e35a9bc5262a6e402 /old-ui/lib/contract-namer.js
parentc6e84ccf458061a6b64e6a15512b008e8d0166ea (diff)
parent38bb1d39792d8e4c238f7528990d725527379550 (diff)
downloadtangerine-wallet-browser-65bfdeedc77e51dea28ef643b5ea9d50a8569c81.tar
tangerine-wallet-browser-65bfdeedc77e51dea28ef643b5ea9d50a8569c81.tar.gz
tangerine-wallet-browser-65bfdeedc77e51dea28ef643b5ea9d50a8569c81.tar.bz2
tangerine-wallet-browser-65bfdeedc77e51dea28ef643b5ea9d50a8569c81.tar.lz
tangerine-wallet-browser-65bfdeedc77e51dea28ef643b5ea9d50a8569c81.tar.xz
tangerine-wallet-browser-65bfdeedc77e51dea28ef643b5ea9d50a8569c81.tar.zst
tangerine-wallet-browser-65bfdeedc77e51dea28ef643b5ea9d50a8569c81.zip
Merge pull request #6166 from whymarrh/bye-bye-old-ui
Delete the old UI
Diffstat (limited to 'old-ui/lib/contract-namer.js')
-rw-r--r--old-ui/lib/contract-namer.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/old-ui/lib/contract-namer.js b/old-ui/lib/contract-namer.js
deleted file mode 100644
index f05e770cc..000000000
--- a/old-ui/lib/contract-namer.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* CONTRACT NAMER
- *
- * Takes an address,
- * Returns a nicname if we have one stored,
- * otherwise returns null.
- */
-
-const contractMap = require('eth-contract-metadata')
-const ethUtil = require('ethereumjs-util')
-
-module.exports = function (addr, identities = {}) {
- const checksummed = ethUtil.toChecksumAddress(addr)
- if (contractMap[checksummed] && contractMap[checksummed].name) {
- return contractMap[checksummed].name
- }
-
- const address = addr.toLowerCase()
- const ids = hashFromIdentities(identities)
- return addrFromHash(address, ids)
-}
-
-function hashFromIdentities (identities) {
- const result = {}
- for (const key in identities) {
- result[key] = identities[key].name
- }
- return result
-}
-
-function addrFromHash (addr, hash) {
- const address = addr.toLowerCase()
- return hash[address] || null
-}