Skip to content

Commit

Permalink
test: property-id 1
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJabberwock committed Nov 19, 2024
1 parent c0ffee6 commit 730db68
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
7 changes: 7 additions & 0 deletions test/invariants/handlers/HandlerEBORequestCreator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ contract HandlerEBORequestCreator is BaseHandler {
// Get current request data
IOracle.Request memory requestData = eboRequestCreator.getRequestData();

// Build request module parameters
IEBORequestModule.RequestParameters memory requestParams =
abi.decode(requestData.requestModuleData, (IEBORequestModule.RequestParameters));
requestParams.epoch = _epoch;
requestParams.chainId = chainId;
requestData.requestModuleData = abi.encode(requestParams);

// Calculate request ID using same logic as Oracle
bytes32 requestId = keccak256(abi.encode(requestData));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ pragma solidity 0.8.26;

import {HandlerParent} from '../handlers/HandlerParent.t.sol';

contract PropertyEbo is HandlerParent {
contract PropertyEBORequestCreator is HandlerParent {
//solhint-disable no-empty-blocks
constructor() {}

/// @custom:property-id 1
/// @custom:property Requester can always create a request as long as the same chainId/epoch isn't requested yet
// function property_canAlwaysCreateRequest(uint256 _epoch, uint256 _chainId) external {
// _epoch = _boundEpoch(_epoch);
// string memory _chainId = _generateChainId(_chainId);
// }
function property_canAlwaysCreateRequest(uint256 _epoch, uint256 _chainIdSeed) external {
try HandlerParent(this).handleCreateRequest(_epoch, _chainIdSeed) {}
catch {
assert(false);
}
}
}
4 changes: 2 additions & 2 deletions test/invariants/properties/PropertyParent.t.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {PropertyEbo} from './PropertyEbo.t.sol';
import {PropertyEBORequestCreator} from './PropertyEBORequestCreator.t.sol';
import {PropertySanityCheck} from './PropertySanityCheck.t.sol';

contract PropertyParent is PropertyEbo, PropertySanityCheck {
contract PropertyParent is PropertyEBORequestCreator, PropertySanityCheck {
//solhint-disable no-empty-blocks
constructor() {}
}

0 comments on commit 730db68

Please sign in to comment.