I'm using web3.py v4.x and I have an issue to convert string to bytes32
. First I checked out Web3.py conversion APIs. So I used Web3.toBytes
but still not working. Kindly check out the below error for more details:
Could not identify the intended function with name `publish`, positional argument(s) of type `(<class 'int'>, <class 'bytes'>, <class 'bytes'>)` and keyword argument(s) of type `{}`.
Found 1 function(s) with the name `publish`: ['publish(uint256,bytes32,bytes32)']
Function invocation failed due to improper argument encoding.
Web3.toHex(text='my text')
. – user19510 Jun 11 '18 at 12:18