ethereum call contract method that emits an event, from another contract

Viewed 2372

I have a contract, that calls a method on another contract, which causes it to emit an event - which I am listening for in a node process.

If I execute the method that fires the event directly (from the console) - it fires fine. But if I execute the method, by first calling the initial contract to in turn call the contract that fires the event, the event does not fire.

Is there a way of calling a follow on contract I am missing, or is this something I cannot do by design? The following code describes the problem:

contract EventEmitter{
    event Emit(address addr, string message);

    //this works when I call it directly from the console,ie:
    //emitter.doEmit("blah", {from: "[primary acc]", value: web3.toWei(100, "ether")});
    function doEmit(string message) returns (bool){
        Emit(msg.sender, message);
        return true;
    }
}

contract EventEmitterCaller{
    event TestEvent(string message);

    function callDoEmit(string message) returns (bool){
        EventEmitter emitter = new EventEmitter();
        //always returns false
        //emitterCaller.callDoEmit("blah", {from: "[primary acc]", value: web3.toWei(100, "ether")});
        return emitter.doEmit(message);
    }

}
1 Answers
Related