diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-02-06 08:27:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-06 08:27:45 +0800 |
commit | 15ae20033c22a3958ad7ff6ac74f74b1c0d2dbf5 (patch) | |
tree | 0008a579764bc5fad04568e2b3eea2dc90a7629d /app/scripts/migrations/010.js | |
parent | 24ff38e97386eafe0cd9c8e4e77dbed856b2464e (diff) | |
parent | c0637f8d6ad969f16b7e8b582f462a7f9c480537 (diff) | |
download | tangerine-wallet-browser-15ae20033c22a3958ad7ff6ac74f74b1c0d2dbf5.tar.gz tangerine-wallet-browser-15ae20033c22a3958ad7ff6ac74f74b1c0d2dbf5.tar.zst tangerine-wallet-browser-15ae20033c22a3958ad7ff6ac74f74b1c0d2dbf5.zip |
Merge pull request #1088 from MetaMask/CreateShapeshiftController
Create shapeshift controller
Diffstat (limited to 'app/scripts/migrations/010.js')
-rw-r--r-- | app/scripts/migrations/010.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/scripts/migrations/010.js b/app/scripts/migrations/010.js new file mode 100644 index 000000000..d41c63fcd --- /dev/null +++ b/app/scripts/migrations/010.js @@ -0,0 +1,36 @@ +const version = 10 + +/* + +This migration breaks out the CurrencyController substate + +*/ + +const merge = require('deep-extend') + +module.exports = { + version, + + migrate: function (versionedData) { + 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 = merge({}, state, { + ShapeShiftController: { + shapeShiftTxList: state.shapeShiftTxList || [], + }, + }) + delete newState.shapeShiftTxList + + return newState +} |