Fix wrong message when cant decode input

This commit is contained in:
Willian Mitsuda 2021-10-19 05:23:48 -03:00
parent bace76e12c
commit 70649af097

View File

@ -75,7 +75,10 @@ const Details: React.FC<DetailsProps> = ({
const fourBytes = txData.to !== null ? rawInputTo4Bytes(txData.data) : "0x";
const fourBytesEntry = use4Bytes(fourBytes);
const fourBytesTxDesc = useMemo(() => {
if (!txData || !fourBytesEntry?.signature) {
if (!fourBytesEntry) {
return fourBytesEntry;
}
if (!txData || !fourBytesEntry.signature) {
return undefined;
}
const sig = fourBytesEntry?.signature;
@ -355,7 +358,7 @@ const Details: React.FC<DetailsProps> = ({
) : resolvedTxDesc === undefined ? (
<>Waiting for data...</>
) : resolvedTxDesc === null ? (
<>No decoded data</>
<>Can't decode data</>
) : (
<DecodedParamsTable
args={resolvedTxDesc.args}