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

error when call return value is empty array int256[] #210

Closed
ethers opened this issue May 20, 2015 · 0 comments
Closed

error when call return value is empty array int256[] #210

ethers opened this issue May 20, 2015 · 0 comments

Comments

@ethers
Copy link
Contributor

ethers commented May 20, 2015

develop 16861fc

Make this call to specified contract:

I0519 17:27:16.918552   20188 api.go:37] eth_call [{"to":"0x96cd8aa2d6669fb548449df5ce7e90914d68753f","data":"0x734388060000000000000000000000000000000000000000000000000000000000000002"},"latest"]

Here's the response:

I0519 17:27:16.920878   20188 http.go:130] Generated response: *rpc.RpcSuccessResponse &{%!s(float64=12) 2.0 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000}
I0519 17:27:16.920986   20188 http.go:141] Sending payload: {
    "id": 12,
    "jsonrpc": "2.0",
    "result": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000"
}

web3.js has error (param.dynamicPart() is "")
The error is BigNumber Error: new BigNumber() not a base 16 number (as in #211)

            SolidityType.prototype.formatOutput = function(param, arrayType) {
                if (arrayType) {
                    // let's assume, that we solidity will never return long arrays :P 
                    var result = [];
                    var length = new BigNumber(param.dynamicPart().slice(0, 64), 16);  <--- error

Here is the abi snippet if it helps; the return is array int256[] but with 0 elements:

{
    "name": "lookupTicket(int256)",
    "type": "function",
    "inputs": [{ "name": "ticketId", "type": "int256" }],
    "outputs": [{ "name": "out", "type": "int256[]" }]
}
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