From 24737ded3466da61fd96015beb6931e59d8232a7 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 17 May 2017 14:13:05 -0700 Subject: Fix bug where decimals in gas inputs gave strange results --- CHANGELOG.md | 1 + ui/app/components/hex-as-decimal-input.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 998219254..24ae4e781 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Fix bug where edited gas parameters would not take effect. - Trim currency list. - Fix event filter bug introduced by newer versions of Geth. +- Fix bug where decimals in gas inputs could result in strange values. ## 3.6.4 2017-5-8 diff --git a/ui/app/components/hex-as-decimal-input.js b/ui/app/components/hex-as-decimal-input.js index e37aaa8c3..d24fdcb7b 100644 --- a/ui/app/components/hex-as-decimal-input.js +++ b/ui/app/components/hex-as-decimal-input.js @@ -139,7 +139,7 @@ HexAsDecimalInput.prototype.constructWarning = function () { } function hexify (decimalString) { - const hexBN = new BN(decimalString, 10) + const hexBN = new BN(decimalString.split('.')[0], 10) return '0x' + hexBN.toString('hex') } -- cgit v1.2.3 From 7e7ceab95edcf27a240da478a1f5da2d97cd5e85 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 17 May 2017 14:31:06 -0700 Subject: Fix decimal tolerance --- ui/app/components/hex-as-decimal-input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/hex-as-decimal-input.js b/ui/app/components/hex-as-decimal-input.js index d24fdcb7b..4a71e9585 100644 --- a/ui/app/components/hex-as-decimal-input.js +++ b/ui/app/components/hex-as-decimal-input.js @@ -139,7 +139,7 @@ HexAsDecimalInput.prototype.constructWarning = function () { } function hexify (decimalString) { - const hexBN = new BN(decimalString.split('.')[0], 10) + const hexBN = new BN(parseInt(decimalString), 10) return '0x' + hexBN.toString('hex') } -- cgit v1.2.3 From 2a25f99461c01ac9e0aec3d90f73675c58303860 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 17 May 2017 14:36:50 -0700 Subject: Version 3.6.5 --- CHANGELOG.md | 2 ++ app/manifest.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24ae4e781..371b348ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +## 3.6.5 2017-5-17 + - Fix bug where edited gas parameters would not take effect. - Trim currency list. - Fix event filter bug introduced by newer versions of Geth. diff --git a/app/manifest.json b/app/manifest.json index a1f6d7855..31e4598c7 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.6.4", + "version": "3.6.5", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", -- cgit v1.2.3 From c5432da567b9953c1294e0bf598a0310127bf808 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Sat, 20 May 2017 20:37:47 -0700 Subject: Add new streaming subprovider but getting a loop Regarding #1458 Uses a new streaming subprovider architecture on an experimental branch of StreamProvider: https://github.com/flyswatter/web3-stream-provider/tree/StreamSubprovider --- app/scripts/lib/inpage-provider.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index e5e398e24..88d81cca5 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -1,5 +1,6 @@ const pipe = require('pump') -const StreamProvider = require('web3-stream-provider') +const StreamSubprovider = require('web3-stream-provider/stream-subprovider') +const ProviderEngine = require('web3-provider-engine') const LocalStorageStore = require('obs-store') const ObjectMultiplex = require('./obj-multiplex') const createRandomId = require('./random-id') @@ -27,14 +28,21 @@ function MetamaskInpageProvider (connectionStream) { ) // connect to async provider - const asyncProvider = self.asyncProvider = new StreamProvider() + const engine = self.asyncProvider = new ProviderEngine() + + const stream = self.stream = new StreamSubprovider() + engine.addProvider(stream) + pipe( - asyncProvider, + stream, multiStream.createStream('provider'), - asyncProvider, + stream, (err) => logStreamDisconnectWarning('MetaMask RpcProvider', err) ) + // start polling + engine.start() + self.idMap = {} // handle sendAsync requests via asyncProvider self.sendAsync = function (payload, cb) { @@ -46,7 +54,9 @@ function MetamaskInpageProvider (connectionStream) { return message }) // forward to asyncProvider - asyncProvider.sendAsync(request, function (err, res) { + console.log('sending async to engine', request) + engine.sendAsync(request, function (err, res) { + console.log('send async returned !!', err, res) if (err) return cb(err) // transform messages to original ids eachJsonMessage(res, (message) => { -- cgit v1.2.3 From 6209224a6c1129817ebb4cd4a433cf456631c33a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Sun, 21 May 2017 14:09:44 -0700 Subject: Add transaction number (nonce) to tx list --- CHANGELOG.md | 2 ++ ui/app/components/transaction-list-item.js | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 371b348ca..7f894f935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Add Transaction Number (nonce) to transaction list. + ## 3.6.5 2017-5-17 - Fix bug where edited gas parameters would not take effect. diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index c2a585003..18ee10578 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -8,6 +8,7 @@ const explorerLink = require('../../lib/explorer-link') const CopyButton = require('./copyButton') const vreme = new (require('vreme')) const Tooltip = require('./tooltip') +const BN = require('ethereumjs-util').BN const TransactionIcon = require('./transaction-list-item-icon') const ShiftListItem = require('./shift-list-item') @@ -39,6 +40,8 @@ TransactionListItem.prototype.render = function () { txParams = transaction.msgParams } + const nonce = (new BN(txParams.nonce.substr(2))).toString(10) + const isClickable = ('hash' in transaction && isLinkable) || isPending return ( h(`.transaction-list-item.flex-row.flex-space-between${isClickable ? '.pointer' : ''}`, { @@ -69,6 +72,24 @@ TransactionListItem.prototype.render = function () { ]), ]), + h(Tooltip, { + title: 'Transaction Number', + position: 'bottom', + }, + [ + h('span', { + style: { + display: 'flex', + cursor: 'normal', + flexDirection: 'column', + alignItems: 'center', + justifyContent: 'center', + padding: '10px', + }, + }, nonce), + ]), + + h('.flex-column', {style: {width: '200px', overflow: 'hidden'}}, [ domainField(txParams), h('div', date), -- cgit v1.2.3 From 3c90024564bee78fe0a9178d3772efaabe147ac5 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Sun, 21 May 2017 14:15:34 -0700 Subject: Label the pending tx icon with a tooltip --- CHANGELOG.md | 1 + ui/app/components/transaction-list-item-icon.js | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f894f935..50fa0d858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Current Master - Add Transaction Number (nonce) to transaction list. +- Label the pending tx icon with a tooltip. ## 3.6.5 2017-5-17 diff --git a/ui/app/components/transaction-list-item-icon.js b/ui/app/components/transaction-list-item-icon.js index d63cae259..03c6f6615 100644 --- a/ui/app/components/transaction-list-item-icon.js +++ b/ui/app/components/transaction-list-item-icon.js @@ -1,6 +1,7 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits +const Tooltip = require('./tooltip') const Identicon = require('./identicon') @@ -32,11 +33,17 @@ TransactionIcon.prototype.render = function () { }) case 'submitted': - return h('i.fa.fa-ellipsis-h', { - style: { - fontSize: '27px', - }, - }) + return h(Tooltip, { + title: 'Pending', + position: 'bottom', + }, + [ + h('i.fa.fa-ellipsis-h', { + style: { + fontSize: '27px', + }, + }) + ]) } if (isMsg) { -- cgit v1.2.3 From 0ef9e8b7094374b44d7a3bed6730d9d6815a17ec Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Sun, 21 May 2017 14:18:23 -0700 Subject: Lint --- ui/app/components/transaction-list-item-icon.js | 5 ++--- ui/app/components/transaction-list-item.js | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ui/app/components/transaction-list-item-icon.js b/ui/app/components/transaction-list-item-icon.js index 03c6f6615..431054340 100644 --- a/ui/app/components/transaction-list-item-icon.js +++ b/ui/app/components/transaction-list-item-icon.js @@ -36,13 +36,12 @@ TransactionIcon.prototype.render = function () { return h(Tooltip, { title: 'Pending', position: 'bottom', - }, - [ + }, [ h('i.fa.fa-ellipsis-h', { style: { fontSize: '27px', }, - }) + }), ]) } diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 18ee10578..e0612c7bf 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -75,8 +75,7 @@ TransactionListItem.prototype.render = function () { h(Tooltip, { title: 'Transaction Number', position: 'bottom', - }, - [ + }, [ h('span', { style: { display: 'flex', @@ -89,7 +88,6 @@ TransactionListItem.prototype.render = function () { }, nonce), ]), - h('.flex-column', {style: {width: '200px', overflow: 'hidden'}}, [ domainField(txParams), h('div', date), -- cgit v1.2.3 From 954d8bd111ea70b823267b89edb415e2d28caec3 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 May 2017 14:14:13 -0700 Subject: Render txs with no nonce --- ui/app/components/transaction-list-item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index e0612c7bf..4f0e6132a 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -40,7 +40,7 @@ TransactionListItem.prototype.render = function () { txParams = transaction.msgParams } - const nonce = (new BN(txParams.nonce.substr(2))).toString(10) + const nonce = txParams.nonce ? (new BN(txParams.nonce.substr(2))).toString(10) : '' const isClickable = ('hash' in transaction && isLinkable) || isPending return ( -- cgit v1.2.3 From 709c0eb307e2cda9aa16b67191a43e99e1b22fa0 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 May 2017 15:21:25 -0700 Subject: Use stream-provider v3 api --- app/scripts/popup-core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/popup-core.js b/app/scripts/popup-core.js index f1eb394d7..7de1a6fda 100644 --- a/app/scripts/popup-core.js +++ b/app/scripts/popup-core.js @@ -29,9 +29,9 @@ function connectToAccountManager (connectionStream, cb) { function setupWeb3Connection (connectionStream) { var providerStream = new StreamProvider() - providerStream.pipe(connectionStream).pipe(providerStream) + providerStream.stream.pipe(connectionStream).pipe(providerStream.stream) connectionStream.on('error', console.error.bind(console)) - providerStream.on('error', console.error.bind(console)) + providerStream.stream.on('error', console.error.bind(console)) global.ethereumProvider = providerStream global.ethQuery = new EthQuery(providerStream) } -- cgit v1.2.3 From 48d9a2107130e3850077c6c1789b29a09634b168 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 May 2017 15:23:29 -0700 Subject: Use filter subprovider in-page to avoid filter leaks --- app/scripts/lib/inpage-provider.js | 8 ++++++-- package.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 88d81cca5..9dea05dbb 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -1,6 +1,7 @@ const pipe = require('pump') -const StreamSubprovider = require('web3-stream-provider/stream-subprovider') const ProviderEngine = require('web3-provider-engine') +const FilterSubprovider = require('web3-provider-engine/subproviders/filters') +const StreamSubprovider = require('web3-stream-provider/stream-subprovider') const LocalStorageStore = require('obs-store') const ObjectMultiplex = require('./obj-multiplex') const createRandomId = require('./random-id') @@ -28,7 +29,10 @@ function MetamaskInpageProvider (connectionStream) { ) // connect to async provider - const engine = self.asyncProvider = new ProviderEngine() + const engine = new ProviderEngine() + + const filterSubprovider = new FilterSubprovider() + engine.addProvider(filterSubprovider) const stream = self.stream = new StreamSubprovider() engine.addProvider(stream) diff --git a/package.json b/package.json index 14ddd2886..5512fa6a4 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "vreme": "^3.0.2", "web3": "0.18.2", "web3-provider-engine": "^12.0.6", - "web3-stream-provider": "^2.0.6", + "web3-stream-provider": "^3.0.0", "xtend": "^4.0.1" }, "devDependencies": { -- cgit v1.2.3 From 39f9ffa18ab76fe154f9d5d4b3b2e5631d95fdc4 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 May 2017 15:25:31 -0700 Subject: Bump changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 371b348ca..c31f26f04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Current Master +- Fix bug where website filters would pile up and not deallocate when leaving a site. + ## 3.6.5 2017-5-17 - Fix bug where edited gas parameters would not take effect. -- cgit v1.2.3 From cbfaa6f56f685d515e170de2bf305da76b8ec1e0 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 May 2017 15:41:13 -0700 Subject: Rename stream to streamSubprovider --- app/scripts/lib/inpage-provider.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 9dea05dbb..3b60756b9 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -34,13 +34,13 @@ function MetamaskInpageProvider (connectionStream) { const filterSubprovider = new FilterSubprovider() engine.addProvider(filterSubprovider) - const stream = self.stream = new StreamSubprovider() - engine.addProvider(stream) + const streamSubprovider = new StreamSubprovider() + engine.addProvider(streamSubprovider) pipe( - stream, + streamSubprovider, multiStream.createStream('provider'), - stream, + streamSubprovider, (err) => logStreamDisconnectWarning('MetaMask RpcProvider', err) ) -- cgit v1.2.3 From 058b73221393467549cca04937267635e471aae1 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 May 2017 15:43:20 -0700 Subject: Tolerate nonces of any format --- package.json | 1 + ui/app/components/transaction-list-item.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 14ddd2886..6fb9513d5 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "mississippi": "^1.2.0", "mkdirp": "^0.5.1", "multiplex": "^6.7.0", + "number-to-bn": "^1.7.0", "obs-store": "^2.3.1", "once": "^1.3.3", "ping-pong-stream": "^1.0.0", diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 4f0e6132a..dbda66a31 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -8,7 +8,7 @@ const explorerLink = require('../../lib/explorer-link') const CopyButton = require('./copyButton') const vreme = new (require('vreme')) const Tooltip = require('./tooltip') -const BN = require('ethereumjs-util').BN +const numberToBN = require('number-to-bn') const TransactionIcon = require('./transaction-list-item-icon') const ShiftListItem = require('./shift-list-item') @@ -40,7 +40,7 @@ TransactionListItem.prototype.render = function () { txParams = transaction.msgParams } - const nonce = txParams.nonce ? (new BN(txParams.nonce.substr(2))).toString(10) : '' + const nonce = txParams.nonce ? numberToBN(txParams.nonce).toString(10) : '' const isClickable = ('hash' in transaction && isLinkable) || isPending return ( -- cgit v1.2.3 From 1c1400b584a97e05e3f39748e5f44f076328d89b Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 22 May 2017 15:59:07 -0700 Subject: deps - use stream-subprovider from provider-engine --- app/scripts/lib/inpage-provider.js | 2 +- app/scripts/popup-core.js | 4 ++-- package.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 3b60756b9..d24121ade 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -1,7 +1,7 @@ const pipe = require('pump') const ProviderEngine = require('web3-provider-engine') const FilterSubprovider = require('web3-provider-engine/subproviders/filters') -const StreamSubprovider = require('web3-stream-provider/stream-subprovider') +const StreamSubprovider = require('web3-provider-engine/subproviders/stream') const LocalStorageStore = require('obs-store') const ObjectMultiplex = require('./obj-multiplex') const createRandomId = require('./random-id') diff --git a/app/scripts/popup-core.js b/app/scripts/popup-core.js index 7de1a6fda..f1eb394d7 100644 --- a/app/scripts/popup-core.js +++ b/app/scripts/popup-core.js @@ -29,9 +29,9 @@ function connectToAccountManager (connectionStream, cb) { function setupWeb3Connection (connectionStream) { var providerStream = new StreamProvider() - providerStream.stream.pipe(connectionStream).pipe(providerStream.stream) + providerStream.pipe(connectionStream).pipe(providerStream) connectionStream.on('error', console.error.bind(console)) - providerStream.stream.on('error', console.error.bind(console)) + providerStream.on('error', console.error.bind(console)) global.ethereumProvider = providerStream global.ethQuery = new EthQuery(providerStream) } diff --git a/package.json b/package.json index 5512fa6a4..dba82d17c 100644 --- a/package.json +++ b/package.json @@ -121,8 +121,8 @@ "valid-url": "^1.0.9", "vreme": "^3.0.2", "web3": "0.18.2", - "web3-provider-engine": "^12.0.6", - "web3-stream-provider": "^3.0.0", + "web3-provider-engine": "^12.1.0", + "web3-stream-provider": "^2.0.6", "xtend": "^4.0.1" }, "devDependencies": { -- cgit v1.2.3 From b217ad1ae8109e9648da948bde06cdc88317396a Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 22 May 2017 16:06:22 -0700 Subject: clean - remove console logs --- app/scripts/lib/inpage-provider.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index d24121ade..e54f547bd 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -58,9 +58,7 @@ function MetamaskInpageProvider (connectionStream) { return message }) // forward to asyncProvider - console.log('sending async to engine', request) engine.sendAsync(request, function (err, res) { - console.log('send async returned !!', err, res) if (err) return cb(err) // transform messages to original ids eachJsonMessage(res, (message) => { -- cgit v1.2.3 From be5af7cb4bb44731504357e010bf78b3eda9d543 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 22 May 2017 17:45:29 -0700 Subject: Throw if ENS Resolver isn't set up Instead of resolving to name owners, which can encourage inconsistent usage of ENS. Fixes #1427. --- CHANGELOG.md | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 265c239b2..dab16c89a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Add Transaction Number (nonce) to transaction list. - Label the pending tx icon with a tooltip. - Fix bug where website filters would pile up and not deallocate when leaving a site. +- ENS names will no longer resolve to their owner if no resolver is set. Resolvers must be explicitly set and configured. ## 3.6.5 2017-5-17 diff --git a/package.json b/package.json index 271e2a397..6b6996d9d 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "ethereumjs-tx": "^1.3.0", "ethereumjs-util": "ethereumjs/ethereumjs-util#ac5d0908536b447083ea422b435da27f26615de9", "ethereumjs-wallet": "^0.6.0", - "ethjs-ens": "^1.0.2", + "ethjs-ens": "^2.0.0", "express": "^4.14.0", "extension-link-enabler": "^1.0.0", "extensionizer": "^1.0.0", -- cgit v1.2.3