Skip to content

Commit

Permalink
update docs and newsfrag
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Apr 3, 2024
1 parent 1024e67 commit a779467
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions docs/web3.contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ For example:
.. _process_receipt:

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

Extracts the pertinent logs from a transaction receipt.
Expand Down Expand Up @@ -1038,10 +1038,19 @@ For example:
>>> 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.
In the case of an ``InsufficientDataBytes`` error, it may be possible to decode the
log by setting the ``strict_bytes_type_checking`` flag to ``False`` on the Web3
instance.

.. code-block:: python
>>> w3.strict_bytes_type_checking = 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
2 changes: 1 addition & 1 deletion newsfragments/3256.feature.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Catch ``InsufficientDataBytes`` errors and add ``abi_decode_strict`` flag to log receipt processing
Catch ``InsufficientDataBytes`` errors and respect ``w3.strict_bytes_type_checking`` flag in log receipt processing

0 comments on commit a779467

Please sign in to comment.