truffle-assertions icon indicating copy to clipboard operation
truffle-assertions copied to clipboard

Question : also possible to check the index from an event?

Open StefH opened this issue 6 years ago • 2 comments

What I want to to check that Event-1 is submitted before Event-2.

truffleAssert.eventEmitted(result, 'Event-1', (ev) => {
    return ev.index == 0;
});

truffleAssert.eventEmitted(result, 'Event-2', (ev) => {
    return ev.index == 1;
});

Is this possible?

StefH avatar Dec 16 '18 10:12 StefH

Hi @StefH

This is currently not possible using the library, but it is something that could be implemented. I'll think about how this could be done.

rkalis avatar Dec 16 '18 19:12 rkalis

This would be a nice addition in case a transaction emits the same event multiple times.

DefiCake avatar Jul 10 '19 17:07 DefiCake