From 576fb26c1558e7e639f28bed07da72d662a5039e Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 29 Mar 2017 11:08:15 -0400 Subject: Add missing migration. --- app/scripts/migrations/index.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index a3dd48c17..019b4d13d 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -22,4 +22,5 @@ module.exports = [ require('./009'), require('./010'), require('./011'), + require('./012'), ] -- cgit v1.2.3 From 610ec2bdf5841c8275073992e67c59fb47faa48c Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 29 Mar 2017 10:40:57 -0700 Subject: Fix popup behavior for Firefox Firefox does not support the `focused` parameter when opening a new window, and we don't actually require it for Chrome either, new popups are at the foreground by default already. --- app/scripts/lib/extension.js | 5 ++++- app/scripts/lib/notifications.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/extension.js b/app/scripts/lib/extension.js index 4b670490f..6f8b5d800 100644 --- a/app/scripts/lib/extension.js +++ b/app/scripts/lib/extension.js @@ -11,4 +11,7 @@ */ const Extension = require('./extension-instance') -module.exports = new Extension() +const instance = new Extension() +window.METAMASK_EXTENSION = instance +module.exports = instance + diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 3db1ac6b5..33914846c 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -22,10 +22,12 @@ function show () { extension.windows.create({ url: 'notification.html', type: 'popup', - focused: true, width, height, }) + .catch((reason) => { + log.error("failed to create poupup", reason) + }) } }) } -- cgit v1.2.3 From 98dd684524fde7548442830fe01e1f3e24a6e67d Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 29 Mar 2017 10:42:43 -0700 Subject: Linted --- app/scripts/lib/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js index 33914846c..0ec01f3a7 100644 --- a/app/scripts/lib/notifications.js +++ b/app/scripts/lib/notifications.js @@ -26,7 +26,7 @@ function show () { height, }) .catch((reason) => { - log.error("failed to create poupup", reason) + log.error('failed to create poupup', reason) }) } }) -- cgit v1.2.3 From 8ade8bdf32933ea9449d06aa6a1fc71c10b461c4 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 29 Mar 2017 13:35:51 -0700 Subject: Fix currency checking for firefox By adding cryptonator to our permitted CORS hosts. Fixes #1285. Will probably trigger additional permissions requests to our users. --- app/manifest.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/manifest.json b/app/manifest.json index 75e72c295..a3242149b 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -57,7 +57,8 @@ "permissions": [ "storage", "clipboardWrite", - "http://localhost:8545/" + "http://localhost:8545/", + "https://www.cryptonator.com/" ], "web_accessible_resources": [ "scripts/inpage.js" -- cgit v1.2.3 From ff49e5e5cf3aadf63dbdf6570407c23e1ae6cdb9 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 29 Mar 2017 23:21:31 -0700 Subject: tx-utils - gas buffer ceiling at 90% of block gas limit --- app/scripts/lib/tx-utils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/lib/tx-utils.js b/app/scripts/lib/tx-utils.js index 72df53631..e8e23f8b5 100644 --- a/app/scripts/lib/tx-utils.js +++ b/app/scripts/lib/tx-utils.js @@ -63,14 +63,15 @@ module.exports = class txProviderUtils { addGasBuffer (initialGasLimitHex, blockGasLimitHex) { const initialGasLimitBn = hexToBn(initialGasLimitHex) const blockGasLimitBn = hexToBn(blockGasLimitHex) + const upperGasLimitBn = blockGasLimitBn.muln(0.9) const bufferedGasLimitBn = initialGasLimitBn.muln(1.5) // if initialGasLimit is above blockGasLimit, dont modify it - if (initialGasLimitBn.gt(blockGasLimitBn)) return bnToHex(initialGasLimitBn) + if (initialGasLimitBn.gt(upperGasLimitBn)) return bnToHex(initialGasLimitBn) // if bufferedGasLimit is below blockGasLimit, use bufferedGasLimit - if (bufferedGasLimitBn.lt(blockGasLimitBn)) return bnToHex(bufferedGasLimitBn) + if (bufferedGasLimitBn.lt(upperGasLimitBn)) return bnToHex(bufferedGasLimitBn) // otherwise use blockGasLimit - return bnToHex(blockGasLimitBn) + return bnToHex(upperGasLimitBn) } fillInTxParams (txParams, cb) { -- cgit v1.2.3 From 1dce352523a1f79f052ef79c707d9bc44787b706 Mon Sep 17 00:00:00 2001 From: kumavis Date: Thu, 30 Mar 2017 14:23:23 -0700 Subject: tx-manager - add eip155 support --- app/scripts/transaction-manager.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js index a70159680..d7051b2cb 100644 --- a/app/scripts/transaction-manager.js +++ b/app/scripts/transaction-manager.js @@ -205,11 +205,23 @@ module.exports = class TransactionManager extends EventEmitter { }) } + getChainId() { + const networkState = this.networkStore.getState() + const getChainId = parseInt(networkState.network) + if (Number.isNaN(getChainId)) { + return 0 + } else { + return getChainId + } + } + signTransaction (txId, cb) { - let txMeta = this.getTx(txId) - let txParams = txMeta.txParams - let fromAddress = txParams.from - let ethTx = this.txProviderUtils.buildEthTxFromParams(txParams) + const txMeta = this.getTx(txId) + const txParams = txMeta.txParams + const fromAddress = txParams.from + // add network/chain id + txParams.chainId = this.getChainId() + const ethTx = this.txProviderUtils.buildEthTxFromParams(txParams) this.signEthTx(ethTx, fromAddress).then(() => { this.setTxStatusSigned(txMeta.id) cb(null, ethUtil.bufferToHex(ethTx.serialize())) -- cgit v1.2.3