From be4818564a065f166124c05b037ceb22eb5f242b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 12 Apr 2016 14:41:58 -0700 Subject: [PATCH] Migrate etherscan configs to our new production RPC. --- app/scripts/background.js | 1 - app/scripts/lib/config-manager.js | 10 +++++++--- app/scripts/lib/migrations.js | 8 ++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 app/scripts/lib/migrations.js diff --git a/app/scripts/background.js b/app/scripts/background.js index dfcdcc06c..a4f80d7f6 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -48,7 +48,6 @@ var providerOpts = { }, approveTransaction: addUnconfirmedTx, signTransaction: idStore.signTransaction.bind(idStore), - etherscan: providerConfig.type === 'etherscan', } var provider = MetaMaskProvider(providerOpts) diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 121ede838..425dee3ac 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -2,7 +2,9 @@ const Migrator = require('pojo-migrator') const extend = require('xtend') const STORAGE_KEY = 'metamask-config' -var DEFAULT_RPC = 'https://rawtestrpc.metamask.io/' +const DEFAULT_RPC = 'https://rawtestrpc.metamask.io/' + +const migrations = require('./migrations') /* The config-manager is a convenience object * wrapping a pojo-migrator. @@ -28,7 +30,7 @@ function ConfigManager() { // // The `migrate` function receives the previous // config data format, and returns the new one. - migrations: [], + migrations: migrations, // How to load initial config. // Includes step on migrating pre-pojo-migrator data. @@ -134,7 +136,9 @@ function loadData() { } catch (e) {} var data = extend({ - version: 0, + meta: { + version: 0, + }, data: { config: { rpcTarget: DEFAULT_RPC, diff --git a/app/scripts/lib/migrations.js b/app/scripts/lib/migrations.js new file mode 100644 index 000000000..cab5bec66 --- /dev/null +++ b/app/scripts/lib/migrations.js @@ -0,0 +1,8 @@ +var path = require('path') +var fs = require('fs') + +var migration2 = require('../migrations/002') + +module.exports = [ + migration2, +]