I've seen other similar questions but I can't seem to pinpoint the error
In my contract
contract Authentication is Killable {
event FriendEvent (bytes32 name, bytes32 handle);
function login() constant
public
onlyExistingUser
returns (bytes32 n, bytes32 h) {
FriendEvent(users[msg.sender].name, users[msg.sender].handle);
return ("wtf", users[msg.sender].handle);
}
}
and then I'm calling the event in my code
var authenticationInstance
// Get current ethereum wallet.
web3.eth.getCoinbase((error, coinbase) => {
// Log errors, if any.
if (error) {
console.error(error);
}
authentication.deployed().then(function(instance) {
authenticationInstance = instance
var exampleEvent = authenticationInstance.FriendEvent({_from: web3.eth.coinbase}, {fromBlock: 0, toBlock: 'latest'});
//Call Watch on event
exampleEvent.watch(function(err, result) {
console.log("----------EXAMPLE EVENT");
if (err) {
console.log(err)
return;
}
console.log(result.args._value)
})
// Attempt to login user - calling the login function
authenticationInstance.login({from: coinbase})
.then(function(result) {
....
The login function executes fine, but "----------EXAMPLE EVENT" isn't printing to console. I've also added fromBlock, toBlock like suggested in another post