generated from defi-wonderland/solidity-foundry-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: medusa tests #51
Draft
simon-something
wants to merge
29
commits into
dev
Choose a base branch
from
test/handler-cov
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,678
−981
Draft
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5d5fd14
chore: properties md update
simon-something 3b77715
test(medusa): handlers and working setup
simon-something 1b53763
test(medusa): add lib to crytic compile
simon-something 98de161
test(medusa): prop 0 sanity check ok
simon-something 92a50e3
test(medusa): git ignore corpus
simon-something 1e78bdb
test(medusa): git ignore corpus
simon-something efc8876
test(medusa): typo medusa json
simon-something e4cf1e5
test(medusa): rm corpus
simon-something c0ffee6
test(medusa): natspec
simon-something c0ffee7
test(medusa): rm non-sensical handlers onlyoracle etc
simon-something c0ffeed
test(medusa): ghosts refactor
simon-something c0ffee6
test(medusa): more handler fixes
simon-something c0ffeee
test(medusa): properties md update
simon-something 9c8dce2
test(medusa): requester properties (#57)
0xJabberwock c0ffee9
test(medusa): dispute window in prop6
simon-something c0ffeef
test(medusa): fix approveModule
simon-something c0ffeeb
test(medusa): fix approveModule
simon-something 97fff3c
test(medusa): rename PropertyDispute to PropertyDisputer
0xJabberwock 80d145f
test(medusa): correct prop-6
0xJabberwock 1d45342
test(medusa): assert prop-7
0xJabberwock c0ffee6
test(medusa): properties 13
simon-something c0ffee9
test(medusa): fix prop1 for empty finalized req
simon-something c0ffee7
test(medusa): fix fp
simon-something 7218056
test(medusa): proposer properties
0xJabberwock 2b8bc63
test(medusa): fix prop8b
simon-something c0ffee2
test(medusa): false pos fix
simon-something c0ffeea
test(medusa): false pos fix
simon-something a3b8f1c
Merge branch 'dev' into test/handler-cov
simon-something c0ffee8
Revert "Merge branch 'dev' into test/handler-cov"
simon-something 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
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
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 |
---|---|---|
|
@@ -30,12 +30,19 @@ contract FuzzTest is PropertyParent { | |
otherRequestResponseIdx < _ghost_activeResponses[otherRequestId].length; | ||
otherRequestResponseIdx++ | ||
) { | ||
// check that it is not pointing to the same request | ||
assertTrue( | ||
// check that it is not pointing to the same request. If it does, check it wasn't | ||
// finalized without answer | ||
|
||
if ( | ||
_ghost_activeResponses[currentRequestId][currentRequestResponseIdx] | ||
!= _ghost_activeResponses[otherRequestId][otherRequestResponseIdx], | ||
'prop 13: different response id for same request' | ||
); | ||
== _ghost_activeResponses[otherRequestId][otherRequestResponseIdx] | ||
&& ( | ||
(oracle.finalizedAt(currentRequestId) == 0 && oracle.finalizedResponseId(currentRequestId) != 0) | ||
|| (oracle.finalizedAt(otherRequestId) == 0 && oracle.finalizedResponseId(otherRequestId) != 0) | ||
) | ||
) { | ||
assertTrue(false, 'prop 13: same response id for different requests'); | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -62,12 +69,19 @@ contract FuzzTest is PropertyParent { | |
otherRequestDisputeIdx < _ghost_disputes[otherRequestId].length; | ||
otherRequestDisputeIdx++ | ||
) { | ||
// check that it is not pointing to the same request | ||
assertTrue( | ||
_ghost_disputes[currentRequestId][currentRequestDisputeIdx] | ||
!= _ghost_disputes[otherRequestId][otherRequestDisputeIdx], | ||
'prop 13: different dispute id for same request' | ||
); | ||
// check that it is not pointing to the same request. If it does, check it wasn't | ||
// finalized without answer | ||
|
||
if ( | ||
_ghost_activeResponses[currentRequestId][currentRequestDisputeIdx] | ||
== _ghost_activeResponses[otherRequestId][otherRequestDisputeIdx] | ||
Comment on lines
+75
to
+77
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. Shouldn't |
||
&& ( | ||
(oracle.finalizedAt(currentRequestId) == 0 && oracle.finalizedResponseId(currentRequestId) != 0) | ||
|| (oracle.finalizedAt(otherRequestId) == 0 && oracle.finalizedResponseId(otherRequestId) != 0) | ||
) | ||
) { | ||
assertTrue(false, 'prop 13: same response id for different requests'); | ||
} | ||
} | ||
} | ||
} | ||
|
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
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.
Why does the finalization status have to do with this property? I'd expect that requests IDs, responses IDs and disputes IDs shouldn't collide regardless of the request finalization, be it with or without response.
Besides, the condition checks for a request unfinalized (
oracle.finalizedAt(requestId) == 0
) and finalized with response (oracle.finalizedResponseId(requestId) != 0
), which doesn't seem possible at the same time.