Skip to content

Commit

Permalink
Show raw data for unencrypted transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Sep 26, 2023
1 parent 14a6592 commit 53eadfd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/896.feature.md
@@ -0,0 +1 @@
Show raw data for unencrypted transactions
12 changes: 12 additions & 0 deletions src/app/pages/TransactionDetailPage/index.tsx
Expand Up @@ -36,6 +36,7 @@ import { TransactionEncrypted } from '../../components/TransactionEncryptionStat
import Typography from '@mui/material/Typography'
import { LongDataDisplay } from '../../components/LongDataDisplay'
import { getPreciseNumberFormat } from '../../../locales/getPreciseNumberFormat'
import { base64ToHex } from '../../utils/helpers'

type TransactionSelectionResult = {
wantedTransaction?: RuntimeTransaction
Expand Down Expand Up @@ -335,6 +336,17 @@ export const TransactionDetailView: FC<{
<dt>{t('common.gasLimit')}</dt>
<dd>{transaction.gas_limit.toLocaleString()}</dd>

{transaction.body?.data !== undefined && !transaction.encryption_envelope && (
<>
<dt>{t('transaction.rawData')}</dt>
<dd>
<Typography variant="mono" sx={{ overflowWrap: 'anywhere' }}>
{base64ToHex(transaction.body.data)}
</Typography>
</dd>
</>
)}

{transaction.encryption_envelope && (
<>
<dt>{t('transactions.encryption.format')}</dt>
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Expand Up @@ -267,6 +267,7 @@
"transaction": {
"header": "Transaction",
"warningMultipleTransactionsSameHash": "Please make sure you're looking at the right transaction. There is more than one transaction with this hash, which is extremely rare. We are showing the most recent successful one.",
"rawData": "Raw Data",
"tooltips": {
"txTooltipEth": "Ethereum hash for the transaction",
"senderTooltipEth": "Ethereum address for the sender",
Expand Down

0 comments on commit 53eadfd

Please sign in to comment.