Closed JuaniRios closed 5 months ago
Think its a good initial testing setup. I have left a few comments and do have some comments in general:
- We have quite a lot of code duplication (settlement for successful + failed project for each type 95% of that code is the same). I know that you are more of the clear distinction between tests and don't mind code duplication, but I think it would be great if we could somehow dedup the tests at least a bit.
- I think in certain situations we could get away with less code for the "setup" part of the tests. So instead of going step for step we could create a finished project with as input our specific bids, contributions or evaluations, correct? I think this would make the tests also clearer where there is a clear "setup" part and a clear "this is what we are testing" part.
- I think we are over asserting a bit in certain situations. For example in the settle_failed_bids part, we assert for the two bids that the ct amount is 0 before and after settlement. I think we can already skip the one before in this situation. We also assert the issuer balance == 0 at each step before and after, but I think a single assert for issuer balance == 0 at the end is sufficient. This makes the code easier to read and the assertions more clear.
@vstam1 A lot of repetition comes from the fact that 2 participations have different multipliers, and so have a different checking logic. And I think introducing a loop doesn't make sense there. I commented this in one of the inner comments you left
What?
How?