Remove unused attribute; custom param presence msg depending on signature with or without param names
This commit is contained in:
parent
af95c04c9c
commit
debc046d83
|
@ -70,10 +70,10 @@ const Details: React.FC<DetailsProps> = ({
|
|||
const fourBytes = rawInputTo4Bytes(txData.data);
|
||||
const fourBytesEntry = use4Bytes(fourBytes);
|
||||
const fourBytesTxDesc = useMemo(() => {
|
||||
if (!txData || !fourBytesEntry?.signatureWithoutParamNames) {
|
||||
if (!txData || !fourBytesEntry?.signature) {
|
||||
return undefined;
|
||||
}
|
||||
const sig = fourBytesEntry?.signatureWithoutParamNames;
|
||||
const sig = fourBytesEntry?.signature;
|
||||
const functionFragment = Fragment.fromString(`function ${sig}`);
|
||||
const intf = new Interface([functionFragment]);
|
||||
return intf.parseTransaction({ data: txData.data, value: txData.value });
|
||||
|
|
|
@ -28,7 +28,9 @@ const DecodedParamsTable: React.FC<DecodedParamsTableProps> = ({
|
|||
{!hasParamNames && (
|
||||
<tr className="grid grid-cols-12 text-left gap-x-2 py-2 bg-yellow-100 text-red-700">
|
||||
<th className="col-span-12 px-1">
|
||||
Parameter names are not available.
|
||||
{paramTypes.length > 0 && paramTypes[0].name !== null
|
||||
? "Parameter names are estimated."
|
||||
: "Parameter names are not available."}
|
||||
</th>
|
||||
</tr>
|
||||
)}
|
||||
|
|
|
@ -4,14 +4,12 @@ import { fourBytesURL } from "./url";
|
|||
|
||||
export type FourBytesEntry = {
|
||||
name: string;
|
||||
signatureWithoutParamNames: string | undefined;
|
||||
signatures: string[] | undefined;
|
||||
signature: string | undefined;
|
||||
};
|
||||
|
||||
const simpleTransfer: FourBytesEntry = {
|
||||
name: "Transfer",
|
||||
signatureWithoutParamNames: undefined,
|
||||
signatures: undefined,
|
||||
signature: undefined,
|
||||
};
|
||||
|
||||
const fullCache = new Map<string, FourBytesEntry | null>();
|
||||
|
@ -68,8 +66,7 @@ export const use4Bytes = (
|
|||
|
||||
const entry: FourBytesEntry = {
|
||||
name: method,
|
||||
signatureWithoutParamNames: sig,
|
||||
signatures: undefined,
|
||||
signature: sig,
|
||||
};
|
||||
setEntry(entry);
|
||||
fullCache.set(fourBytes, entry);
|
||||
|
|
Loading…
Reference in New Issue