I’m having a problem signing orders - well, anything - using the Python order-utils library and the starter project.
I have the starter project installed and the scenarios run fine. I can connect to ganache from Python and everything works except signatures.
Here’s a minimal example:
from zero_ex.order_utils import sign_hash_to_bytes from web3 import Web3 provider = Web3.HTTPProvider('http://127.0.0.1:8545') w3 = Web3(provider) accounts = w3.eth.accounts maker_address = accounts sample_hash = '0123456789' signature = sign_hash_to_bytes( provider, Web3.toChecksumAddress(maker_address), sample_hash )
So the hash isn’t real in this example, but I get the same error regardless:
Traceback (most recent call last): File "zerox_test2.py", line 16, in <module> sample_hash File "/usr/local/lib/python3.7/site-packages/zero_ex/order_utils/__init__.py", line 364, in sign_hash_to_bytes sign_hash(provider, signer_address, hash_hex) File "/usr/local/lib/python3.7/site-packages/zero_ex/order_utils/__init__.py", line 345, in sign_hash "Signature returned from web3 provider is in an unknown format." RuntimeError: Signature returned from web3 provider is in an unknown format. Attempted to parse as RSV and as VRS.
Any ideas? We’ll be passing most of the transactions to the client side to be signed and submitted through the end user’s wallet, but we do need this to work in our Python application as well.