-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✅ Comprehensive settlement tests #304
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @JuaniRios and the rest of your teammates on Graphite |
7e49ee7
to
10a1837
Compare
a3d19e5
to
3583f0d
Compare
3583f0d
to
f49022b
Compare
c6646cc
to
49ac770
Compare
f49022b
to
a31bf79
Compare
49ac770
to
c16590e
Compare
a31bf79
to
9bc9a93
Compare
c16590e
to
10e938a
Compare
9bc9a93
to
f2d4599
Compare
10e938a
to
5d12e2f
Compare
f2d4599
to
9225bf5
Compare
5d12e2f
to
089dd93
Compare
9225bf5
to
1943662
Compare
089dd93
to
b022520
Compare
1943662
to
120b60e
Compare
b022520
to
0166950
Compare
120b60e
to
e19e097
Compare
0166950
to
0980858
Compare
0980858
to
94159d0
Compare
e19e097
to
a10f42e
Compare
94159d0
to
fe2d5dd
Compare
a10f42e
to
4cedfa5
Compare
4cedfa5
to
c87ef41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
faf7c81
to
46c142d
Compare
46c142d
to
9ae047e
Compare
|
@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 |
Merge activity
|
What?
How?