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

Contract event returns error, if the contract doesn't exist. #60

Closed
frozeman opened this issue Feb 13, 2015 · 0 comments
Closed

Contract event returns error, if the contract doesn't exist. #60

frozeman opened this issue Feb 13, 2015 · 0 comments

Comments

@frozeman
Copy link
Contributor

I get a contract (which doesn't exist, or i can't know if it exists) and want to watch for an event.

If have the following ABI:

{
        "name":"SingleTransact",
        "type":"event",
        "inputs":[
            {"indexed":true,"name":"out","type":"string32"},
            {"indexed":false,"name":"owner","type":"address"},
            {"indexed":false,"name":"value","type":"uint256"},
            {"indexed":false,"name":"to","type":"address"}
        ]
    }

And i watch for that event like:

var singleTxWatcher = contract.SingleTransact();
singleTxWatcher.changed(transactionCallback);

I get the following error: Uncaught TypeError: Cannot read property 'length' of undefined ethereum.js:1050

Which matches the following part in ejs:

var web3 = {
    _callbacks: {},
    _events: {},
    providers: {},

    toHex: function(str) {
        var hex = "";
        for(var i = 0; i < str.length; i++) {
            var n = str.charCodeAt(i).toString(16);
            hex += n.length < 2 ? '0' + n : n;
        }

        return hex;
    },
...
@debris debris closed this as completed Mar 10, 2015
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

2 participants