mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 08:09:15 +01:00
398a45bfdd
This was done to reduce the number of direct dependencies we have. It should be functionally equivalent. The bundle size should not change, as we use `clone` as a transitive dependency in a number of places.
21 lines
524 B
JavaScript
21 lines
524 B
JavaScript
const version = 2
|
|
|
|
import { cloneDeep } from 'lodash'
|
|
|
|
|
|
export default {
|
|
version,
|
|
|
|
migrate: function (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 (e) {}
|
|
return Promise.resolve(versionedData)
|
|
},
|
|
}
|