Usually, using truffle
I can check for events like this:
let { logs } = await myContract.doSomethingImportant( xxx );
// 1500 tokens are expected to get
expectEvent.inLogs(logs, 'myImportantEvent', {
arg1: 111,
arg2: 'and so on'
});
However, logs
contains only the events that was fired directly inside of the contract function withdrawVestedTokensByTimestamp
:
function doSomethingImportant(uint256 x) public returns(uint256) {
// ... do something else here ...
emit myImportantEvent(x, amount);
return amount;
}
However, if in this function a token transfer will happen or another function is called, which would fire events itself, they don't appear in the logs.
Running tests with truffle test --show-events
will list all of the expected events, but how can I catch them inside truffle test?