cowprotocol/solver-rewards

Simplify & Expand Testing of SplitTransfers.process

Closed this issue · 2 comments

This method has a lot of logic for which the unit tests can be independent (instead of covering multiple scenarios)

For example our two tests full_process introduced in #163) can be broken down into these 4:

single solver:

  • positive slippage
  • negative slippage not exceeding
  • negative slippage exceeding ETH not COW
  • negative slippage exceeding both

There is also room for other tests however (testing with & without redirects, testing multiple solvers with same reward target, etc...).

This was first mentioned in #163 (comment)

but deserves a more thorough (dedicated) PR to capture all the scenarios.

Originally posted by @bh2smith in #163 (comment)

Other ideas for testing.

  • failed assertions (signature of negative and positive slippages).

Closed by #171 which was merged into #163 and also now merged.