Skip to content

test: Add EthTransferFailed revert test for native ETH payout failure path in _safeTransferTokenOrETH #11

Description

@coderabbitai

Summary

Add a test case to validate the EthTransferFailed revert scenario in the native ETH payout flow of WindmillExchange.

Background

In PR #6 (#6), the native ETH flow tests cover success and input-validation reverts, but do not exercise the ETH send failure path when the recipient rejects ETH. This leaves a critical failure branch in _safeTransferTokenOrETH unvalidated.

This was deferred from PR #6 as part of review comment: #6 (comment)

Acceptance Criteria

  • Create a RejectETHReceiver helper contract that reverts on ETH receipt.
  • Add test_nativeETH_revertOnFailedEthTransfer test:
    • Alice creates a WETH buy order funded with native ETH.
    • RejectETHReceiver creates a sell-for-WETH order.
    • Calling matchOrders should revert with EthTransferFailed.selector.
  • Verify that the failure path in _safeTransferTokenOrETH is explicitly covered.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions