From e4fa639e691d329f182116da91ccf73943a4e9e0 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 25 Sep 2021 14:45:12 -0300 Subject: [PATCH] Add warning for input decoded from 4bytes signatures wuthout param names --- src/transaction/DecodedParamRow.tsx | 5 +++-- src/transaction/DecodedParamsTable.tsx | 9 ++++++++- src/transaction/Details.tsx | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/transaction/DecodedParamRow.tsx b/src/transaction/DecodedParamRow.tsx index 9d9bcf8..5678ac8 100644 --- a/src/transaction/DecodedParamRow.tsx +++ b/src/transaction/DecodedParamRow.tsx @@ -25,7 +25,7 @@ const DecodedParamRow: React.FC = ({ {prefix && {prefix}} - {paramType.name}{" "} + {paramType.name ?? param_{i}}{" "} {i !== undefined && ( ({i}) )} @@ -65,7 +65,8 @@ const DecodedParamRow: React.FC = ({ {paramType.baseType === "tuple" && r.map((e: any, idx: number) => ( - = ({ args, paramTypes, txData, + hasParamNames = true, }) => ( - +
+ {!hasParamNames && ( + + + + )} {args.map((r, i) => ( diff --git a/src/transaction/Details.tsx b/src/transaction/Details.tsx index 57a0233..27bd9b1 100644 --- a/src/transaction/Details.tsx +++ b/src/transaction/Details.tsx @@ -352,6 +352,7 @@ const Details: React.FC = ({ args={resolvedTxDesc.args} paramTypes={resolvedTxDesc.functionFragment.inputs} txData={txData} + hasParamNames={resolvedTxDesc === txDesc} /> )}
@@ -23,6 +25,11 @@ const DecodedParamsTable: React.FC = ({ type value
Parameter names are not available.