Skip to content

Commit

Permalink
fix: handle None contract types
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Jul 7, 2022
1 parent 8fdc8de commit 10c25df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ape/api/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,12 @@ def decode_logs(
# if abi is not provided, decode all events
for log in self.logs:
contract_type = self.chain_manager.contracts.get(log["address"])
if not contract_type:
logger.warning(f"Failed to locate contract at '{log['address']}'.")
continue

try:
event_abi = contract_type.events[log["topics"][0]] # type: ignore
event_abi = contract_type.events[log["topics"][0]]
yield from self.provider.network.ecosystem.decode_logs(event_abi, [log])
except (StopIteration, KeyError, DecodingError):
try:
Expand Down

0 comments on commit 10c25df

Please sign in to comment.