balancer / balancer-v2-monorepo

Balancer V2 Monorepo
https://balancer.fi/
GNU General Public License v3.0
315 stars 382 forks source link

Improve expect event #2519

Closed jubeira closed 1 year ago

jubeira commented 1 year ago

Description

Improve expectEvent.inIndirectReceipt when the amount of events are specified.

Without this change, as long as one event matched the given arguments it would pass, even if the expected amount was larger than one. With this change, if the amount is specified we expect all the matches to contain the given arguments.

The return type also changes: it returns a single event for the regular use-case (i.e. when no amount is specified), but returns all of the matches when the amount is specified.

This should be backwards compatible, equally intuitive to use in general when (at least) one event is expected, but more flexible and powerful when analyzing multiple logs in a single receipt.

Type of change

Checklist:

Issue Resolution

N/A