Skip to content
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

Merged
merged 21 commits into from
Jul 22, 2024
Merged

Conversation

0xteddybear
Copy link

@0xteddybear 0xteddybear commented Jul 11, 2024

to be merged after #149
closes BAL-152

@0xteddybear 0xteddybear requested a review from wei3erHase July 11, 2024 23:02
Copy link

linear bot commented Jul 11, 2024

BAL-152

Base automatically changed from test/btt-bpool-swapExactAmountIn to dev July 12, 2024 07:39
Copy link
Member

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?

Copy link
Author

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

Copy link
Member

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

Comment on lines 123 to 126
function test_WhenPreconditionsAreMet() external {
// it should return
bCoWPool.verify(correctOrder);
}
Copy link
Member

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)

Copy link
Author

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

Copy link
Member

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?

@0xteddybear 0xteddybear requested a review from wei3erHase July 15, 2024 19:26
Copy link
Member

@wei3erHase wei3erHase left a 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

Comment on lines 22 to 23
└── when preconditions are met
└── it should return
Copy link
Member

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?

wei3erHase
wei3erHase previously approved these changes Jul 17, 2024
Copy link
Member

@wei3erHase wei3erHase left a 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

@wei3erHase wei3erHase changed the title Test/btt bcowpool verify feat: adding bcowpool verify btt tests Jul 17, 2024
Comment on lines 23 to 24
├── it should ask the balance of the buy token
└── it should ask the balance of the sell token
Copy link
Member

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

wei3erHase
wei3erHase previously approved these changes Jul 22, 2024
Copy link
Member

@wei3erHase wei3erHase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! 👍

Copy link
Member

@wei3erHase wei3erHase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to go! 🚀

@wei3erHase wei3erHase merged commit 6c13de8 into dev Jul 22, 2024
4 checks passed
@wei3erHase wei3erHase deleted the test/btt-bcowpool-verify branch July 22, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants