From 83531c2b68a50e1a1431d920b57a260cc4977f60 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 20 Nov 2020 15:36:11 -0800 Subject: [PATCH 1/3] Closes #9927 Although the root cause is a larger issue (#9053) with our grouping txs with nonces/speedups/cancels/failures(both from the node and on-chain). This PR allows all submitted transactions to be sped up through the use of the inline speedup in the activity log. I do not know if this is the appropriate way we should handle this, and could lead to more user errors than solutions with their state of the tx queue. --- .../transaction-activity-log.component.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js b/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js index 9320a1ac2939..eb6f5095092f 100644 --- a/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js +++ b/ui/app/components/app/transaction-activity-log/transaction-activity-log.component.js @@ -8,7 +8,10 @@ import { import { formatDate } from '../../../helpers/utils/util' import { getEtherscanNetworkPrefix } from '../../../../lib/etherscan-prefix-for-network' import TransactionActivityLogIcon from './transaction-activity-log-icon' -import { CONFIRMED_STATUS } from './transaction-activity-log.constants' +import { + CONFIRMED_STATUS, + TRANSACTION_SUBMITTED_EVENT, +} from './transaction-activity-log.constants' export default class TransactionActivityLog extends PureComponent { static contextTypes = { @@ -39,7 +42,7 @@ export default class TransactionActivityLog extends PureComponent { global.platform.openTab({ url: etherscanUrl }) } - renderInlineRetry(index) { + renderInlineRetry(activity, index) { const { t } = this.context const { inlineRetryIndex, @@ -48,10 +51,12 @@ export default class TransactionActivityLog extends PureComponent { isEarliestNonce, } = this.props const { status } = primaryTransaction + const { eventKey } = activity - return isEarliestNonce && + return (isEarliestNonce && status !== CONFIRMED_STATUS && - index === inlineRetryIndex ? ( + index === inlineRetryIndex) || + eventKey === TRANSACTION_SUBMITTED_EVENT ? (
{t('speedUpTransaction')}
@@ -115,7 +120,7 @@ export default class TransactionActivityLog extends PureComponent { > {activityText} - {this.renderInlineRetry(index)} + {this.renderInlineRetry(activity, index)} {this.renderInlineCancel(index)} From bc94ce4b9cb9bfc81d5088c5f8a5ce513f95c0fd Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 20 Nov 2020 16:03:18 -0800 Subject: [PATCH 2/3] Modify tx activity log test to include rendering inline speedup for submitted txs --- .../tests/transaction-activity-log.component.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js index ec5cbb3dfeb8..68c4a1761e8f 100644 --- a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js +++ b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js @@ -58,7 +58,7 @@ describe('TransactionActivityLog Component', function () { assert.ok(wrapper.hasClass('test-class')) }) - it('should render inline retry and cancel buttons for earliest pending transaction', function () { + it('should render inline retry and cancel buttons for earliest pending transaction and submitted transactions', function () { const activities = [ { eventKey: 'transactionCreated', @@ -111,11 +111,11 @@ describe('TransactionActivityLog Component', function () { assert.ok(wrapper.hasClass('test-class')) assert.equal( wrapper.find('.transaction-activity-log__action-link').length, - 2, + 3, ) }) - it('should not render inline retry and cancel buttons for newer pending transactions', function () { + it('should only render inline retry and cancel buttons for newer pending transactions and submitted txs', function () { const activities = [ { eventKey: 'transactionCreated', @@ -168,7 +168,7 @@ describe('TransactionActivityLog Component', function () { assert.ok(wrapper.hasClass('test-class')) assert.equal( wrapper.find('.transaction-activity-log__action-link').length, - 0, + 1, ) }) }) From 65f3ef6b91599bc6925e24c5f773a7f45097ff70 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 20 Nov 2020 16:06:15 -0800 Subject: [PATCH 3/3] Fix test description --- .../tests/transaction-activity-log.component.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js index 68c4a1761e8f..888718e9e35f 100644 --- a/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js +++ b/ui/app/components/app/transaction-activity-log/tests/transaction-activity-log.component.test.js @@ -115,7 +115,7 @@ describe('TransactionActivityLog Component', function () { ) }) - it('should only render inline retry and cancel buttons for newer pending transactions and submitted txs', function () { + it('should not render inline retry and cancel buttons for newer pending transactions but does for submitted transactions', function () { const activities = [ { eventKey: 'transactionCreated',