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

Add FlexVotingClient Invariant Tests #72

Merged
merged 41 commits into from
Dec 10, 2024
Merged

Add FlexVotingClient Invariant Tests #72

merged 41 commits into from
Dec 10, 2024

Conversation

davidlaprade
Copy link
Contributor

@davidlaprade davidlaprade commented Nov 15, 2024

I tried to keep the handler as simple as I could, but it's more complicated than I'd like.

To help me reason about the reverts/failures I was seeing in my invariant tests, I ended up needing to write tests for the handler functions. This helped me catch a lot of bugs in the handler, but it made this PR quite a bit bigger than I'd have liked.

If there are important invariants you think I've missed, please lmk! I'm sure there are some I haven't thought of.

@davidlaprade davidlaprade changed the base branch from improve-flex-client-test-structure-#69 to master November 15, 2024 14:40
@davidlaprade davidlaprade force-pushed the invariants branch 2 times, most recently from ca4b5b6 to d44bf40 Compare November 18, 2024 21:51
Copy link
Member

@apbendi apbendi left a comment

Choose a reason for hiding this comment

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

Hey @davidlaprade, I know this is in draft but I had some time to take a look and leave some preliminary thoughts. Looking good overall! Will be nice to have an invariant suite for this.

test/handlers/FlexVotingClientHandler.sol Outdated Show resolved Hide resolved
test/handlers/FlexVotingClientHandler.sol Outdated Show resolved Hide resolved
test/FlexVotingClient.invariants.t.sol Show resolved Hide resolved
test/handlers/FlexVotingClientHandler.sol Outdated Show resolved Hide resolved
test/handlers/FlexVotingClientHandler.sol Outdated Show resolved Hide resolved
test/handlers/FlexVotingClientHandler.sol Outdated Show resolved Hide resolved
test/handlers/FlexVotingClientHandler.sol Outdated Show resolved Hide resolved
test/FlexVotingClient.invariants.t.sol Outdated Show resolved Hide resolved
test/handlers/FlexVotingClientHandler.sol Outdated Show resolved Hide resolved
@davidlaprade davidlaprade marked this pull request as ready for review December 4, 2024 21:38
@davidlaprade
Copy link
Contributor Author

Weirdly test coverage is ... down(?) because of a PR that only adds... tests 🤔

Copy link
Contributor

@alexkeating alexkeating left a comment

Choose a reason for hiding this comment

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

LGTM thanks for adding the passage of time

Copy link

Coverage after merging invariants into master will be

91.67%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   FlexVotingClient.sol100%100%100%100%
   FractionalPool.sol79.63%70.59%73.33%82.89%107, 109, 111, 114, 190–191, 193–195, 198, 202, 238–239, 78, 80, 82–83, 85
   GovernorCountingFractional.sol94.59%76.92%100%98.04%184, 186, 188, 191

@davidlaprade davidlaprade merged commit fcad35c into master Dec 10, 2024
6 checks passed
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