1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 20:02:58 +01:00
metamask-extension/app/scripts/migrations/002.js
Erik Marks 76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00

23 lines
550 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);
},
};