Closed sthitpragnya-ethosx closed 1 year ago
@sthitpragnya-ethosx Thanks for submitting the request.
Is there a way we can specify a mock contract to emit an event when a write function is called?
No, not at the moment. Let's scope out what would be the use cases for it.
This would come in handy to check whether a particular functions is called or not. (...) to test the parameters with which the mock's function is called.
So, it seems like what you would need is not necessarily events, but a way to assert calledOnContract
and calledOnContractWith
on the mock contract, right?
calledOnContract
and calledOnContractWith
matchers work correctly with mock contracts which seems to resolve this.
Is there a way we can specify a mock contract to emit an event when a write function is called? This would come in handy to check whether a particular functions is called or not. A good to have would be to also map the parameters of the event to input params to test the parameters with which the mock's function is called.