I am currently deploying my ChangeManager contract in truffle and I want to call the contract later in Nethereum.
For this I need the contract address in Nethereum. I figured I could just create an event which is emitted in the constructor like so emit ChangeManagerEvent(address)
.
Currently I am testing this in a truffle testsuite but I can't seem to filter for the events triggered in the constructor of my ChangeManager contract.
How can I subscribe to events which have been emitted by the constructor in truffle?
contract('ChangeManager', function (accounts) {
it('should have emitted event with contract address', async function () {
changemanager = await ChangeManager.deployed();
var event = changemanager.allEvents();
event.watch(function (error, result) {
if (!error)
console.log("Result: ", result.event);
});
});
The goal of this undertaking is to call the contract in Nethereum after I have received the constructor event there. Maybe you have a better suggestion how I could access a contract deployed by truffle in Nethereum.