1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/app/scripts/migrations/002.js

21 lines
518 B
JavaScript
Raw Normal View History

const version = 2
const clone = require('clone')
2016-04-12 23:16:39 +02:00
module.exports = {
version,
2016-04-12 23:16:39 +02:00
migrate: function (originalVersionedData) {
2017-04-27 06:05:45 +02:00
const versionedData = clone(originalVersionedData)
versionedData.meta.version = version
2016-04-12 23:16:39 +02:00
try {
if (versionedData.data.config.provider.type === 'etherscan') {
versionedData.data.config.provider.type = 'rpc'
versionedData.data.config.provider.rpcTarget = 'https://rpc.metamask.io/'
2016-04-12 23:16:39 +02:00
}
} catch (e) {}
return Promise.resolve(versionedData)
2016-06-21 22:18:32 +02:00
},
2016-04-12 23:16:39 +02:00
}