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

Show raw data for unencrypted transactions #896

Merged
merged 1 commit into from Sep 27, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/896.feature.md
@@ -0,0 +1 @@
Show raw data for unencrypted transactions
10 changes: 10 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,15 @@ 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>
<LongDataDisplay data={base64ToHex(transaction.body.data)} threshold={300} />
</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