mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
23 lines
542 B
JavaScript
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)
|
|
},
|
|
}
|