Commit 4e57f1e
Improve SaferSafes test suite. (#17949)
* Add SaferSafes as child of the module and guard
* Add ISaferSafes
* Test comment and assertion fixes
* Improve comments
* Make LivenessModule2 and TimelockGuard abstract
Move semver to SaferSafes
semver lock
* fix test contract name
* Move semver to SaferSafes
* Disable the guard and module upon ownership transfer
* Add _disableThisGuard function
* Update tests
* Add config resets
* fmt
* fix test_changeOwnershipToFallback_canRechallenge_succeeds
* Simplify by clearing config directly
* Put _disableThisGuard into child contract
* Add timelockDelay reset on _disableThisGuard
* semver-lock
* Move _disableThisGuard logic into TimelockGuard
* clear livenessSafeConfig at tend of _disableThisModule
* Clarify use of SENTINEL_OWNER
* Fix the ordering of the disableGuard and disableModule calls
* semver-lock
* remove unused imports
* rename _disableThisGuard to _disableGuard
* bump semver
* Add test to remove unrelated guard
* Add SENTINEL_MODULE constant
* Clean up using ternary if
* Reset cancellationThreshold to 0 on changeOwnership
* Fix moduleFound if/else handling
* Clear pending transactions
* Pre-pr fixes
* Add test contract to test name lint exclusions
* fix name of test contract
* Move _disableGuard impl into TimelockGuard
* Add missing natspec
* Add gas limit testing on changeOwnershipToFallback
* Remove interfaces for abstract contracts
* Move state changes out into internal _clearLivenessModule
* Improve names on the internal _disableX methods
* Add clearTimelockGuard function
* Add _disableGuard helper to TLG tests
* Limit number of transactions cancelled to 100
* Revert "Remove interfaces for abstract contracts"
This reverts commit bd03288.
* Move livenessModule2 address into TestUtils
Reduces diff a bit
* Reduce diff somewhat
* Remove unused arg
* Update packages/contracts-bedrock/src/safe/TimelockGuard.sol
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
* Fix iface
* update abi for iface fix
* Do not clear or disable the module during ownership transfer
* Fix inaccurate comment on _disableAndClearGuard
* Further improve comment
* remove unused import
* fix test name
* Do not clear guard during changeOwnershipToFallback
* Remove unused SENTINEL_MODULE var
* Remove dangling comment
* Revert "Remove dangling comment"
This reverts commit d266d12.
* Fix whitespace
* remove unnecessary internal _clearTimelockGuard function
It's no longer reused in the change ownership call.
* Address feedback
* Add missing assertion
* Move guard slot into constants
* semver-lock
* Remove LivenessModule from semver-lock
* fix: fmt, semver-lock, unused imports
* Remove unused variable
* fix semver lock by resetting old LivenessModule
* fix unused import
* Require that msgSender be an owner of the Safe
* fix compiler error
* Fix placement of _msgSender check
* semver-lock
* Add TimelockGuard_NotOwner test
* Bump semver
* Add test comment, make into fuzz test
* Improvements to SaferSafes styling (#17903)
* Add public getter livenessSafeConfiguration to return a struct rather than tuple
* Use Safe as input type to mappings and functions on LivenessModule2
* Add dividers based on function type
* fmt
* snapshots
* Remove conditional return of 0 in the cancellationThreshold if the guard is not enabled
* rename timelockConfiguration func to timelockDelay
* semver-lock
* Add missing natspec on tests and convert to fuzzing where possible
* fix import and abi snapshot
* fix: off by one error in challenge period test
* fix test name
* refactor(test): split clearLivenessModule tests into separate contract
- Create LivenessModule2_ClearLivenessModule_Test contract
- Rename test_clear_* to test_clearLivenessModule_* for consistency
- Update contract title to match function under test
* test(LivenessModule2): add challenge cancellation to clearLivenessModule test
Enhance test_clearLivenessModule_succeeds to verify that clearing also
properly cancels any active challenge, covering the _cancelChallenge
code path.
* test(LivenessModule2): add guard removal check to ownership transfer test
Integrate guard removal verification into existing fuzz test rather than
creating a separate test. Verifies that any guard set on the Safe is
properly removed during the ownership transfer process.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Remove pointless check
Slop that got through
* Convert to fuzz tests
* test(TimelockGuard): enhance test coverage and convert to fuzz tests
- Convert configureTimelockGuard tests to fuzz tests for broader coverage
- Add comprehensive checkAfterExecution tests for all code paths
- Remove redundant assertions and comments
- Add test to verify transaction cannot be re-executed after success
- Improve test documentation and structure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix test name to match function name
* feat: two extra tests to fuzz
* fix: fmt
---------
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Claude <[email protected]>
Co-authored-by: JosepBove <[email protected]>1 parent b940308 commit 4e57f1e
File tree
3 files changed
+121
-28
lines changed- packages/contracts-bedrock/test/safe
3 files changed
+121
-28
lines changedLines changed: 33 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
112 | | - | |
| 112 | + | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| 223 | + | |
222 | 224 | | |
223 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
224 | 229 | | |
225 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
226 | 236 | | |
227 | 237 | | |
228 | 238 | | |
| |||
232 | 242 | | |
233 | 243 | | |
234 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
235 | 248 | | |
236 | 249 | | |
237 | 250 | | |
| |||
247 | 260 | | |
248 | 261 | | |
249 | 262 | | |
| 263 | + | |
250 | 264 | | |
251 | 265 | | |
252 | | - | |
| 266 | + | |
253 | 267 | | |
254 | 268 | | |
255 | 269 | | |
256 | 270 | | |
257 | 271 | | |
258 | | - | |
| 272 | + | |
259 | 273 | | |
260 | 274 | | |
261 | 275 | | |
| |||
450 | 464 | | |
451 | 465 | | |
452 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
453 | 478 | | |
454 | 479 | | |
455 | 480 | | |
| |||
473 | 498 | | |
474 | 499 | | |
475 | 500 | | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
476 | 504 | | |
477 | 505 | | |
478 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
Lines changed: 87 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
272 | 270 | | |
273 | 271 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
281 | 278 | | |
282 | 279 | | |
283 | 280 | | |
284 | 281 | | |
285 | 282 | | |
286 | 283 | | |
287 | | - | |
288 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
289 | 288 | | |
290 | | - | |
| 289 | + | |
291 | 290 | | |
292 | | - | |
| 291 | + | |
293 | 292 | | |
294 | 293 | | |
295 | | - | |
296 | | - | |
297 | | - | |
| 294 | + | |
298 | 295 | | |
299 | 296 | | |
300 | 297 | | |
301 | | - | |
302 | | - | |
| 298 | + | |
| 299 | + | |
303 | 300 | | |
304 | 301 | | |
305 | 302 | | |
306 | | - | |
| 303 | + | |
307 | 304 | | |
308 | 305 | | |
309 | 306 | | |
| |||
324 | 321 | | |
325 | 322 | | |
326 | 323 | | |
327 | | - | |
328 | | - | |
329 | 324 | | |
330 | 325 | | |
331 | 326 | | |
| |||
733 | 728 | | |
734 | 729 | | |
735 | 730 | | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
736 | 800 | | |
737 | 801 | | |
738 | 802 | | |
| |||
0 commit comments