Skip to content

Commit

Permalink
test(medusa): prop 13 part
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-something committed Nov 26, 2024
1 parent 2e3de34 commit 4e57e08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 7 additions & 1 deletion test/invariants/properties/PropertyDispute.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {HandlerParent} from '../handlers/HandlerParent.t.sol';
contract PropertyDispute is HandlerParent {
/// @custom:property-id 6
/// @custom:property Disputer can always dispute a response before the finalisation, if no previous dispute has been made.
/// @custom:property-id 13
/// @custom:property Each disputeId and responseId can only be tied to one requestId
function property_disputerCanAlwaysCreateDispute(uint256 _requestIdSeed, uint256 _responseIdSeed) public {
// Pick random Response
bytes32 _requestId = _getRandomRequestId(_requestIdSeed);
Expand All @@ -30,6 +32,10 @@ contract PropertyDispute is HandlerParent {
// check if no previous dispute
assertEq(_ghost_disputes[_requestId].length, 0, 'property 6: new dispute duplicate');

// check the disputeId isn't tied to another requestId
// property 13
assertEq(_ghost_disputeData[_disputeId].requestId, bytes32(0), 'Property 13: disputeId tied to another requestId');

// add to ghost disputes
_ghost_disputes[_responseId].push(_disputeId);
_ghost_disputeData[_disputeId] = _disputeData;
Expand Down Expand Up @@ -61,7 +67,7 @@ contract PropertyDispute is HandlerParent {
vm.prank(msg.sender);
try oracle.escalateDispute(_requestData, _responseData, _disputeData) {
// check that the dispute is the first one
assertEq(_ghost_disputes[_responseId][0], _disputeId, 'property 7: not first dispute');
assertEq(_ghost_activeResponses[_requestId][0], _disputeData.requestId, 'property 7: not first dispute');
} catch {
// not first dispute or
// not past the bond escalation deadline
Expand Down
2 changes: 0 additions & 2 deletions test/invariants/properties/PropertyParent.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ import {PropertyRequester} from './PropertyRequester.t.sol';

contract PropertyParent is PropertyRequester, PropertyDispute, PropertyFinalize {
// | 11 | bonded token can never be used on behalf of someone else, unless allowed by the Horizon staking contract | | [ ] |
// | 12 | each bonded amount can only be tied to one requestId | | [ ] |
// | 13 | each disputeId and responseId can only be tied to one requestId
}

0 comments on commit 4e57e08

Please sign in to comment.