diff options
migrations - introduce promise-based migrator
Diffstat (limited to 'app/scripts/migrations/002.js')
-rw-r--r-- | app/scripts/migrations/002.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/scripts/migrations/002.js b/app/scripts/migrations/002.js index 0b654f825..97f427d3a 100644 --- a/app/scripts/migrations/002.js +++ b/app/scripts/migrations/002.js @@ -1,13 +1,16 @@ +const version = 2 + module.exports = { - version: 2, + version, - migrate: function (data) { + migrate: function (meta) { + meta.version = version try { - if (data.config.provider.type === 'etherscan') { - data.config.provider.type = 'rpc' - data.config.provider.rpcTarget = 'https://rpc.metamask.io/' + if (meta.data.config.provider.type === 'etherscan') { + meta.data.config.provider.type = 'rpc' + meta.data.config.provider.rpcTarget = 'https://rpc.metamask.io/' } } catch (e) {} - return data + return Promise.resolve(meta) }, } |