Skip to content

Commit a779467

Browse files
committed
update docs and newsfrag
1 parent 1024e67 commit a779467

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

docs/web3.contract.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ For example:
969969
970970
.. _process_receipt:
971971

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

975975
Extracts the pertinent logs from a transaction receipt.
@@ -1038,10 +1038,19 @@ For example:
10381038
>>> assert processed_logs == ()
10391039
True
10401040
1041-
In the case of an ``InsufficientDataBytes`` error, it may be possible to decode the log by passing ``abi_decode_strict=False``.
1042-
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
1043-
not padded to the correct size, but the data is still valid. Because any data past the specified size is ignored, this may
1044-
result in data loss. It is not recommended for general use, but may be useful in some cases.
1041+
In the case of an ``InsufficientDataBytes`` error, it may be possible to decode the
1042+
log by setting the ``strict_bytes_type_checking`` flag to ``False`` on the Web3
1043+
instance.
1044+
1045+
.. code-block:: python
1046+
1047+
>>> w3.strict_bytes_type_checking = False
1048+
1049+
1050+
This will attempt to decode the log by reading only the data size specified in the
1051+
ABI. This is useful when the log data is not padded to the correct size, but the data
1052+
is still valid. Because any data past the specified size is ignored, this may result
1053+
in data loss. It is not recommended for general use, but may be useful in some cases.
10451054

10461055
.. py:method:: ContractEvents.myEvent(*args, **kwargs).process_log(log)
10471056

newsfragments/3256.feature.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Catch ``InsufficientDataBytes`` errors and add ``abi_decode_strict`` flag to log receipt processing
1+
Catch ``InsufficientDataBytes`` errors and respect ``w3.strict_bytes_type_checking`` flag in log receipt processing

0 commit comments

Comments
 (0)