cowprotocol / cow-amm

An automated market maker running on top of CoW Protocol
17 stars 5 forks source link

Add e2e test for custom orders #65

Closed fedgiac closed 6 months ago

fedgiac commented 6 months ago

We only test e2e for the default order. This test creates a dedicated e2e test for custom orders, so that solvers can see one in action and understand how order and signature generation works.

There is some repeating code with the previous e2e test, especially for the initial setup phase. I decided to copy it rather than isolating pieces to their own functions because it makes this one test easier to read for third parties, with no indirection.

Unfortunately I couldn't easily add interactions as part of the settlement, so I used a workaround for setting the commit. I don't think we should add the code to cleanly do a settlement with a pre-interaction: we are planning to migrate the settlement contract repo to Foundry anyway, meaning that we are probably going to create helper methods for settlements in that repo that we could use to update this test later.

How to test

CI, no new features.