Skip to content

Commit

Permalink
test(medusa): prop 10
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-something committed Nov 25, 2024
1 parent c0ffee0 commit c0ffee7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
31 changes: 31 additions & 0 deletions test/invariants/properties/PropertyFinalize.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {IEBORequestModule, IOracle} from '../Setup.t.sol';
import {HandlerParent} from '../handlers/HandlerParent.t.sol';

contract PropertyFinalize is HandlerParent {
/// @custom:property-id 10
/// @custom:property An answer can only be finalized after the deadline
function property_finalizeAfterDeadline(uint256 _requestIdSeed, uint256 _responseIdSeed) public {
// Pick random Response
bytes32 _requestId = _getRandomRequestId(_requestIdSeed);
IOracle.Request memory _requestData = _ghost_requestData[_requestId];

(bytes32 _responseId, IOracle.Response memory _responseData) = _getRandomActiveResponse(_requestId, _responseIdSeed);

vm.prank(msg.sender);
try oracle.finalize(_requestData, _responseData) {
// After deadline
//
// Update ghosts
} catch {
// Before response deadline or
// No response if there is one or
// Unresolved disputed or
//
}
}

// TODO: consider adding property for releasing unfinazible ones?
}
9 changes: 6 additions & 3 deletions test/invariants/properties/PropertyParent.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
pragma solidity 0.8.26;

import {PropertyDispute} from './PropertyDispute.t.sol';

import {PropertyFinalize} from './PropertyFinalize.t.sol';
import {PropertyRequester} from './PropertyRequester.t.sol';

contract PropertyParent is PropertyRequester, PropertyDispute {
//solhint-disable no-empty-blocks
constructor() {}
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 c0ffee7

Please sign in to comment.