I have a geth client running (private) and I have a simple test contract to test events.
> con4.changedAge().watch()
{
callbacks: [undefined],
filterId: "0x3cf5f07c90dd95c5d97276659bf78d0f",
getLogsCallbacks: [],
implementation: {
getLogs: function(),
newFilter: function(),
poll: function(),
uninstallFilter: function()
},
options: {
address: "0xa6b4017e8437ace3301f9751735e84836cfc0b21",
from: undefined,
fromBlock: undefined,
to: undefined,
toBlock: undefined,
topics:
["0x25d30a71a6b93533225c97277375c3d49d3451741fad4852f106d04a5f083b5a"]
},
pollFilters: [],
requestManager: {
polls: {
0x3cf5f07c90dd95c5d97276659bf78d0f: {
data: {...},
id: "0x3cf5f07c90dd95c5d97276659bf78d0f",
callback: function(error, messages),
uninstall: function()
},
0x49268254732d941a071b3c422d35104e: {
data: {...},
id: "0x49268254732d941a071b3c422d35104e",
callback: function(error, messages),
uninstall: function()
}
},
provider: {
newAccount: function(),
openWallet: function(),
send: function github.com/ethereum/go-ethereum/console. (*bridge).Send-fm(),
sendAsync: function github.com/ethereum/go-ethereum/console. (*bridge).Send-fm(),
sign: function(),
unlockAccount: function()
},
timeout: {},
poll: function(),
reset: function(keepIsSyncing),
send: function(data),
sendAsync: function(data, callback),
sendBatch: function(data, callback),
setProvider: function(p),
startPolling: function(data, pollId, callback, uninstall),
stopPolling: function(pollId)
},
formatter: function(),
get: function(callback),
stopWatching: function(callback),
watch: function(callback)
}
Here is the contract -
pragma solidity ^0.4.18;
contract CollegeAdmin {
uint public studentAge=18;
event changedAge(uint age);
function setAge(uint age) public {
studentAge = age;
changedAge(age);
}
}
I just want to test when the event is triggered. I thought something like con4.setAge(19) could then trigger the watch. Has anyone any ideas?