Skip to content

Commit

Permalink
add strict=True param to get_logs
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jan 6, 2025
1 parent 926c6c3 commit 2a3e564
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions boa/contracts/base_evm_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def _get_logs(self, computation, include_child_logs):

return computation._log_entries

def get_logs(self, computation=None, include_child_logs=True):
def get_logs(self, computation=None, include_child_logs=True, strict=True):
if computation is None:
computation = self._computation

Expand All @@ -87,9 +87,16 @@ def get_logs(self, computation=None, include_child_logs=True):
logger_address = e[1]
c = self.env.lookup_contract(logger_address)
if c is not None:
ret.append(c.decode_log(e))
try:
decoded_log = c.decode_log(e)
except Exception as exc:
if strict:
raise exc
else:
decoded_log = RawEvent(e)
else:
ret.append(RawEvent(e))
decoded_log = RawEvent(e)
ret.append(decoded_log)

return ret

Expand Down

0 comments on commit 2a3e564

Please sign in to comment.