Skip to content

Commit

Permalink
fix: clean warps
Browse files Browse the repository at this point in the history
  • Loading branch information
0xShaito committed Oct 21, 2024
1 parent 842333b commit 81bfa78
Showing 1 changed file with 14 additions and 33 deletions.
47 changes: 14 additions & 33 deletions test/integration/arbitrum/FinalizeRequest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(abi.encodeWithSelector(IOracle.Oracle_FinalizableResponseExists.selector, _responseId));
_finalizeRequest(_requestId, 0);

// Pass the response dispute window
vm.warp(_responseCreatedAt + responseDisputeWindow - responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

Expand Down Expand Up @@ -174,9 +171,6 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(abi.encodeWithSelector(IOracle.Oracle_FinalizableResponseExists.selector, _responseId));
_finalizeRequest(_requestId, 0);

// Pass the response dispute window
vm.warp(_responseCreatedAt + responseDisputeWindow - responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

Expand Down Expand Up @@ -234,9 +228,6 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(abi.encodeWithSelector(IOracle.Oracle_FinalizableResponseExists.selector, _responseId));
_finalizeRequest(_requestId, 0);

// Pass the response dispute window
vm.warp(_responseCreatedAt + responseDisputeWindow - responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

Expand Down Expand Up @@ -278,16 +269,10 @@ contract IntegrationFinalizeRequest is IntegrationBase {

uint256 _responseCreatedAt = oracle.responseCreatedAt(_responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// Revert if the request is finalized without response when a response without dispute exists
vm.expectRevert(abi.encodeWithSelector(IOracle.Oracle_FinalizableResponseExists.selector, _responseId));
_finalizeRequest(_requestId, 0);

// Pass the response dispute window
vm.warp(_responseCreatedAt + responseDisputeWindow - responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

Expand Down Expand Up @@ -341,9 +326,6 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(abi.encodeWithSelector(IOracle.Oracle_FinalizableResponseExists.selector, _responseId));
_finalizeRequest(_requestId, 0);

// Pass the response dispute window
vm.warp(_responseCreatedAt + responseDisputeWindow - responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

Expand Down Expand Up @@ -389,12 +371,12 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(IBondedResponseModule.BondedResponseModule_InvalidReleaseParameters.selector);
_releaseUnfinalizableResponseBond(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// TODO: What if the request is finalized without response, after a response has been disputed but before
// its bond escalation settlement or dispute arbitration?

Expand Down Expand Up @@ -443,14 +425,13 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(IBondedResponseModule.BondedResponseModule_InvalidReleaseParameters.selector);
_releaseUnfinalizableResponseBond(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

// TODO: What if the request is finalized without response, after a response has been disputed but before
// its bond escalation settlement or dispute arbitration?
// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// Finalize the request without response
_finalizeRequest(_requestId, 0);
Expand Down Expand Up @@ -497,12 +478,12 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(IBondedResponseModule.BondedResponseModule_InvalidReleaseParameters.selector);
_releaseUnfinalizableResponseBond(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// TODO: What if the request is finalized without response, after a response has been disputed but before
// its bond escalation settlement or dispute arbitration?

Expand Down Expand Up @@ -552,12 +533,12 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(IBondedResponseModule.BondedResponseModule_InvalidReleaseParameters.selector);
_releaseUnfinalizableResponseBond(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// TODO: What if the request is finalized without response, after a response has been disputed but before
// its bond escalation settlement or dispute arbitration?

Expand Down Expand Up @@ -610,12 +591,12 @@ contract IntegrationFinalizeRequest is IntegrationBase {
vm.expectRevert(IBondedResponseModule.BondedResponseModule_InvalidReleaseParameters.selector);
_releaseUnfinalizableResponseBond(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// Dispute the response
bytes32 _disputeId = _disputeResponse(_requestId, _responseId);

// Pass the response deadline
vm.warp(_requestCreatedAt + responseDeadline);

// TODO: What if the request is finalized without response, after a response has been disputed but before
// its bond escalation settlement or dispute arbitration?

Expand Down

0 comments on commit 81bfa78

Please sign in to comment.