Skip to content

Commit

Permalink
test: additional coverage andfilterFuzzInput modifier
Browse files Browse the repository at this point in the history
Tests added:
- initialize() storage variables properly
- depositIntoStrategyWithSignature() revert when token transfer fails
- removeShares() reverts with 0 shares
- removeShares() with removeAmount less than deposit
- addShares() with MAX_STAKER_STRATEGY_LIST_LENGTH strategies
- removeStrategiesFromDepositWhitelist() doesn't emit event on non-whitelisted strategy
- removeStrategiesFromDepositWhitelist() emits event on removing whitelisted strategy
Also added some small commenting, renamed tests, and updated tree file
  • Loading branch information
8sunyuan committed Nov 3, 2023
1 parent a1060e6 commit d30521e
Show file tree
Hide file tree
Showing 2 changed files with 276 additions and 112 deletions.
6 changes: 5 additions & 1 deletion src/test/tree/StrategyManangerUnit.tree
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
├── StrategyManagerUnit.t.sol (*** denotes that integration tests are needed to validate path)
├── initialize
| ├── given that initialized is only called once
│ │ └── it should set the storage variables correctly (owner, strategyWhitelister, pauserRegistry)
│ └── given that initialize is called again
│ └── it should revert
├── depositIntoStrategy()
Expand Down Expand Up @@ -36,7 +38,7 @@
│ │ ├── given the token safeTransferFrom reverts
│ │ │ └── it should revert
│ │ └── given the token safeTransferFrom succeeds
│ │ ├── given that the staker has delegated to a operator
│ │ ├── given that the staker has delegated to a operator ***
│ │ │ └── it should deposit successfully with shares and nonce increase, including delegated shares
│ │ └── given that the staker is not delegated
│ │ └── it should deposit successfully with shares and nonce increase
Expand Down Expand Up @@ -73,6 +75,8 @@
│ │ └── it should revert
│ ├── given adding shares with 0 existing shares
│ │ └── it should increase shares and increment stakerStrategyListLength
│ ├── given adding shares with 0 existing shares and staker has MAX_STAKER_STRATEGY_LIST_LENGTH
│ │ └── it should revert
│ └── given the adding shares with > 0 existing shares
│ └── it should increase shares, unchanged stakerStrategyListLength
├── withdrawSharesAsTokens()
Expand Down
Loading

0 comments on commit d30521e

Please sign in to comment.