Skip to content

Commit

Permalink
fix(display-raw-data): show raw data if no params and method exists i…
Browse files Browse the repository at this point in the history
…n a tx
  • Loading branch information
clovisdasilvaneto committed Sep 26, 2024
1 parent 14c5da5 commit c7880da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <MethodDetails data={txData.dataDecoded} addressInfoIndex={txData.addressInfoIndex} />
} else if (txData.hexData) {
// When no decoded data, display raw hex data
Expand Down
2 changes: 1 addition & 1 deletion src/components/tx/DecodedTx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c7880da

Please sign in to comment.