aboutsummaryrefslogblamecommitdiffstats
path: root/app/scripts/migrations/002.js
blob: 36a87034221e21238f14f0e1b0a39685728ef79c (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                 


                              
                  
          
 

                                                    
                                        
         


                                                                                 

                  
                                         
    
 
const version = 2

const clone = require('clone')


module.exports = {
  version,

  migrate: function (originalVersionedData) {
    let versionedData = clone(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 (e) {}
    return Promise.resolve(versionedData)
  },
}