Skip to content

Bug with to_hex in wait_for_transaction_receipt function #2043

@sobolev-igor

Description

@sobolev-igor
  • Version: 5.20.0
  • Python: 3.9
  • OS: osx

What was wrong?

Hey! I've got an issue with to_hex and wait_for_transaction_receipt functions.
I use the function as in the example

web3.eth.wait_for_transaction_receipt('0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060')

But if the tx doesn't get mined within timeout it raises the exception which uses to_hex function with a tx hash passed as a parameter (which is a string in an example). It raises another exception as a string cannot be passed to to_hex function.

Unsupported type: The primitive argument must be one of: bytes,bytearray, int or bool and not str

How can it be fixed?

Allow to_hex accept a string or convert it to bytes in wait_for_transaction_receipt function.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions