Fix log metadata search

This commit is contained in:
Willian Mitsuda 2021-09-22 15:11:13 -03:00
parent 4ec5fb7681
commit b5c76a4e01
2 changed files with 13 additions and 8 deletions

View File

@ -49,7 +49,7 @@ const Transaction: React.FC = () => {
const metadata = useSourcify(
txData?.to,
provider?.network.chainId,
SourcifySource.CUSTOM_SNAPSHOT_SERVER // TODO: use dynamic selector
SourcifySource.CENTRAL_SERVER // TODO: use dynamic selector
);
const txDesc = useTransactionDescription(metadata, txData);

View File

@ -30,10 +30,10 @@ const Logs: React.FC<LogsProps> = ({ txData, metadata }) => {
baseMetadatas,
logAddresses,
1,
SourcifySource.CUSTOM_SNAPSHOT_SERVER
SourcifySource.CENTRAL_SERVER // TODO: use dynamic selector
);
const logDesc = useMemo(() => {
if (!metadata || !txData) {
if (!txData) {
return undefined;
}
@ -45,12 +45,17 @@ const Logs: React.FC<LogsProps> = ({ txData, metadata }) => {
const abi = mt.output.abi;
const intf = new Interface(abi as any);
return intf.parseLog({
topics: l.topics,
data: l.data,
});
try {
return intf.parseLog({
topics: l.topics,
data: l.data,
});
} catch (err) {
console.warn("Couldn't find function signature", err);
return null;
}
});
}, [metadatas, metadata, txData]);
}, [metadatas, txData]);
return (
<ContentFrame tabs>