Skip to content

Commit

Permalink
add a docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Feb 27, 2024
1 parent 8c4021a commit ab73bef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docs/web3.contract.rst
Expand Up @@ -969,7 +969,7 @@ For example:
.. _process_receipt:

.. py:method:: ContractEvents.myEvent(*args, **kwargs).process_receipt(transaction_receipt, errors=WARN)
.. py:method:: ContractEvents.myEvent(*args, **kwargs).process_receipt(transaction_receipt, errors=WARN, abi_decode_strict=True)
:noindex:

Extracts the pertinent logs from a transaction receipt.
Expand Down Expand Up @@ -1037,6 +1037,11 @@ For example:
>>> processed_logs = contract.events.myEvent().process_receipt(tx_receipt, errors=DISCARD)
>>> assert processed_logs == ()
True
In the case of an ``InsufficientDataBytes`` error, it may be possible to decode the log by passing ``abi_decode_strict=False``.
This will attempt to decode the log by reading only the data size specified in the ABI. This is useful when the log data is
not padded to the correct size, but the data is still valid. Because any data past the specified size is ignored, this may
result in data loss. It is not recommended for general use, but may be useful in some cases.

.. py:method:: ContractEvents.myEvent(*args, **kwargs).process_log(log)
Expand Down
1 change: 0 additions & 1 deletion web3/_utils/events.py
Expand Up @@ -260,7 +260,6 @@ def get_event_data(
f"between event inputs: '{', '.join(duplicate_names)}'"
)

# breakpoint()
decoded_log_data = abi_codec.decode(
log_data_types, log_data, strict=abi_decode_strict
)
Expand Down

0 comments on commit ab73bef

Please sign in to comment.