Skip to content

Commit

Permalink
Fix string interpolation issues in exception message.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fselmo committed Aug 6, 2021
1 parent d722f31 commit d1d98f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions newsfragments/2096.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hot fix for string interpolation issue with contract function call decoding exception to facilitate extracting a meaningful message from the eth_call response
4 changes: 2 additions & 2 deletions web3/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,8 +1524,8 @@ def call_contract_function(
)
else:
msg = (
f"Could not decode contract function call {function_identifier} "
f"return data {return_data!r} for output_types {output_types}"
f"Could not decode contract function call to {function_identifier} with "
f"return data: {str(return_data)}, output_types: {output_types}"
)
raise BadFunctionCallOutput(msg) from e

Expand Down

0 comments on commit d1d98f9

Please sign in to comment.