Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer type must have numerical suffix for uint but not for uint256 #32

Open
reiven opened this issue Jun 9, 2017 · 0 comments
Open

Comments

@reiven
Copy link

reiven commented Jun 9, 2017

Hi!

Taking an example ERC20 contract with the following definition:

  function balanceOf(address _owner) constant returns (uint balance) {
    return balances[_owner];
  }

Executing a call() to the contract with uint var type i got this error:

>>> c.call(contract_addr, 'balanceOf(address)', ['0x00fC8E759f5941F54aD61e7716B7e5163D9CFA83'], ['uint'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ethjsonrpc/client.py", line 120, in call
    return decode_abi(result_types, response[2:].decode('hex'))
  File "/hidden_path/local/lib/python2.7/site-packages/ethereum/abi.py", line 756, in decode_abi
    proctypes = [process_type(typ) for typ in types]
  File "/hidden_path/local/lib/python2.7/site-packages/ethereum/abi.py", line 623, in process_type
    "Integer type must have numerical suffix"
AssertionError: Integer type must have numerical suffix

but passing uint256 it works like a charm

>>> c.call(contract_addr, 'balanceOf(address)', ['0x00fC8E759f5941F54aD61e7716B7e5163D9CFA83'], ['uint256'])
[10]

BTW: i'm using an already patched version of the lib for 0x prefixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant