-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: adding bcowpool verify btt tests #155
Conversation
test/unit/BCoWPool/BCoWPoolBase.sol
Outdated
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.
watch out this contract and BPoolBase don't have the .t.sol
ending, is this intended?
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.
yes, the idea being files where testcases are defined end in .t.sol
, while all others don't, I tried to be consistent with test/utils/Utils.sol
not ending in .t.sol
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.
hmmm i understand that the coverage for example skips all .t.sol
tests alltogether, so perhaps we should name them all as .t.sol
function test_WhenPreconditionsAreMet() external { | ||
// it should return | ||
bCoWPool.verify(correctOrder); | ||
} |
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.
since we checked for order sellAmount + 1
, how would you feel here fuzzing from 0 -> calculatedOut
to not lose the branch where sellAmount is lesser than calculated (that is the same as when it's ==, but we're not showing that behaviour)
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.
seems reasonable, I don't think it's a different branch since it covers the exact same code. As far as I understood, we can use a single testcase for different values if they don't cover different lines/branches of code.
CCing @drgorillamd in case he considers we should use a separate testcase
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.
This makes sense to me, you have a doubt about it? I'm missing something?
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.
LGTM! 🥕
awaiting for @drgorillamd about the +1 -1 cases
└── when preconditions are met | ||
└── it should return |
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.
i feel like we're forgetting about querying the balances, are we not?
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.
LGTM so far, i believe there's some external calls not being addressed in the tree, but perhaps is consistency with other trees, we should address it on a more global perspective imo
├── it should ask the balance of the buy token | ||
└── it should ask the balance of the sell token |
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.
i hate ask
but ok
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.
looks good! 👍
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.
good to go! 🚀
to be merged after #149
closes BAL-152