aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-04-27 02:36:05 +0800
committerkumavis <aaron@kumavis.me>2016-04-27 02:36:23 +0800
commitc66ac13cc93948945912690dffc4940f33fa1dfa (patch)
tree2ff8cbefca4bd583a201f2ae5fad7c20896192d4 /app
parent0c293f9df0e6b8284f88f2362aa1099486254dab (diff)
downloadtangerine-wallet-browser-c66ac13cc93948945912690dffc4940f33fa1dfa.tar
tangerine-wallet-browser-c66ac13cc93948945912690dffc4940f33fa1dfa.tar.gz
tangerine-wallet-browser-c66ac13cc93948945912690dffc4940f33fa1dfa.tar.bz2
tangerine-wallet-browser-c66ac13cc93948945912690dffc4940f33fa1dfa.tar.lz
tangerine-wallet-browser-c66ac13cc93948945912690dffc4940f33fa1dfa.tar.xz
tangerine-wallet-browser-c66ac13cc93948945912690dffc4940f33fa1dfa.tar.zst
tangerine-wallet-browser-c66ac13cc93948945912690dffc4940f33fa1dfa.zip
provider - use provider-engine zero
Diffstat (limited to 'app')
-rw-r--r--app/scripts/background.js2
-rw-r--r--app/scripts/lib/zero.js65
2 files changed, 1 insertions, 66 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 1519f63db..e5281b8d6 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -5,7 +5,7 @@ const combineStreams = require('pumpify')
const extend = require('xtend')
const EthStore = require('eth-store')
const PortStream = require('./lib/port-stream.js')
-const MetaMaskProvider = require('./lib/zero.js')
+const MetaMaskProvider = require('web3-provider-engine/zero.js')
const IdentityStore = require('./lib/idStore')
const createTxNotification = require('./lib/tx-notification.js')
const configManager = require('./lib/config-manager-singleton')
diff --git a/app/scripts/lib/zero.js b/app/scripts/lib/zero.js
deleted file mode 100644
index d33f099d3..000000000
--- a/app/scripts/lib/zero.js
+++ /dev/null
@@ -1,65 +0,0 @@
-const ProviderEngine = require('web3-provider-engine/index.js')
-const DefaultFixture = require('web3-provider-engine/subproviders/default-fixture.js')
-const NonceTrackerSubprovider = require('web3-provider-engine/subproviders/nonce-tracker.js')
-const CacheSubprovider = require('web3-provider-engine/subproviders/cache.js')
-const FilterSubprovider = require('web3-provider-engine/subproviders/filters.js')
-const HookedWalletSubprovider = require('web3-provider-engine/subproviders/hooked-wallet.js')
-const RpcSubprovider = require('web3-provider-engine/subproviders/rpc.js')
-const EtherscanSubprovider = require('web3-provider-engine/subproviders/etherscan.js')
-
-
-module.exports = ZeroClientProvider
-
-
-function ZeroClientProvider(opts){
- opts = opts || {}
-
- var engine = new ProviderEngine()
-
- // static
- var staticSubprovider = new DefaultFixture()
- engine.addProvider(staticSubprovider)
-
- // nonce tracker
- engine.addProvider(new NonceTrackerSubprovider())
-
- // cache layer
- var cacheSubprovider = new CacheSubprovider()
- engine.addProvider(cacheSubprovider)
-
- // filters
- var filterSubprovider = new FilterSubprovider()
- engine.addProvider(filterSubprovider)
-
- // id mgmt
- var idmgmtSubprovider = new HookedWalletSubprovider({
- getAccounts: opts.getAccounts,
- approveTransaction: opts.approveTransaction,
- signTransaction: opts.signTransaction,
- })
- engine.addProvider(idmgmtSubprovider)
-
- // data source
- var dataProvider
- if (!opts.etherscan) {
- dataProvider = new RpcSubprovider({
- rpcUrl: opts.rpcUrl || 'https://testrpc.metamask.io/',
- })
- } else {
- dataProvider = new EtherscanSubprovider()
- }
- engine.addProvider(dataProvider)
-
- // // log new blocks
- // engine.on('block', function(block){
- // console.log('================================')
- // console.log('BLOCK CHANGED:', '#'+block.number.toString('hex'), '0x'+block.hash.toString('hex'))
- // console.log('================================')
- // })
-
- // start polling
- engine.start()
-
- return engine
-
-}