Skip to content

Commit 41347d3

Browse files
committed
fix: consistent exceptions
1 parent fc20c38 commit 41347d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ape_ethereum/ecosystem.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def decode_ds_note(self, log: dict) -> Optional[ContractLog]:
497497
"""
498498
contract_type = self.chain_manager.contracts.get(log["address"])
499499
if contract_type is None:
500-
raise DecodingError("contract type not available")
500+
raise DecodingError(f"ds-note: contract type for {log['address']} not found")
501501

502502
# topic 0 encodes selector, the tail must be zeros
503503
selector, tail = log["topics"][0][:4], log["topics"][0][4:]
@@ -510,7 +510,7 @@ def decode_ds_note(self, log: dict) -> Optional[ContractLog]:
510510
if selector == keccak(text=func.selector)[:4]
511511
)
512512
except StopIteration:
513-
return None
513+
raise DecodingError(f"ds-note: selector '{selector.hex()}' not found")
514514

515515
# in versions of ds-note the data field uses either (uint256,bytes) or (bytes) encoding
516516
# instead of guessing, assume the payload starts right after the selector

0 commit comments

Comments
 (0)