aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-05-18 00:05:38 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-05-18 00:05:38 +0800
commit67310e151ea75c7aa4fc00bfd63bf41cd4f2db51 (patch)
tree244a582ed826747cf48d8aad9a4a3f3a18991b66
parente546f4b9041c03deb74ed115b8bcfe3869670b6e (diff)
downloadtangerine-wallet-browser-67310e151ea75c7aa4fc00bfd63bf41cd4f2db51.tar.gz
tangerine-wallet-browser-67310e151ea75c7aa4fc00bfd63bf41cd4f2db51.tar.zst
tangerine-wallet-browser-67310e151ea75c7aa4fc00bfd63bf41cd4f2db51.zip
Fix migration 026 to produce the correct shape for state.identities
-rw-r--r--app/scripts/migrations/026.js9
-rw-r--r--test/unit/migrations/026-test.js4
2 files changed, 10 insertions, 3 deletions
diff --git a/app/scripts/migrations/026.js b/app/scripts/migrations/026.js
index ef0ed0542..1b8a91a45 100644
--- a/app/scripts/migrations/026.js
+++ b/app/scripts/migrations/026.js
@@ -34,7 +34,14 @@ function transformState (state) {
return state
}
- state.PreferencesController.identities = state.KeyringController.walletNicknames
+ state.PreferencesController.identities = Object.keys(state.KeyringController.walletNicknames)
+ .reduce((identities, address) => {
+ identities[address] = {
+ name: state.KeyringController.walletNicknames[address],
+ address,
+ }
+ return identities
+ }, {})
delete state.KeyringController.walletNicknames
return state
}
diff --git a/test/unit/migrations/026-test.js b/test/unit/migrations/026-test.js
index ac0da3fb2..b3f5470cf 100644
--- a/test/unit/migrations/026-test.js
+++ b/test/unit/migrations/026-test.js
@@ -19,8 +19,8 @@ describe('migration #26', () => {
.then((newStorage) => {
const identities = newStorage.data.PreferencesController.identities
assert.deepEqual(identities, {
- '0x1e77e2': 'Test Account 1',
- '0x7e57e2': 'Test Account 2',
+ '0x1e77e2': {name: 'Test Account 1', address: '0x1e77e2'},
+ '0x7e57e2': {name: 'Test Account 2', address: '0x7e57e2'},
})
assert.strictEqual(newStorage.data.KeyringController.walletNicknames, undefined)
done()
ertions'>+18 * Finally fix the master-has-a-master issue.des2004-11-132-18/+23 * Add sysutils/portbrowser, a free, easy to use GUI frontend implementationhrs2004-11-083-0/+31 * Bump PORTREVISIONS for all ports that depend on atk or pango to ease in themarcus2004-11-081-1/+1 * - Make freebsd-sha1 dependency conditional on OSVERSIONpav2004-11-072-6/+19 * Fix portmanager seg faults when an installed port's +CONTENTS filesem2004-11-022-1/+75 * Add portsnap: Provides secure snapshots of the ports directory.lofi2004-11-014-0/+69 * Switch to ssh for anoncvs so it works again.des2004-10-315-19/+45 * Create a VuXML entry for Horde XSS help window vulnerability to replacenectar2004-10-271-1/+0 * Add an entry for a vulnerability fixed in horde-2.2.7.thierry2004-10-271-0/+1 * Recognize absolute master directories.des2004-10-252-2/+3 * Add entries for vulnerabilites in imported xpdf code in kdegraphicslofi2004-10-241-0/+2 * - fix reinstall targeteik2004-10-243-144/+150 * Don't croak on port names that contain metacharacters.des2004-10-222-4/+6 * Fix the build on older versions of FreeBSD.marcus2004-10-191-0/+16 * Improve handling of installed ports whose origin can't be determined.des2004-10-142-4/+14 * Enable bpm to grok the new INDEX format with extra fields.adamw2004-10-132-4/+20 * Support .ifndef and !defined when doing OPTIONS checking.marcus2004-10-132-1/+2 * Add an entry for a XSS vulnerability fixed in IMP-3.2.6.thierry2004-10-121-0/+1 * * Update to 2.6.8marcus2004-10-122-5/+47 * - Fix potential endless loop when a port changes his name depending on optionpav2004-10-124-3/+375 * BROKEN on 5.x: Does not compilekris2004-09-261-1/+7 * BROKEN on 5.x: Does not compilekris2004-09-181-1/+7 * Typo-fix in a commentbrueffer2004-09-091-1/+1 * - star-devel: privilege escalationeik2004-09-092-1/+7 * - XSS vulnerability in phpGroupWare wiki moduleeik2004-09-072-8/+42 * multiple vulnerabilities in LHAeik2004-09-041-0/+36 * grrrr... left the test case intacteik2004-09-041-1/+1 * - update to version 0.5.9eik2004-09-043-14/+34 * - add some referenceseik2004-09-043-8/+142 * Update to 2.6.7marcus2004-09-012-8/+9 * The recently comitted BPM port fails to handle the new INDEX fileadamw2004-09-012-0/+24 * Minor bug fix and pkg-plist correction.linimon2004-08-313-13/+25 * samba printer change notification request DoSeik2004-08-311-0/+1 * add some references, add ru-gaimeik2004-08-301-2/+4 * multiple vulnerabilities in gaimeik2004-08-301-4/+4 * security bug in rscsi client codeeik2004-08-301-0/+4 * Fix RUN_DEPENDS.linimon2004-08-291-1/+4 * Document NSS SSLv2 server buffer overflow (already referenced innectar2004-08-271-1/+0 * Document ripMIME decoding bug (already referenced in portaudit.txt).nectar2004-08-271-1/+0 * Argh. Duplicate entry for "Scorched 3D server chat box format string vulnerab...eik2004-08-271-2/+1 * Mozilla / NSS S/MIME DoS vulnerability & Scorched 3D server chat box format s...eik2004-08-271-0/+2 * Note sanitize_path bug in rsync (already referenced in portaudit.txt).nectar2004-08-271-1/+0 * Document buffer overflows in SoX (already referenced in portaudit.txt).nectar2004-08-271-1/+0 * Document cookie bug in Konqueror (already referenced in portaudit.txt).nectar2004-08-271-1/+0 * Remove libxine issue which is now documented in the FreeBSD VuXMLnectar2004-08-251-1/+0 * nss library SSL remote buffer overfloweik2004-08-251-0/+1 * multiple buffer overflows in xveik2004-08-251-2/+3 * Watch out for undefined values when resolving port origins. This makesdes2004-08-252-4/+6 * Fix path to INDEX file on 5.x.adamw2004-08-251-0/+14 * Fix build on current in some situations.adamw2004-08-241-0/+2 * I am pleased to announce a new GTK+-2 interface to our ports tree!adamw2004-08-244-0/+55 * Konqueror cross-domain cookie injectioneik2004-08-241-0/+1 * handle some duplicateseik2004-08-243-2/+71 * fix "too many open files" error when using the -r flageik2004-08-242-2/+2 * a2ps: Possible execution of shell commands as local user.eik2004-08-211-1/+2 * Update to 0.2.0sem2004-08-213-20/+32 * correct topic of eda0ade6-f281-11d8-81b0-000347a4fa7deik2004-08-201-1/+1 * QT 3.x BMP (and possibly other graphics formats) heap-based overfloweik2004-08-201-0/+1 * potential security flaws in mod_ssleik2004-08-191-4/+6 * move a800386e-ef7e-11d8-81b0-000347a4fa7d to xmleik2004-08-173-9/+36 * ruby CGI::Session insecure file creationeik2004-08-161-1/+2 * Don't check the base system when PACKAGE_BUILDINGeik2004-08-161-0/+2 * multiple phpGroupWare vulnerabilitieseik2004-08-161-0/+2 * phpGedView, jftpgweik2004-08-163-0/+29 * Remove -a from the default fetch(1) flags, so that the daily securityeik2004-08-152-2/+2 * apply xlist not to the own fileseik2004-08-142-10/+15 * fix man page nits,eik2004-08-143-36/+61 * update to 20040811: fix compilation with GCC 3.4eik2004-08-14