I’m implementing OpenZeppelin’s PullPayment (4.0.0) contract.
Unfortunately, during testing I’m always getting AssertionError: Expected event "Deposited" to be emitted, but it wasn't Also the Withdrawn event doesn’t get emitted. But _asyncTransfer seems to run properly as Transfergets emitted.
I checked my ABI and it seems the contract is compiled correctly.
Environment
I’m using Hardhart with Waffle, Chai, Mocha, Ethers.js.
Ok, I figured it out. Events from other contracts are not in receipts. You have to use expectEvent.inTransaction instead of just expectEvent. Something like: