aboutsummaryrefslogtreecommitdiffstats
path: root/ui/lib/contract-namer.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-11-18 06:27:34 +0800
committerGitHub <noreply@github.com>2016-11-18 06:27:34 +0800
commit6400eb8453c173e04e59d7990bd2c79afb3493be (patch)
treeecb311d43d0f77d5f5f0e82a0014a09c6381f0ef /ui/lib/contract-namer.js
parent115fdc36fefd33e4bf4a9e551dd6267d3d75f2c5 (diff)
parent4352c7031afb6f9a175b29d0addeb7ea48345676 (diff)
downloadtangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.gz
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.bz2
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.lz
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.xz
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.zst
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.zip
Merge pull request #816 from MetaMask/i328-MultiVault
Multi vault to Dev Branch
Diffstat (limited to 'ui/lib/contract-namer.js')
-rw-r--r--ui/lib/contract-namer.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/ui/lib/contract-namer.js b/ui/lib/contract-namer.js
index c99d44de6..a94c62b62 100644
--- a/ui/lib/contract-namer.js
+++ b/ui/lib/contract-namer.js
@@ -8,23 +8,22 @@
// Nickname keys must be stored in lower case.
const nicknames = {}
-module.exports = function(addr, identities = {}) {
-
+module.exports = function (addr, identities = {}) {
const address = addr.toLowerCase()
const ids = hashFromIdentities(identities)
return addrFromHash(address, ids) || addrFromHash(address, nicknames)
}
-function hashFromIdentities(identities) {
+function hashFromIdentities (identities) {
const result = {}
- for (let key in identities) {
+ for (const key in identities) {
result[key] = identities[key].name
}
return result
}
-function addrFromHash(addr, hash) {
+function addrFromHash (addr, hash) {
const address = addr.toLowerCase()
return hash[address] || null
}