Waffle
Waffle copied to clipboard
Mocking ether `receive()`
Is there an easy way to mock the ether transfer to a contract via the receive()
method?
I tried the following but didn't work:
const mockRevertOnReceiveEtherContract = await deployMockContract(
this.signers.alice,
[{ stateMutability: "payable", type: "receive" }]
);
await mockRevertOnReceiveEtherContract.mock.receive.reverts();
const mockRevertOnReceiveEtherContract = await deployMockContract(
this.signers.alice,
["receive() external payable"]
);
await mockRevertOnReceiveEtherContract.mock.receive.reverts();