audit: boost unit test coverage, add invariant tests #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
PointTokenVault.sol
: both instances ofRewardsNotReleased
, andPTokenNotDeployed
. This PR adds tests for all three and boosts overall coverage of the core functionality to 100%totalSupply
is equal to the sum of all the balances of that pTokenClaim
deposit
,withdraw
,claimPTokens
,redeemRewards
, orconvertRewardsToPTokens
Notes:
MockPointTokenVault
. This is exactly the same as the real one, but with Merkle validation bypassed. As long as the Merkle functionality remains well-tested in the unit tests, you can use this infrastructure in the future to test aspects of the contract that may be more difficult to reach in contexts where a Merkle proof must be generated in a separate environment for every test casedictionary_weight
option infoundry.toml
. On a scale of 0-100, 100 most favors values at the extremes of the input possibilities. The default for invariant tests is80
foundry.toml
. You can set these values higher and leave it to run overnight, but be careful to leave them at moderate values for CI runs. The highest values I've run it at are: