aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-02-21 04:13:18 +0800
committerkumavis <aaron@kumavis.me>2016-03-02 04:27:08 +0800
commit4b8be94f5102fb3082a3a671658224eee74832f3 (patch)
tree329e764463e3caff1b18879f14d1f9d7200e34b5 /app
parentbdf262fb180eeddcae05b82eec163efd546e6673 (diff)
downloadtangerine-wallet-browser-4b8be94f5102fb3082a3a671658224eee74832f3.tar
tangerine-wallet-browser-4b8be94f5102fb3082a3a671658224eee74832f3.tar.gz
tangerine-wallet-browser-4b8be94f5102fb3082a3a671658224eee74832f3.tar.bz2
tangerine-wallet-browser-4b8be94f5102fb3082a3a671658224eee74832f3.tar.lz
tangerine-wallet-browser-4b8be94f5102fb3082a3a671658224eee74832f3.tar.xz
tangerine-wallet-browser-4b8be94f5102fb3082a3a671658224eee74832f3.tar.zst
tangerine-wallet-browser-4b8be94f5102fb3082a3a671658224eee74832f3.zip
web3-provider - add nonce tracker
Diffstat (limited to 'app')
-rw-r--r--app/scripts/background.js4
-rw-r--r--app/scripts/lib/metamask-provider.js5
2 files changed, 7 insertions, 2 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 01df16541..8572d53a3 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -4,7 +4,6 @@ const extend = require('xtend')
const EthStore = require('eth-store')
const PortStream = require('./lib/port-stream.js')
const MetaMaskProvider = require('./lib/metamask-provider')
-// const IdentityManager = require('./lib/idmgmt')
const IdentityStore = require('./lib/idStore')
console.log('ready to roll')
@@ -41,7 +40,8 @@ var zeroClient = MetaMaskProvider({
var result = selectedAddress ? [selectedAddress] : []
cb(null, result)
},
- signTransaction: idStore.addUnconfirmedTransaction.bind(idStore),
+ approveTx: idStore.addUnconfirmedTransaction.bind(idStore),
+ signTransaction: idStore.signTransaction.bind(idStore),
})
var ethStore = new EthStore(zeroClient)
idStore.setStore(ethStore)
diff --git a/app/scripts/lib/metamask-provider.js b/app/scripts/lib/metamask-provider.js
index 45da06dcd..589ea0fad 100644
--- a/app/scripts/lib/metamask-provider.js
+++ b/app/scripts/lib/metamask-provider.js
@@ -1,4 +1,5 @@
const ProviderEngine = require('web3-provider-engine')
+const NonceTrackerSubprovider = require('web3-provider-engine/subproviders/nonce-tracker.js')
const CacheSubprovider = require('web3-provider-engine/subproviders/cache.js')
const FixtureSubprovider = require('web3-provider-engine/subproviders/fixture.js')
const FilterSubprovider = require('web3-provider-engine/subproviders/filters.js')
@@ -12,6 +13,9 @@ function metamaskProvider(opts){
var engine = new ProviderEngine()
+ // nonce tracker
+ engine.addProvider(new NonceTrackerSubprovider())
+
// cache layer
engine.addProvider(new CacheSubprovider())
@@ -33,6 +37,7 @@ function metamaskProvider(opts){
// id mgmt
engine.addProvider(new HookedWalletSubprovider({
getAccounts: opts.getAccounts,
+ approveTx: opts.approveTx,
signTransaction: opts.signTransaction,
}))