-
Notifications
You must be signed in to change notification settings - Fork 35
rpc error returned: invalid argument 0: hex string has odd length #13
Comments
Thank you, this log is very helpful. First the problem: A solution is to add the extra 0 when the hex string is an odd length. (Or possibly in serpent https://github.com/etherex/pyepm/blob/master/pyepm/api.py#L17) I am not sure at the moment where to fix since pyepm unfortunately has no maintainer. |
@ethers After I had fixed param issue, I have stuck into another problem: |
here is new def abi_data(sig, data):
prefix = get_prefix(sig)
data_abi = hex(prefix).rstrip('L')
logger.debug("ABI prefix: %s" % data_abi)
types = sig.split(':')[1][1:-1].split(',')
logger.debug("ABI types: %s" % types)
for i, s in enumerate(data):
if isinstance(data[i], (str, unicode)) and data[i][:2] == "0x":
data[i] = unhex(data[i])
logger.debug("ABI data: %s" % data)
data_abi += abi.encode_abi(types, data).encode('hex')
logger.debug("ABI encoded: %s" % data_abi)
# FIX here:
if len(data_abi) % 2 > 0:
data_abi = data_abi.replace('0x','0x0')
return data_abi |
Thank you to @achempion for #14 |
I've changed the logging level to DEBUG and got this. I deployed btcrelay on Ropsten at 0x93bee0a583b828631b91d87ec0539654bf04f4ca
The text was updated successfully, but these errors were encountered: