From 823c7351d0efa9348eb84ab8a49dd9af8186c0fb Mon Sep 17 00:00:00 2001 From: 0xJabberwock <0xjabberwock@defi.sucks> Date: Wed, 20 Nov 2024 18:01:34 -0300 Subject: [PATCH] test(medusa): update ghost state in property function --- .../properties/PropertyRequester.t.sol | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/invariants/properties/PropertyRequester.t.sol b/test/invariants/properties/PropertyRequester.t.sol index a62814c..953f896 100644 --- a/test/invariants/properties/PropertyRequester.t.sol +++ b/test/invariants/properties/PropertyRequester.t.sol @@ -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