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( const metadata = useSourcify(
txData?.to, txData?.to,
provider?.network.chainId, provider?.network.chainId,
SourcifySource.CUSTOM_SNAPSHOT_SERVER // TODO: use dynamic selector SourcifySource.CENTRAL_SERVER // TODO: use dynamic selector
); );
const txDesc = useTransactionDescription(metadata, txData); const txDesc = useTransactionDescription(metadata, txData);

View File

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