diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-05-24 15:18:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-24 15:18:40 +0800 |
commit | 6be1aa82c00c85e5c839de4cfb781088d229160c (patch) | |
tree | 4ade3448b5130a5f58a19f7fcebff049eb33e065 /app/scripts/migrations/014.js | |
parent | e55329d28b61b2d1066cf794a2099a18a94be7a4 (diff) | |
parent | e8288ad4bfaa5b65b23f0a03d0c036457a24893f (diff) | |
download | tangerine-wallet-browser-6be1aa82c00c85e5c839de4cfb781088d229160c.tar tangerine-wallet-browser-6be1aa82c00c85e5c839de4cfb781088d229160c.tar.gz tangerine-wallet-browser-6be1aa82c00c85e5c839de4cfb781088d229160c.tar.bz2 tangerine-wallet-browser-6be1aa82c00c85e5c839de4cfb781088d229160c.tar.lz tangerine-wallet-browser-6be1aa82c00c85e5c839de4cfb781088d229160c.tar.xz tangerine-wallet-browser-6be1aa82c00c85e5c839de4cfb781088d229160c.tar.zst tangerine-wallet-browser-6be1aa82c00c85e5c839de4cfb781088d229160c.zip |
Merge branch 'master' into Version-3.7.1
Diffstat (limited to 'app/scripts/migrations/014.js')
-rw-r--r-- | app/scripts/migrations/014.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app/scripts/migrations/014.js b/app/scripts/migrations/014.js new file mode 100644 index 000000000..0fe92125b --- /dev/null +++ b/app/scripts/migrations/014.js @@ -0,0 +1,34 @@ +const version = 14 + +/* + +This migration removes provider from config and moves it too NetworkController. + +*/ + +const clone = require('clone') + +module.exports = { + version, + + migrate: function (originalVersionedData) { + const versionedData = clone(originalVersionedData) + versionedData.meta.version = version + try { + const state = versionedData.data + const newState = transformState(state) + versionedData.data = newState + } catch (err) { + console.warn(`MetaMask Migration #${version}` + err.stack) + } + return Promise.resolve(versionedData) + }, +} + +function transformState (state) { + const newState = state + newState.NetworkController = {} + newState.NetworkController.provider = newState.config.provider + delete newState.config.provider + return newState +} |