2017-01-12 10:17:05 +01:00
|
|
|
const version = 2
|
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
import clone from 'clone'
|
2017-02-15 20:14:53 +01:00
|
|
|
|
|
|
|
|
2020-01-09 04:34:58 +01:00
|
|
|
export default {
|
2017-01-12 10:17:05 +01:00
|
|
|
version,
|
2016-04-12 23:16:39 +02:00
|
|
|
|
2017-02-15 20:14:53 +01:00
|
|
|
migrate: function (originalVersionedData) {
|
2017-04-27 06:05:45 +02:00
|
|
|
const versionedData = clone(originalVersionedData)
|
2017-01-12 11:24:33 +01:00
|
|
|
versionedData.meta.version = version
|
2016-04-12 23:16:39 +02:00
|
|
|
try {
|
2017-01-12 11:24:33 +01:00
|
|
|
if (versionedData.data.config.provider.type === 'etherscan') {
|
|
|
|
versionedData.data.config.provider.type = 'rpc'
|
|
|
|
versionedData.data.config.provider.rpcTarget = 'https://rpc.metamask.io/'
|
2016-04-12 23:16:39 +02:00
|
|
|
}
|
|
|
|
} catch (e) {}
|
2017-01-12 11:24:33 +01:00
|
|
|
return Promise.resolve(versionedData)
|
2016-06-21 22:18:32 +02:00
|
|
|
},
|
2016-04-12 23:16:39 +02:00
|
|
|
}
|