File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 22
33## Current Master
44
5+ - Fix bug that would cause MetaMask to occasionally lose its StreamProvider connection and drop requests.
6+
57## 2.13.8 2016-11-16
68
79- Show a warning when a transaction fails during simulation.
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const EthQuery = require('eth-query')
77const KeyStore = require ( 'eth-lightwallet' ) . keystore
88const clone = require ( 'clone' )
99const extend = require ( 'xtend' )
10- const createId = require ( 'web3-provider-engine/util /random-id' )
10+ const createId = require ( '. /random-id' )
1111const ethBinToOps = require ( 'eth-bin-to-ops' )
1212const autoFaucet = require ( './auto-faucet' )
1313const messageManager = require ( './message-manager' )
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const Streams = require('mississippi')
22const StreamProvider = require ( 'web3-stream-provider' )
33const ObjectMultiplex = require ( './obj-multiplex' )
44const RemoteStore = require ( './remote-store.js' ) . RemoteStore
5+ const createRandomId = require ( './random-id' )
56
67module . exports = MetamaskInpageProvider
78
@@ -119,16 +120,6 @@ function remoteStoreWithLocalStorageCache (storageKey) {
119120 return store
120121}
121122
122- function createRandomId ( ) {
123- const extraDigits = 3
124- // 13 time digits
125- const datePart = new Date ( ) . getTime ( ) * Math . pow ( 10 , extraDigits )
126- // 3 random digits
127- const extraPart = Math . floor ( Math . random ( ) * Math . pow ( 10 , extraDigits ) )
128- // 16 digits
129- return datePart + extraPart
130- }
131-
132123function eachJsonMessage ( payload , transformFn ) {
133124 if ( Array . isArray ( payload ) ) {
134125 return payload . map ( transformFn )
Original file line number Diff line number Diff line change 1+ const MAX = 1000000000
2+
3+ let idCounter = Math . round ( Math . random ( ) * MAX )
4+ function createRandomId ( ) {
5+ idCounter = idCounter % MAX
6+ return idCounter ++
7+ }
8+
9+ module . exports = createRandomId
You can’t perform that action at this time.
0 commit comments