mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 02:58:09 +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
558 B
JavaScript
21 lines
558 B
JavaScript
const version = 3
|
|
const oldTestRpc = 'https://rawtestrpc.metamask.io/'
|
|
const newTestRpc = 'https://testrpc.metamask.io/'
|
|
|
|
import { cloneDeep } from 'lodash'
|
|
|
|
export default {
|
|
version,
|
|
|
|
migrate: function (originalVersionedData) {
|
|
const versionedData = cloneDeep(originalVersionedData)
|
|
versionedData.meta.version = version
|
|
try {
|
|
if (versionedData.data.config.provider.rpcTarget === oldTestRpc) {
|
|
versionedData.data.config.provider.rpcTarget = newTestRpc
|
|
}
|
|
} catch (e) {}
|
|
return Promise.resolve(versionedData)
|
|
},
|
|
}
|