1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 23:58:06 +01:00
metamask-extension/app/scripts/migrations/002.js
2020-11-02 17:41:28 -06:00

23 lines
542 B
JavaScript

import { cloneDeep } from 'lodash'
const version = 2
export default {
version,
migrate(originalVersionedData) {
const versionedData = cloneDeep(originalVersionedData)
versionedData.meta.version = version
try {
if (versionedData.data.config.provider.type === 'etherscan') {
versionedData.data.config.provider.type = 'rpc'
versionedData.data.config.provider.rpcTarget =
'https://rpc.metamask.io/'
}
} catch (_) {
// empty
}
return Promise.resolve(versionedData)
},
}