forked from allo-protocol/allo-v2
-
Notifications
You must be signed in to change notification settings - Fork 3
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
test: invariant basic properties #47
Merged
+460
−283
Merged
Changes from 11 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
3c1a9b5
test: add basic invariant properties
0xRaccoon a5d360c
fix: add mising import
0xRaccoon 716ef73
fix: add missing admin set
0xRaccoon 387a085
test: add invariant test properties
0xRaccoon 47df96a
test: update PROPERTIES.md
0xRaccoon 261d610
test: remove test properties constraints
0xRaccoon 4805dc8
fix: updated tests and partially tackled pr comments
0xRaccoon 08ef593
fix: linter
0xRaccoon 7963817
fix: linter
0xRaccoon 5b8ec7d
fix: linter
0xRaccoon 03a3f5f
fix: addressed pr comments
0xRaccoon 973814b
fix: addressed pr comments
0xRaccoon cbff194
fix: rollback foundry fmt exclude removal
0xRaccoon 9b994ea
fix: remove yarn.lock
0xRaccoon 59f07c4
fix: properties
0xRaccoon 345e961
fix: properties test
0xRaccoon 4f02578
fix: properties test
0xRaccoon 38cf7c3
fix: addressed pr comments
0xRaccoon 7224964
Merge branch 'test/invariants' of github-defi:allo-protocol/allo-v2.1…
0xRaccoon c8b5d6e
fix: tests
0xRaccoon 5ea6141
test: add admin assertions
0xRaccoon 9c5ac9a
fix: assertion text
0xRaccoon 857580c
fix: invariant properties
0xRaccoon 3b6a0a7
fix: invariant properties assertions
0xRaccoon d50ac94
fix: invariant tests
0xRaccoon 74a3805
fix: invariant properties test
0xRaccoon 517a9a3
fix: invariant properties
0xRaccoon eb5636b
test: fix invariant test assertion
0xRaccoon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,4 +117,8 @@ contract Actors is Utils { | |
function _removeAnchorFromActor(address _actor, bytes32 _profileId) internal { | ||
delete _ghost_anchorOf[_actor]; | ||
} | ||
|
||
function _pickActor(uint256 _seed) internal view returns (address _actor) { | ||
_actor = _ghost_actors[_seed % (_ghost_actors.length - 1)]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same, no |
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
-1
seems incorrect to me.idSeed
starts at 0, meaning seed % length starts at 0 too (and goes up tolength - 1
whenseed = length-1
(when seed = length, then length%length is back to the indice 0 of the array)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not reverting due to the underflow during the test as it's outside of an assert, but leave the last element of the array untouched
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, will fix