You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.
Hey,
I'm a noob at this, so I'm probably doing something wrong.
I'm on OSX 10.11.1. geth v1.3.3 & pyethapp 1.0.18/darwin/py2.7.10.
I have tried to connect to a geth --rpc command running locally on my machine. The geth command seems to run fine, synchronised well and everything working without issue.
I wanted to start playing with the pyethapp library, and decided to check an account balance using the JSONRPCClient.
So after firing up a little debugging session it seems that the error is coming from this method.
The data is not passing the test at line 264 because it has a leading 0.
file pyethapp/jsonrpc.py:
258defquantity_decoder(data):
259"""Decode `data` representing a quantity."""260ifnotis_string(data):
261success=False262elifnotdata.startswith('0x'):
263success=False# must start with 0x prefix264eliflen(data) >3anddata[2] =='0':
265success=False# must not have leading zeros (except `0x0`)266else:
267data=data[2:]
268# ensure even length269iflen(data) %2==1:
270data='0'+data271try:
272returnint(data, 16)
273exceptValueError:
274success=False275assertnotsuccess276raiseBadRequestError('Invalid quantity encoding')
If I try to manually decode it using the command int(data, 16) line 272, it seems to run just fine, so I'm wondering if the test line 264 is useful in that context. Maybe this library isn't meant to be talking to a geth rpc server? After a quick look at the JSON RPC API, the example produced there seems to also have a leading 0. So is this a bug?
Cheers, PE
The text was updated successfully, but these errors were encountered:
Hey,
I'm a noob at this, so I'm probably doing something wrong.
I'm on OSX 10.11.1. geth v1.3.3 & pyethapp 1.0.18/darwin/py2.7.10.
I have tried to connect to a
geth --rpc
command running locally on my machine. The geth command seems to run fine, synchronised well and everything working without issue.I wanted to start playing with the pyethapp library, and decided to check an account balance using the JSONRPCClient.
Running the command:
... raises the following error:
So after firing up a little debugging session it seems that the error is coming from this method.
The data is not passing the test at line 264 because it has a leading
0
.file
pyethapp/jsonrpc.py
:If I try to manually decode it using the command
int(data, 16)
line 272, it seems to run just fine, so I'm wondering if the test line 264 is useful in that context. Maybe this library isn't meant to be talking to ageth rpc
server? After a quick look at the JSON RPC API, the example produced there seems to also have a leading 0. So is this a bug?Cheers, PE
The text was updated successfully, but these errors were encountered: