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 --- ui/app/components/hex-as-decimal-input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app') 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(-) (limited to 'ui/app') 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 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 --- ui/app/components/transaction-list-item.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'ui/app') 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 --- ui/app/components/transaction-list-item-icon.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'ui/app') 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(-) (limited to 'ui/app') 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(-) (limited to 'ui/app') 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 --- ui/app/components/transaction-list-item.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app') 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