Skip to content

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

@reiven

Description

@reiven

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions