Skip to content

Commit 7fb9dc7

Browse files
committed
Fix string interpolation issues in exception message.
Fixes an issue preventing a meaningful message from being extracted from the result data due to the HexBytes object being printed rather than the bytes which includes the message.
1 parent d722f31 commit 7fb9dc7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

newsfragments/2096.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hot fix for string interpolation issue with contract function call decoding exception to facilitate extracting a meaningful message from the eth_call response

web3/contract.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,8 +1524,8 @@ def call_contract_function(
15241524
)
15251525
else:
15261526
msg = (
1527-
f"Could not decode contract function call {function_identifier} "
1528-
f"return data {return_data!r} for output_types {output_types}"
1527+
f"Could not decode contract function call to {function_identifier} with "
1528+
f"return data: {str(return_data)}, output_types: {output_types}"
15291529
)
15301530
raise BadFunctionCallOutput(msg) from e
15311531

0 commit comments

Comments
 (0)