diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-04-14 03:50:20 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-04-14 03:50:20 +0800 |
commit | 2ed127b51d45eda5cb55a87494fc555fb184728a (patch) | |
tree | da956107e061f2976d0918791b73d5cab4b347fa /app | |
parent | fe3ba9dc2f49f4232568f0ded4a8b850336cabdf (diff) | |
parent | e0ee4365cbd10d478f9424dd1133d4330e6f4697 (diff) | |
download | tangerine-wallet-browser-2ed127b51d45eda5cb55a87494fc555fb184728a.tar tangerine-wallet-browser-2ed127b51d45eda5cb55a87494fc555fb184728a.tar.gz tangerine-wallet-browser-2ed127b51d45eda5cb55a87494fc555fb184728a.tar.bz2 tangerine-wallet-browser-2ed127b51d45eda5cb55a87494fc555fb184728a.tar.lz tangerine-wallet-browser-2ed127b51d45eda5cb55a87494fc555fb184728a.tar.xz tangerine-wallet-browser-2ed127b51d45eda5cb55a87494fc555fb184728a.tar.zst tangerine-wallet-browser-2ed127b51d45eda5cb55a87494fc555fb184728a.zip |
Merge branch 'master' of github.com:MetaMask/metamask-plugin
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/background.js | 1 | ||||
-rw-r--r-- | app/scripts/inpage.js | 4 | ||||
-rw-r--r-- | app/scripts/lib/config-manager.js | 10 | ||||
-rw-r--r-- | app/scripts/lib/migrations.js | 8 | ||||
-rw-r--r-- | app/scripts/migrations/002.js | 13 |
5 files changed, 30 insertions, 6 deletions
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/inpage.js b/app/scripts/inpage.js index c46d0b213..065f69629 100644 --- a/app/scripts/inpage.js +++ b/app/scripts/inpage.js @@ -11,7 +11,7 @@ const createPayload = require('web3-provider-engine/util/create-payload') const StreamProvider = require('./lib/stream-provider.js') const LocalMessageDuplexStream = require('./lib/local-message-stream.js') -const RPC_URL = 'https://rawtestrpc.metamask.io/' +const RPC_URL = 'https://testrpc.metamask.io/' // @@ -57,7 +57,7 @@ var syncProvider = new Web3.providers.HttpProvider(RPC_URL) remoteProvider.send = function(payload){ var result = null switch (payload.method) { - + case 'eth_accounts': // read from localStorage accountsCache = JSON.parse(localStorage['MetaMask-Accounts'] || '[]') diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 121ede838..c557891fe 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://testrpc.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, +] diff --git a/app/scripts/migrations/002.js b/app/scripts/migrations/002.js new file mode 100644 index 000000000..ab6a256ab --- /dev/null +++ b/app/scripts/migrations/002.js @@ -0,0 +1,13 @@ +module.exports = { + version: 2, + + migrate: function(data) { + try { + if (data.config.provider.type === 'etherscan') { + data.config.provider.type = 'rpc' + data.config.provider.rpcTarget = 'https://rpc.metamask.io/' + } + } catch (e) {} + return data + } +} |