Is there a known problem with parsing events containing strings in Truffle/Web3?
I'm using truffle with the following simple contract
contract Board
{
string foo;
event Shout();
event TextEvent(
string indexed text,
uint timestamp
);
function shout(string _text)
{
foo=_text;
Shout();
TextEvent(_text,now);
}
function getFoo() returns(string){
return foo;
}
}
When I call shout(_) foo is set correctly and a Shout event is triggered and I can listen to this without any problems.
var board = Board.deployed();
var shouts=board.Shout();
shouts.watch(function(error, result){
if (!error)
console.log("shout",result);
});
However when I watch for TextEvents with the following code
var board = Board.deployed();
var textEvent=board.TextEvent();
textEvent.watch(function(error, result){
console.log("callback");
if (!error) console.log("shout",result);
});
I get the following error which seems to be related to converting bytes32 into a string:
Uncaught BigNumber Error: new BigNumber() not a base 16 number:
So the question is how can you listen to events containing strings in Web3 without running into this error?
bytesfrom an event. Please raise an bug report in the following repo - https://github.com/ethereum/web3.js/issues – Hudson Jameson Mar 16 '16 at 21:09