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

bignumber throws on event when sending ether from geth CLI #382

Closed
barkthins opened this issue Feb 5, 2016 · 2 comments
Closed

bignumber throws on event when sending ether from geth CLI #382

barkthins opened this issue Feb 5, 2016 · 2 comments
Labels
Bug Addressing a bug

Comments

@barkthins
Copy link

bignumber throws in the process of calling back to the client code when I send ether to a contract account where I've got a listener for all events.

This is the command in geth command line:

eth.sendTransaction({from: someAccount, to: contractBeingListenedTo, value: 1})

I have this solidity event in my default contract function:

   event DefaultFuncEvent(address sender, bytes4 abi, uint gas, uint eth, bytes data);
    function () {
        DefaultFuncEvent(msg.sender, msg.sig, msg.gas, msg.value, msg.data);
    }

the snippet of code where I subscribe to the event (uses an RXJS subject but that shouldn't matter, there's none of my code in stack trace)

    contract.observer.web3hdlr = contract.allEvents(
            {},
            {fromBlock: 0, toBlock: 'latest'},
            function(err, event) {
                if(!err) {
                    contract.observer.source.onNext(event);
                }
            });

Here's the version I'm running (basically Master from a month ago)

npm ls  web3
[email protected] /home/barkthins/proj/hello.git/hello2/ethdevenv
└── [email protected] 

and the big throw output:

BigNumber Error: new BigNumber() not a base 16 number: 
    at raise (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/node_modules/bignumber.js/bignumber.js:1177:25)
    at /home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/node_modules/bignumber.js/bignumber.js:1165:33
    at new BigNumber (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/node_modules/bignumber.js/bignumber.js:212:28)
    at formatOutputDynamicBytes [as _outputFormatter] (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/solidity/formatters.js:205:19)
    at /home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/solidity/type.js:237:25
    at SolidityType.decode (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/solidity/type.js:238:11)
    at /home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/solidity/coder.js:219:29
    at Array.map (native)
    at SolidityCoder.decodeParams (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/solidity/coder.js:218:26)
    at SolidityEvent.decode (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/web3/event.js:150:34)
    at AllSolidityEvents.decode (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/web3/allevents.js:66:18)
    at /home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/web3/filter.js:118:49
    at Array.forEach (native)
    at Object.onMessage [as callback] (/home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/web3/filter.js:117:22)
    at /home/barkthins/proj/hello.git/hello2/ethdevenv/node_modules/web3/lib/web3/requestmanager.js:259:20
    at Array.forEach (native)
@frozeman frozeman added the Bug Addressing a bug label Feb 5, 2016
@barkthins
Copy link
Author

I took out msg.data and the problem went away. So I think the event parser doesn't know how to deal with variable length data.

@frozeman
Copy link
Contributor

frozeman commented Aug 9, 2017

Please try again with the web3.js 1.0.0, and reopen if its still an issue.

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

No branches or pull requests

2 participants