blob: 0f985020850246729dac5e71934bc562fbcffd85 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
const version = 4
module.exports = {
version,
migrate: function (versionedData) {
versionedData.meta.version = version
try {
if (versionedData.data.config.provider.type !== 'rpc') return Promise.resolve(versionedData)
switch (versionedData.data.config.provider.rpcTarget) {
case 'https://testrpc.metamask.io/':
versionedData.data.config.provider = {
type: 'testnet',
}
break
case 'https://rpc.metamask.io/':
versionedData.data.config.provider = {
type: 'mainnet',
}
break
}
} catch (_) {}
return Promise.resolve(versionedData)
},
}
|