Skip to content

Commit

Permalink
test(medusa): update ghost state in property function
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJabberwock committed Nov 20, 2024
1 parent 149474b commit 823c735
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/invariants/properties/PropertyRequester.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ contract PropertyRequester is HandlerParent {
catch {
assert(false);
}

// 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));

// Track the request
_ghost_requests.push(requestId);
_ghost_requestsPerEpochChainId[_epoch][chainId].push(requestId);
_ghost_requestData[requestId] = requestData;
_ghost_validRequests[requestId] = true;

emit RequestCreated(requestId, _epoch, chainId);
}

/// @custom:property-id 2
Expand Down

0 comments on commit 823c735

Please sign in to comment.