Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nonce to transaction details #8716

Merged
merged 1 commit into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/e2e/metamask-ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ describe('MetaMask', function () {
const popoverCloseButton = await driver.findClickableElement(By.css('.popover-header__button'))
const txGasPrices = await driver.findElements(By.css('.transaction-breakdown__value'))
const txGasPriceLabels = await driver.findElements(By.css('.transaction-breakdown-row__title'))
await driver.wait(until.elementTextMatches(txGasPrices[3], /^10$/), 10000)
await driver.wait(until.elementTextMatches(txGasPrices[4], /^10$/), 10000)
assert(txGasPriceLabels[2])
await popoverCloseButton.click()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class TransactionBreakdown extends PureComponent {
className: PropTypes.string,
nativeCurrency: PropTypes.string,
showFiat: PropTypes.bool,
nonce: PropTypes.string,
gas: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
gasPrice: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
Expand All @@ -29,13 +30,22 @@ export default class TransactionBreakdown extends PureComponent {

render () {
const { t } = this.context
const { gas, gasPrice, value, className, nativeCurrency, showFiat, totalInHex, gasUsed } = this.props

const { gas, gasPrice, value, className, nonce, nativeCurrency, showFiat, totalInHex, gasUsed } = this.props
return (
<div className={classnames('transaction-breakdown', className)}>
<div className="transaction-breakdown__title">
{ t('transaction') }
</div>
<TransactionBreakdownRow title="Nonce">
{typeof nonce !== 'undefined'
? (
<HexToDecimal
className="transaction-breakdown__value"
value={nonce}
/>
) : null
}
</TransactionBreakdownRow>
<TransactionBreakdownRow title={t('amount')}>
<UserPreferencedCurrencyDisplay
className="transaction-breakdown__value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export default class TransactionListItemDetails extends PureComponent {
</div>
<div className="transaction-list-item-details__cards-container">
<TransactionBreakdown
nonce={transactionGroup.initialTransaction.txParams.nonce}
transaction={transaction}
className="transaction-list-item-details__transaction-breakdown"
/>
Expand Down