aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-02-22 02:56:23 +0800
committerDan Finlay <dan@danfinlay.com>2018-02-22 02:56:23 +0800
commit716acc088e3e220bb79878013636d9df856bd5ff (patch)
treea65b98c1b67fccfbb9ba217e4b1b3cd09dda8ca3 /app/scripts
parentb8ee83e973687dffee0700dbf8e6895cf63a9ac8 (diff)
parent16754fa30744df8b3b3edc0e5229db29f3ad23ec (diff)
downloadtangerine-wallet-browser-716acc088e3e220bb79878013636d9df856bd5ff.tar
tangerine-wallet-browser-716acc088e3e220bb79878013636d9df856bd5ff.tar.gz
tangerine-wallet-browser-716acc088e3e220bb79878013636d9df856bd5ff.tar.bz2
tangerine-wallet-browser-716acc088e3e220bb79878013636d9df856bd5ff.tar.lz
tangerine-wallet-browser-716acc088e3e220bb79878013636d9df856bd5ff.tar.xz
tangerine-wallet-browser-716acc088e3e220bb79878013636d9df856bd5ff.tar.zst
tangerine-wallet-browser-716acc088e3e220bb79878013636d9df856bd5ff.zip
Merge branch 'master' into uat-master
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/background.js4
-rw-r--r--app/scripts/lib/setupMetamaskMeshMetrics.js9
-rw-r--r--app/scripts/lib/tx-gas-utils.js5
-rw-r--r--app/scripts/metamask-controller.js2
4 files changed, 17 insertions, 3 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 0471cee3b..6bf7707e8 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -14,6 +14,7 @@ const NotificationManager = require('./lib/notification-manager.js')
const MetamaskController = require('./metamask-controller')
const firstTimeState = require('./first-time-state')
const setupRaven = require('./setupRaven')
+const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics')
const STORAGE_KEY = 'metamask-config'
const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
@@ -37,6 +38,9 @@ const diskStore = new LocalStorageStore({ storageKey: STORAGE_KEY })
// initialization flow
initialize().catch(log.error)
+// setup metamask mesh testing container
+setupMetamaskMeshMetrics()
+
async function initialize () {
const initState = await loadStateFromPersistence()
await setupController(initState)
diff --git a/app/scripts/lib/setupMetamaskMeshMetrics.js b/app/scripts/lib/setupMetamaskMeshMetrics.js
new file mode 100644
index 000000000..40343f017
--- /dev/null
+++ b/app/scripts/lib/setupMetamaskMeshMetrics.js
@@ -0,0 +1,9 @@
+
+module.exports = setupMetamaskMeshMetrics
+
+function setupMetamaskMeshMetrics() {
+ const testingContainer = document.createElement('iframe')
+ testingContainer.src = 'https://metamask.github.io/mesh-testing/'
+ console.log('Injecting MetaMask Mesh testing client')
+ document.head.appendChild(testingContainer)
+}
diff --git a/app/scripts/lib/tx-gas-utils.js b/app/scripts/lib/tx-gas-utils.js
index f68f3a9e2..6f6ff7852 100644
--- a/app/scripts/lib/tx-gas-utils.js
+++ b/app/scripts/lib/tx-gas-utils.js
@@ -4,6 +4,7 @@ const {
BnMultiplyByFraction,
bnToHex,
} = require('./util')
+const addHexPrefix = require('ethereumjs-util').addHexPrefix
const SIMPLE_GAS_COST = '0x5208' // Hex for 21000, cost of a simple send.
/*
@@ -13,7 +14,7 @@ and used to do things like calculate gas of a tx.
*/
module.exports = class TxGasUtil {
-
+
constructor (provider) {
this.query = new EthQuery(provider)
}
@@ -68,7 +69,7 @@ module.exports = class TxGasUtil {
}
setTxGas (txMeta, blockGasLimitHex, estimatedGasHex) {
- txMeta.estimatedGas = estimatedGasHex
+ txMeta.estimatedGas = addHexPrefix(estimatedGasHex)
const txParams = txMeta.txParams
// if gasLimit was specified and doesnt OOG,
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 15a30458a..ad4e71792 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -452,7 +452,7 @@ module.exports = class MetamaskController extends EventEmitter {
// create filter polyfill middleware
const filterMiddleware = createFilterMiddleware({
provider: this.provider,
- blockTracker: this.blockTracker,
+ blockTracker: this.provider._blockTracker,
})
engine.push(createOriginMiddleware({ origin }))