File tree Expand file tree Collapse file tree 7 files changed +36
-1
lines changed
components/LongDataDisplay
pages/RuntimeTransactionDetailPage Expand file tree Collapse file tree 7 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 1+ Display evm_fn_params in transaction details
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ const config = {
3535 name : 'date-fns/formatDistanceToNow' ,
3636 message : 'Use formatDistanceToNow from dateFormatter.ts instead.' ,
3737 } ,
38+ {
39+ name : 'js-yaml' ,
40+ message : "Use 'yamlDump' instead." ,
41+ } ,
3842 ] ,
3943 patterns : [
4044 {
Original file line number Diff line number Diff line change 6464 "bip39" : " ^3.1.0" ,
6565 "date-fns" : " 3.6.0" ,
6666 "i18next" : " 23.16.8" ,
67+ "js-yaml" : " ^4.1.0" ,
6768 "monaco-editor" : " ^0.52.2" ,
6869 "react" : " 18.3.1" ,
6970 "react-dom" : " 18.3.1" ,
8081 "@testing-library/jest-dom" : " ^6.6.3" ,
8182 "@testing-library/react" : " ^16.3.0" ,
8283 "@testing-library/user-event" : " 14.5.2" ,
84+ "@types/js-yaml" : " ^4.0.9" ,
8385 "@types/node" : " 20.17.24" ,
8486 "@types/node-fetch" : " 2.6.12" ,
8587 "@types/react" : " 18.3.19" ,
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ export const LongDataDisplay: FC<{ data: string; fontWeight?: number; collapsedL
6868 display : '-webkit-box' ,
6969 WebkitLineClamp : isExpanded ? 'none' : collapsedLinesNumber ,
7070 WebkitBoxOrient : 'vertical' ,
71+ whiteSpace : 'pre-wrap' ,
7172 } }
7273 >
7374 { data }
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ import Link from '@mui/material/Link'
4444import { Link as RouterLink } from 'react-router-dom'
4545import { RouteUtils } from '../../utils/route-utils'
4646import Tooltip from '@mui/material/Tooltip'
47+ import { yamlDump } from '../../utils/yamlDump'
4748
4849export const RuntimeTransactionDetailPage : FC = ( ) => {
4950 const { t } = useTranslation ( )
@@ -179,7 +180,18 @@ export const RuntimeTransactionDetailView: FC<{
179180 < dd >
180181 < RuntimeTransactionMethod transaction = { transaction } />
181182 </ dd >
182-
183+ { transaction . evm_fn_params && (
184+ < >
185+ < dt > { t ( 'transactions.method.evm.call' ) } </ dt >
186+ < dd >
187+ < LongDataDisplay
188+ data = { `${ transaction . evm_fn_name } (\n${ yamlDump ( transaction . evm_fn_params . map ( a => ( { [ a . name ] : a . value } ) ) ) } )` }
189+ collapsedLinesNumber = { 8 }
190+ fontWeight = { 400 }
191+ />
192+ </ dd >
193+ </ >
194+ ) }
183195 < dt > { t ( 'transactions.encryption.format' ) } </ dt >
184196 < dd >
185197 < TransactionEncryptionStatus envelope = { envelope } withText = { true } />
Original file line number Diff line number Diff line change 1+ // eslint-disable-next-line no-restricted-imports
2+ import { dump } from 'js-yaml'
3+
4+ export function yamlDump ( obj : any ) {
5+ return dump ( obj , {
6+ replacer : ( k , v ) => {
7+ return v
8+ } ,
9+ } )
10+ }
Original file line number Diff line number Diff line change 23852385 resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8"
23862386 integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==
23872387
2388+ " @types/js-yaml@^4.0.9 " :
2389+ version "4.0.9"
2390+ resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2"
2391+ integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==
2392+
23882393" @types/json-schema@^7.0.9 " :
23892394 version "7.0.12"
23902395 resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb"
You can’t perform that action at this time.
0 commit comments