diff --git a/test/invariants/handlers/BaseHandler.t.sol b/test/invariants/handlers/BaseHandler.t.sol index 51301fd..bcdfc01 100644 --- a/test/invariants/handlers/BaseHandler.t.sol +++ b/test/invariants/handlers/BaseHandler.t.sol @@ -10,28 +10,28 @@ contract BaseHandler is Setup, Actors { bytes32[] internal _ghost_requests; // Track request details - mapping(bytes32 => IOracle.Request) internal _ghost_requestData; + mapping(bytes32 _requestId => IOracle.Request _data) internal _ghost_requestData; // Track responses for requests - mapping(bytes32 => bytes32) internal _ghost_activeResponses; // requestId => responseId - mapping(bytes32 => IOracle.Response) internal _ghost_responseData; - mapping(bytes32 => bool) internal _ghost_finalizedResponses; + mapping(bytes32 _requestId => bytes32 _responseId) internal _ghost_activeResponses; // requestId => responseId + mapping(bytes32 _responseId => IOracle.Response _data) internal _ghost_responseData; + mapping(bytes32 _responseId => bool _isFinalized) internal _ghost_finalizedResponses; // Track disputes - mapping(bytes32 => bytes32[]) internal _ghost_disputes; // requestId => disputeIds - mapping(bytes32 => IOracle.Dispute) internal _ghost_disputeData; - mapping(bytes32 => IOracle.DisputeStatus) internal _ghost_disputeStatuses; + mapping(bytes32 _requestId => bytes32[] _disputeIds) internal _ghost_disputes; // requestId => disputeIds + mapping(bytes32 _disputeId => IOracle.Dispute _data) internal _ghost_disputeData; + mapping(bytes32 _disputeId => IOracle.DisputeStatus _status) internal _ghost_disputeStatuses; // Track which requests came from EBORequestCreator - mapping(bytes32 => bool) internal _ghost_validRequests; + mapping(bytes32 _requestId => bool _isFromRequestCreator) internal _ghost_validRequests; // Track chain IDs used per epoch to prevent duplicates - mapping(uint256 => mapping(string => bool)) internal _ghost_epochChainIds; + mapping(uint256 _epoch => mapping(string _chainId => bool _isRequested)) internal _ghost_epochChainIds; // Track bonds and pledges - mapping(address => mapping(bytes32 => uint256)) internal _ghost_bonds; - mapping(address => mapping(bytes32 => uint256)) internal _ghost_pledgesFor; - mapping(address => mapping(bytes32 => uint256)) internal _ghost_pledgesAgainst; + mapping(address _owner => mapping(bytes32 _requestId => uint256 _boundedAmount)) internal _ghost_bonds; + mapping(address _pledger => mapping(bytes32 _disputeId => uint256 _pledgedAmount)) internal _ghost_pledgesFor; + mapping(address _pledger => mapping(bytes32 _disputeId => uint256 _pledgedAmount)) internal _ghost_pledgesAgainst; // Helper functions function _boundEpoch(uint256 _epoch) internal view returns (uint256) { diff --git a/test/invariants/handlers/HandlerBondEscalationModule.t.sol b/test/invariants/handlers/HandlerBondEscalationModule.t.sol index 1aec7a3..f9c2ba0 100644 --- a/test/invariants/handlers/HandlerBondEscalationModule.t.sol +++ b/test/invariants/handlers/HandlerBondEscalationModule.t.sol @@ -4,38 +4,6 @@ pragma solidity 0.8.26; import {BaseHandler, IOracle} from './BaseHandler.t.sol'; contract HandlerBondEscalationModule is BaseHandler { - function handleDisputeResponseBondEscalationModule(uint256 _requestSeed, uint256 _actorSeed) external { - bytes32 requestId = _getRandomRequest(_requestSeed); - if (requestId == bytes32(0) || !_ghost_validRequests[requestId]) return; - - bytes32 responseId = _ghost_activeResponses[requestId]; - if (responseId == bytes32(0)) return; - - IOracle.Response memory response = _ghost_responseData[responseId]; - if (_ghost_finalizedResponses[responseId]) return; - - // Create dispute data - address disputer = _pickActor(_actorSeed); - uint256 bond = _boundAmount(1e18); - - IOracle.Dispute memory dispute = - IOracle.Dispute({disputer: disputer, proposer: msg.sender, responseId: responseId, requestId: requestId}); - - // Submit dispute - bondEscalationModule.disputeResponse(_ghost_requestData[requestId], response, dispute); - - // Track dispute - bytes32 disputeId = keccak256(abi.encode(dispute)); - _ghost_disputes[requestId].push(disputeId); - _ghost_disputeData[disputeId] = dispute; - _ghost_bonds[disputer][requestId] = bond; - _ghost_disputeStatuses[disputeId] = IOracle.DisputeStatus.Escalated; - _ghost_pledgesFor[disputer][disputeId] = 0; - _ghost_pledgesAgainst[disputer][disputeId] = 0; - - emit DisputeCreated(requestId, responseId, disputeId); - } - function handlePledgeForDispute(uint256 _requestSeed, uint256 _disputeIndex, uint256 _actorSeed) external { bytes32 requestId = _getRandomRequest(_requestSeed); if (requestId == bytes32(0)) return;