TrueFiEng / Waffle

Library for writing and testing smart contracts.
https://getwaffle.io
MIT License
961 stars 162 forks source link

Cannot check that an event was emitted if the event was declared in a library. #754

Closed hickscorp closed 2 years ago

hickscorp commented 2 years ago

Note that this report is similar to the one at https://github.com/projectsophon/hardhat-diamond-abi/issues/16.

When developing smart contracts using the Diamond pattern, very often several facets of the same Diamond need to emit the same event. Usually, events are declared in a library - such as MyDiamondEvents. Then in any facets, you can `emit MyDiamondsEvents.SomeEvent(...)'.

Waffle doesn't allow to check that an such event was emitted - because the types and ABI of the facet won't contain any information about the event typings.

rzadp commented 2 years ago

Please take a look again at https://ethereum-waffle.readthedocs.io/en/latest/matchers.html#emitting-events (It was just added so you might not have seen it before).

Screenshot 2022-07-29 at 15 52 05

Feel free to open with more details if this does not work for you.