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 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