From c7880daf4330db41bcb99dfa3be4c8d376ed28c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=B3vis=20Neto?= Date: Thu, 26 Sep 2024 17:19:28 +0200 Subject: [PATCH] fix(display-raw-data): show raw data if no params and method exists in a tx --- .../transactions/TxDetails/TxData/DecodedData/index.tsx | 2 +- src/components/tx/DecodedTx/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx b/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx index c8d23ff1dd..8e86055a0a 100644 --- a/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx +++ b/src/components/transactions/TxDetails/TxData/DecodedData/index.tsx @@ -50,7 +50,7 @@ export const DecodedData = ({ txData, toInfo }: Props): ReactElement | null => { const avatar = addressInfo?.logoUri || toInfo?.logoUri || txData.to.logoUri let decodedData = <> - if (txData.dataDecoded) { + if (txData.dataDecoded && (method || (!method && txData.dataDecoded.parameters))) { decodedData = } else if (txData.hexData) { // When no decoded data, display raw hex data diff --git a/src/components/tx/DecodedTx/index.tsx b/src/components/tx/DecodedTx/index.tsx index 44d8c3087a..41475257f2 100644 --- a/src/components/tx/DecodedTx/index.tsx +++ b/src/components/tx/DecodedTx/index.tsx @@ -61,13 +61,13 @@ const DecodedTx = ({ const onChangeExpand = (_: SyntheticEvent, expanded: boolean) => { trackEvent({ ...MODALS_EVENTS.TX_DETAILS, label: expanded ? 'Open' : 'Close' }) } - const addressInfoIndex = txDetails?.txData?.addressInfoIndex const txData = { dataDecoded: decodedData, to: { value: tx?.data.to || '' }, value: tx?.data.value, + hexData: tx?.data.data, operation: tx?.data.operation === OperationType.DelegateCall ? Operation.DELEGATE : Operation.CALL, trustedDelegateCallTarget: txDetails?.txData?.trustedDelegateCallTarget ?? true, addressInfoIndex,