aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/keyring-controller.js5
-rw-r--r--app/scripts/lib/config-manager.js6
2 files changed, 8 insertions, 3 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 3bc9561e2..06c1e2761 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -250,7 +250,7 @@ module.exports = class KeyringController extends EventEmitter {
address,
name,
}
- this.saveAccountLabel(address, name)
+ return this.saveAccountLabel(address, name)
}
saveAccountLabel (account, label, cb) {
@@ -259,6 +259,8 @@ module.exports = class KeyringController extends EventEmitter {
configManager.setNicknameForWallet(address, label)
if (cb) {
cb(null, label)
+ } else {
+ return label
}
}
@@ -270,6 +272,7 @@ module.exports = class KeyringController extends EventEmitter {
data: k.serialize(),
}
})
+
return this.encryptor.encryptWithKey(this.key, serialized)
.then((encryptedString) => {
this.configManager.setVault(encryptedString)
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index 8f5590738..f50d95c12 100644
--- a/app/scripts/lib/config-manager.js
+++ b/app/scripts/lib/config-manager.js
@@ -269,13 +269,15 @@ ConfigManager.prototype.getWalletNicknames = function () {
}
ConfigManager.prototype.nicknameForWallet = function (account) {
+ const address = ethUtil.addHexPrefix(account.toLowerCase())
const nicknames = this.getWalletNicknames()
- return nicknames[account]
+ return nicknames[address]
}
ConfigManager.prototype.setNicknameForWallet = function (account, nickname) {
+ const address = ethUtil.addHexPrefix(account.toLowerCase())
const nicknames = this.getWalletNicknames()
- nicknames[account] = nickname
+ nicknames[address] = nickname
var data = this.getData()
data.walletNicknames = nicknames
this.setData(data)