1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/app/scripts/migrations/002.js

23 lines
550 B
JavaScript
Raw Normal View History

import { cloneDeep } from 'lodash';
const version = 2;
export default {
version,
2016-04-12 23:16:39 +02:00
2020-11-03 00:41:28 +01:00
migrate(originalVersionedData) {
const versionedData = cloneDeep(originalVersionedData);
versionedData.meta.version = version;
2016-04-12 23:16:39 +02:00
try {
if (versionedData.data.config.provider.type === 'etherscan') {
versionedData.data.config.provider.type = 'rpc';
2020-11-03 00:41:28 +01:00
versionedData.data.config.provider.rpcTarget =
'https://rpc.metamask.io/';
2016-04-12 23:16:39 +02:00
}
} catch (_) {
// empty
}
return Promise.resolve(versionedData);
2016-06-21 22:18:32 +02:00
},
};