aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/migrations/003.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/migrations/003.js')
-rw-r--r--app/scripts/migrations/003.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/scripts/migrations/003.js b/app/scripts/migrations/003.js
index 617c55c09..1893576ad 100644
--- a/app/scripts/migrations/003.js
+++ b/app/scripts/migrations/003.js
@@ -1,15 +1,20 @@
-var oldTestRpc = 'https://rawtestrpc.metamask.io/'
-var newTestRpc = 'https://testrpc.metamask.io/'
+const version = 3
+const oldTestRpc = 'https://rawtestrpc.metamask.io/'
+const newTestRpc = 'https://testrpc.metamask.io/'
+
+const clone = require('clone')
module.exports = {
- version: 3,
+ version,
- migrate: function (data) {
+ migrate: function (originalVersionedData) {
+ let versionedData = clone(originalVersionedData)
+ versionedData.meta.version = version
try {
- if (data.config.provider.rpcTarget === oldTestRpc) {
- data.config.provider.rpcTarget = newTestRpc
+ if (versionedData.data.config.provider.rpcTarget === oldTestRpc) {
+ versionedData.data.config.provider.rpcTarget = newTestRpc
}
} catch (e) {}
- return data
+ return Promise.resolve(versionedData)
},
}