From ee716ee0924b7a9b54bcfe6fc6f7b50799edb4a2 Mon Sep 17 00:00:00 2001 From: 0xJabberwock <0xjabberwock@defi.sucks> Date: Fri, 26 Jul 2024 15:08:34 -0300 Subject: [PATCH] build: update prophet-core-contracts package (#53) --- package.json | 2 +- .../modules/dispute/BondEscalationModule.sol | 2 +- .../request/ContractCallRequestModule.sol | 2 +- .../modules/request/HttpRequestModule.sol | 2 +- .../request/SparseMerkleTreeRequestModule.sol | 2 +- .../PrivateERC20ResolutionModule.sol | 4 +- .../modules/response/BondedResponseModule.sol | 2 +- .../test/integration/RequestCreation.t.sol | 4 +- .../test/integration/ResponseDispute.t.sol | 2 +- .../test/integration/ResponseProposal.t.sol | 2 +- .../dispute/BondEscalationModule.t.sol | 30 +++++------ .../modules/finality/CallbackModule.t.sol | 1 - .../request/ContractCallRequestModule.t.sol | 6 +-- .../modules/request/HttpRequestModule.t.sol | 6 +-- .../SparseMerkleTreeRequestModule.t.sol | 4 +- .../PrivateERC20ResolutionModule.t.sol | 54 +++++++++---------- .../response/BondedResponseModule.t.sol | 20 ++++--- yarn.lock | 8 +-- 18 files changed, 78 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index ec445145..3971c681 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "package.json": "sort-package-json" }, "dependencies": { - "@defi-wonderland/prophet-core-contracts": "0.0.0-ad40b65b", + "@defi-wonderland/prophet-core-contracts": "0.0.0-c25103ea", "@openzeppelin/contracts": "4.9.5", "solmate": "https://github.com/transmissions11/solmate.git#bfc9c25865a274a7827fea5abf6e4fb64fc64e6c" }, diff --git a/solidity/contracts/modules/dispute/BondEscalationModule.sol b/solidity/contracts/modules/dispute/BondEscalationModule.sol index 12e0c53a..0d56983b 100644 --- a/solidity/contracts/modules/dispute/BondEscalationModule.sol +++ b/solidity/contracts/modules/dispute/BondEscalationModule.sol @@ -37,7 +37,7 @@ contract BondEscalationModule is Module, IBondEscalationModule { RequestParameters memory _params = decodeRequestData(_request.disputeModuleData); BondEscalation storage _escalation = _escalations[_dispute.requestId]; - if (block.number > ORACLE.createdAt(_dispute.responseId) + _params.disputeWindow) { + if (block.number > ORACLE.responseCreatedAt(_dispute.responseId) + _params.disputeWindow) { revert BondEscalationModule_DisputeWindowOver(); } diff --git a/solidity/contracts/modules/request/ContractCallRequestModule.sol b/solidity/contracts/modules/request/ContractCallRequestModule.sol index 27b22a50..33c1824b 100644 --- a/solidity/contracts/modules/request/ContractCallRequestModule.sol +++ b/solidity/contracts/modules/request/ContractCallRequestModule.sol @@ -40,7 +40,7 @@ contract ContractCallRequestModule is Module, IContractCallRequestModule { ) external override(IContractCallRequestModule, Module) onlyOracle { RequestParameters memory _params = decodeRequestData(_request.requestModuleData); - if (ORACLE.createdAt(_getId(_response)) != 0) { + if (ORACLE.responseCreatedAt(_getId(_response)) != 0) { _params.accountingExtension.pay({ _requestId: _response.requestId, _payer: _request.requester, diff --git a/solidity/contracts/modules/request/HttpRequestModule.sol b/solidity/contracts/modules/request/HttpRequestModule.sol index 97f41ede..95fc7f8c 100644 --- a/solidity/contracts/modules/request/HttpRequestModule.sol +++ b/solidity/contracts/modules/request/HttpRequestModule.sol @@ -40,7 +40,7 @@ contract HttpRequestModule is Module, IHttpRequestModule { ) external override(IHttpRequestModule, Module) onlyOracle { RequestParameters memory _params = decodeRequestData(_request.requestModuleData); - if (ORACLE.createdAt(_getId(_response)) != 0) { + if (ORACLE.responseCreatedAt(_getId(_response)) != 0) { _params.accountingExtension.pay({ _requestId: _response.requestId, _payer: _request.requester, diff --git a/solidity/contracts/modules/request/SparseMerkleTreeRequestModule.sol b/solidity/contracts/modules/request/SparseMerkleTreeRequestModule.sol index 03834b43..2e3adffc 100644 --- a/solidity/contracts/modules/request/SparseMerkleTreeRequestModule.sol +++ b/solidity/contracts/modules/request/SparseMerkleTreeRequestModule.sol @@ -40,7 +40,7 @@ contract SparseMerkleTreeRequestModule is Module, ISparseMerkleTreeRequestModule ) external override(ISparseMerkleTreeRequestModule, Module) onlyOracle { RequestParameters memory _params = decodeRequestData(_request.requestModuleData); - if (ORACLE.createdAt(_getId(_response)) != 0) { + if (ORACLE.responseCreatedAt(_getId(_response)) != 0) { _params.accountingExtension.pay({ _requestId: _response.requestId, _payer: _request.requester, diff --git a/solidity/contracts/modules/resolution/PrivateERC20ResolutionModule.sol b/solidity/contracts/modules/resolution/PrivateERC20ResolutionModule.sol index ff64a8fe..c71eed1b 100644 --- a/solidity/contracts/modules/resolution/PrivateERC20ResolutionModule.sol +++ b/solidity/contracts/modules/resolution/PrivateERC20ResolutionModule.sol @@ -53,7 +53,7 @@ contract PrivateERC20ResolutionModule is Module, IPrivateERC20ResolutionModule { /// @inheritdoc IPrivateERC20ResolutionModule function commitVote(IOracle.Request calldata _request, IOracle.Dispute calldata _dispute, bytes32 _commitment) public { bytes32 _disputeId = _validateDispute(_request, _dispute); - if (ORACLE.createdAt(_disputeId) == 0) revert PrivateERC20ResolutionModule_NonExistentDispute(); + if (ORACLE.disputeCreatedAt(_disputeId) == 0) revert PrivateERC20ResolutionModule_NonExistentDispute(); if (ORACLE.disputeStatus(_disputeId) != IOracle.DisputeStatus.Escalated) { revert PrivateERC20ResolutionModule_AlreadyResolved(); } @@ -113,7 +113,7 @@ contract PrivateERC20ResolutionModule is Module, IPrivateERC20ResolutionModule { IOracle.Response calldata _response, IOracle.Dispute calldata _dispute ) external onlyOracle { - if (ORACLE.createdAt(_disputeId) == 0) revert PrivateERC20ResolutionModule_NonExistentDispute(); + if (ORACLE.disputeCreatedAt(_disputeId) == 0) revert PrivateERC20ResolutionModule_NonExistentDispute(); if (ORACLE.disputeStatus(_disputeId) != IOracle.DisputeStatus.Escalated) { revert PrivateERC20ResolutionModule_AlreadyResolved(); } diff --git a/solidity/contracts/modules/response/BondedResponseModule.sol b/solidity/contracts/modules/response/BondedResponseModule.sol index 1b6c60d7..8794169e 100644 --- a/solidity/contracts/modules/response/BondedResponseModule.sol +++ b/solidity/contracts/modules/response/BondedResponseModule.sol @@ -70,7 +70,7 @@ contract BondedResponseModule is Module, IBondedResponseModule { revert BondedResponseModule_TooEarlyToFinalize(); } - uint256 _responseCreatedAt = ORACLE.createdAt(_getId(_response)); + uint256 _responseCreatedAt = ORACLE.responseCreatedAt(_getId(_response)); if (_responseCreatedAt != 0) { if (!_isModule && block.number < _responseCreatedAt + _params.disputeWindow) { diff --git a/solidity/test/integration/RequestCreation.t.sol b/solidity/test/integration/RequestCreation.t.sol index 6202ea13..c6d6e50f 100644 --- a/solidity/test/integration/RequestCreation.t.sol +++ b/solidity/test/integration/RequestCreation.t.sol @@ -35,7 +35,7 @@ contract Integration_RequestCreation is IntegrationBase { assertEq(oracle.nonceToRequestId(mockRequest.nonce), _requestId); // Check: saved the correct creation block? - assertEq(oracle.createdAt(_requestId), block.number); + assertEq(oracle.requestCreatedAt(_requestId), block.number); // Check: saved the allowed modules? assertTrue(oracle.allowedModule(_requestId, mockRequest.requestModule)); @@ -61,7 +61,7 @@ contract Integration_RequestCreation is IntegrationBase { assertEq(oracle.nonceToRequestId(mockRequest.nonce), _requestId); // Check: saved the correct creation block? - assertEq(oracle.createdAt(_requestId), block.number); + assertEq(oracle.requestCreatedAt(_requestId), block.number); // Check: saved the allowed modules? assertTrue(oracle.allowedModule(_requestId, mockRequest.requestModule)); diff --git a/solidity/test/integration/ResponseDispute.t.sol b/solidity/test/integration/ResponseDispute.t.sol index 1ff17bf0..638cb9ff 100644 --- a/solidity/test/integration/ResponseDispute.t.sol +++ b/solidity/test/integration/ResponseDispute.t.sol @@ -39,7 +39,7 @@ contract Integration_ResponseDispute is IntegrationBase { assertEq(oracle.disputeOf(_getId(mockResponse)), _disputeId); // Check: creation time is correct? - assertEq(oracle.createdAt(_disputeId), block.number); + assertEq(oracle.disputeCreatedAt(_disputeId), block.number); } /** diff --git a/solidity/test/integration/ResponseProposal.t.sol b/solidity/test/integration/ResponseProposal.t.sol index 6798eb70..f79f2db5 100644 --- a/solidity/test/integration/ResponseProposal.t.sol +++ b/solidity/test/integration/ResponseProposal.t.sol @@ -41,7 +41,7 @@ contract Integration_ResponseProposal is IntegrationBase { assertEq(_getResponseIds[0], _getId(mockResponse)); // Check: the creation block is correct? - assertEq(oracle.createdAt(_getId(mockResponse)), block.number); + assertEq(oracle.responseCreatedAt(_getId(mockResponse)), block.number); } /** diff --git a/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol b/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol index 6fc55656..21df0cb0 100644 --- a/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol +++ b/solidity/test/unit/modules/dispute/BondEscalationModule.t.sol @@ -382,7 +382,7 @@ contract BondEscalationModule_Unit_EscalateDispute is BaseTest { vm.expectEmit(true, true, true, true, address(bondEscalationModule)); emit BondEscalationStatusUpdated(_requestId, _disputeId, IBondEscalationModule.BondEscalationStatus.Escalated); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Escalated) ); @@ -431,8 +431,8 @@ contract BondEscalationModule_Unit_DisputeResponse is BaseTest { // Warp to a time after the disputeWindow is over. vm.roll(block.number + _disputeWindow + 1); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_responseId)), abi.encode(1)); + // Mock and expect IOracle.responseCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_responseId)), abi.encode(1)); // Check: does it revert if the dispute window is over? vm.expectRevert(IBondEscalationModule.BondEscalationModule_DisputeWindowOver.selector); @@ -460,8 +460,8 @@ contract BondEscalationModule_Unit_DisputeResponse is BaseTest { mockDispute.responseId = _responseId; mockDispute.requestId = _requestId; - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_responseId)), abi.encode(1)); + // Mock and expect IOracle.responseCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_responseId)), abi.encode(1)); // Mock and expect the accounting extension to be called _mockAndExpect( @@ -513,8 +513,8 @@ contract BondEscalationModule_Unit_DisputeResponse is BaseTest { abi.encode(true) ); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_responseId)), abi.encode(1)); + // Mock and expect IOracle.responseCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_responseId)), abi.encode(1)); vm.expectEmit(true, true, true, true, address(bondEscalationModule)); emit ResponseDisputed({ @@ -563,8 +563,8 @@ contract BondEscalationModule_Unit_DisputeResponse is BaseTest { mockDispute.responseId = _responseId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_responseId)), abi.encode(1)); + // Mock and expect IOracle.responseCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_responseId)), abi.encode(1)); // Mock and expect the accounting extension to be called _mockAndExpect( @@ -627,7 +627,7 @@ contract BondEscalationModule_Unit_OnDisputeStatusChange is BaseTest { abi.encode(true) ); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Lost) ); @@ -669,7 +669,7 @@ contract BondEscalationModule_Unit_OnDisputeStatusChange is BaseTest { abi.encode(true) ); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Won) ); @@ -690,7 +690,7 @@ contract BondEscalationModule_Unit_OnDisputeStatusChange is BaseTest { mockDispute.requestId = _requestId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.disputeStatus to be called _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(_status)); // Mock and expect IAccountingExtension.pay to be called @@ -746,7 +746,7 @@ contract BondEscalationModule_Unit_OnDisputeStatusChange is BaseTest { // Set the bond escalation status to Active, which is the only possible one for this function bondEscalationModule.forTest_setBondEscalationStatus(_requestId, IBondEscalationModule.BondEscalationStatus.Active); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Won) ); @@ -812,7 +812,7 @@ contract BondEscalationModule_Unit_OnDisputeStatusChange is BaseTest { _requestId, IBondEscalationModule.BondEscalationStatus.Escalated ); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.disputeStatus to be called _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(_status)); // Mock and expect IAccountingExtension.pay to be called @@ -891,7 +891,7 @@ contract BondEscalationModule_Unit_OnDisputeStatusChange is BaseTest { _requestId, IBondEscalationModule.BondEscalationStatus.Escalated ); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.disputeStatus to be called _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(_status)); // Mock and expect IAccountingExtension.pay to be called diff --git a/solidity/test/unit/modules/finality/CallbackModule.t.sol b/solidity/test/unit/modules/finality/CallbackModule.t.sol index 55ce1a7f..0e559d17 100644 --- a/solidity/test/unit/modules/finality/CallbackModule.t.sol +++ b/solidity/test/unit/modules/finality/CallbackModule.t.sol @@ -81,7 +81,6 @@ contract CallbackModule_Unit_FinalizeRequest is BaseTest { * @notice Test that finalizeRequest emits events */ function test_emitsEvents(address _proposer, address _target, bytes calldata _data) public assumeFuzzable(_target) { - vm.etch(_target, '0xabcdef'); mockRequest.finalityModuleData = abi.encode(ICallbackModule.RequestParameters({target: _target, data: _data})); mockResponse.requestId = _getId(mockRequest); diff --git a/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol b/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol index 26fdbd13..1a0a69b6 100644 --- a/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol +++ b/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol @@ -153,7 +153,7 @@ contract ContractCallRequestModule_Unit_FinalizeRequest is BaseTest { // Mock and expect oracle to return the response's creation time _mockAndExpect( - address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(block.timestamp) + address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(block.timestamp) ); // Mock and expect IAccountingExtension.pay to be called @@ -186,7 +186,7 @@ contract ContractCallRequestModule_Unit_FinalizeRequest is BaseTest { mockResponse.requestId = _requestId; // Mock and expect oracle to return no timestamp - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(0)); + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(0)); // Mock and expect IAccountingExtension.release to be called _mockAndExpect( @@ -216,7 +216,7 @@ contract ContractCallRequestModule_Unit_FinalizeRequest is BaseTest { mockResponse.requestId = _requestId; // Mock and expect oracle to return no timestamp - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(0)); + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(0)); // Mock and expect IAccountingExtension.release to be called _mockAndExpect( diff --git a/solidity/test/unit/modules/request/HttpRequestModule.t.sol b/solidity/test/unit/modules/request/HttpRequestModule.t.sol index b69ebcd6..11cc1063 100644 --- a/solidity/test/unit/modules/request/HttpRequestModule.t.sol +++ b/solidity/test/unit/modules/request/HttpRequestModule.t.sol @@ -143,7 +143,7 @@ contract HttpRequestModule_Unit_FinalizeRequest is BaseTest { // Mock and expect oracle to return the response's creation time _mockAndExpect( - address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(block.timestamp) + address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(block.timestamp) ); // Mock and expect IAccountingExtension.pay to be called @@ -183,7 +183,7 @@ contract HttpRequestModule_Unit_FinalizeRequest is BaseTest { mockResponse.requestId = _requestId; // Mock and expect oracle to return no timestamp - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(0)); + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(0)); // Mock and expect IAccountingExtension.release to be called _mockAndExpect( @@ -213,7 +213,7 @@ contract HttpRequestModule_Unit_FinalizeRequest is BaseTest { mockResponse.requestId = _requestId; // Update mock call to return the response's createdAt - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(0)); + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(0)); // Mock and expect IAccountingExtension.release to be called _mockAndExpect( diff --git a/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol b/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol index 56ca229c..d31d6726 100644 --- a/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol +++ b/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol @@ -168,7 +168,7 @@ contract SparseMerkleTreeRequestModule_Unit_FinalizeRequest is BaseTest { // Oracle confirms that the response has been created _mockAndExpect( - address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(block.timestamp) + address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(block.timestamp) ); // Mock and expect IAccountingExtension.pay to be called @@ -214,7 +214,7 @@ contract SparseMerkleTreeRequestModule_Unit_FinalizeRequest is BaseTest { mockResponse.requestId = _requestId; // Oracle returns no createdAt value - finalizing without a response - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(0)); + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(0)); // Mock and expect IAccountingExtension.release to be called _mockAndExpect( diff --git a/solidity/test/unit/modules/resolution/PrivateERC20ResolutionModule.t.sol b/solidity/test/unit/modules/resolution/PrivateERC20ResolutionModule.t.sol index bf628d53..2e8ba6c6 100644 --- a/solidity/test/unit/modules/resolution/PrivateERC20ResolutionModule.t.sol +++ b/solidity/test/unit/modules/resolution/PrivateERC20ResolutionModule.t.sol @@ -85,7 +85,7 @@ contract BaseTest is Test, Helpers { bytes32 _commitment = module.computeCommitment(_disputeId, _amountOfVotes, bytes32(_i)); // index as salt - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), @@ -194,8 +194,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { vm.expectEmit(true, true, true, true); emit VoteCommitted(_voter, _disputeId, _commitment); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Escalated) @@ -243,8 +243,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { mockDispute.requestId = _requestId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(0)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(0)); // Check: does it revert if no dispute exists? vm.expectRevert(IPrivateERC20ResolutionModule.PrivateERC20ResolutionModule_NonExistentDispute.selector); @@ -260,8 +260,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { mockDispute.requestId = _requestId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Active) @@ -281,8 +281,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { mockDispute.requestId = _requestId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), @@ -304,8 +304,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { mockDispute.requestId = _requestId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Won) @@ -325,8 +325,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { mockDispute.requestId = _requestId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Lost) @@ -346,8 +346,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { mockDispute.requestId = _requestId; bytes32 _disputeId = _getId(mockDispute); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Escalated) @@ -386,8 +386,8 @@ contract PrivateERC20ResolutionModule_Unit_CommitVote is BaseTest { // Warp to invalid timestamp for commitment vm.warp(_timestamp); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Escalated) @@ -676,8 +676,8 @@ contract PrivateERC20ResolutionModule_Unit_ResolveDispute is BaseTest { module.forTest_setStartTime(_disputeId, 1); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Escalated) @@ -718,8 +718,8 @@ contract PrivateERC20ResolutionModule_Unit_ResolveDispute is BaseTest { module.forTest_setStartTime(_disputeId, 1); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Active) @@ -750,8 +750,8 @@ contract PrivateERC20ResolutionModule_Unit_ResolveDispute is BaseTest { module.forTest_setStartTime(_disputeId, 1); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Won) @@ -782,8 +782,8 @@ contract PrivateERC20ResolutionModule_Unit_ResolveDispute is BaseTest { module.forTest_setStartTime(_disputeId, 1); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), abi.encodeCall(IOracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus.Lost) @@ -814,8 +814,8 @@ contract PrivateERC20ResolutionModule_Unit_ResolveDispute is BaseTest { module.forTest_setStartTime(_disputeId, 1); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_disputeId)), abi.encode(1)); + // Mock and expect IOracle.disputeCreatedAt to be called + _mockAndExpect(address(oracle), abi.encodeCall(IOracle.disputeCreatedAt, (_disputeId)), abi.encode(1)); // Mock and expect IOracle.disputeStatus to be called _mockAndExpect( address(oracle), diff --git a/solidity/test/unit/modules/response/BondedResponseModule.t.sol b/solidity/test/unit/modules/response/BondedResponseModule.t.sol index 66ee6332..73f95a0f 100644 --- a/solidity/test/unit/modules/response/BondedResponseModule.t.sol +++ b/solidity/test/unit/modules/response/BondedResponseModule.t.sol @@ -236,9 +236,11 @@ contract BondedResponseModule_Unit_FinalizeRequest is BaseTest { address(oracle), abi.encodeCall(IOracle.allowedModule, (_getId(mockRequest), address(this))), abi.encode(false) ); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.responseCreatedAt to be called _mockAndExpect( - address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(_responseCreationBlock) + address(oracle), + abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), + abi.encode(_responseCreationBlock) ); // Check: does it revert if it's too early to finalize? @@ -269,9 +271,9 @@ contract BondedResponseModule_Unit_FinalizeRequest is BaseTest { address(oracle), abi.encodeCall(IOracle.allowedModule, (_getId(mockRequest), address(this))), abi.encode(true) ); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.responseCreatedAt to be called _mockAndExpect( - address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(block.timestamp) + address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(block.timestamp) ); // Mock and expect IAccountingExtension.release to be called @@ -302,8 +304,10 @@ contract BondedResponseModule_Unit_FinalizeRequest is BaseTest { address(oracle), abi.encodeCall(IOracle.allowedModule, (_requestId, address(this))), abi.encode(false) ); - // Mock and expect IOracle.createdAt to be called - _mockAndExpect(address(oracle), abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), abi.encode(block.number)); + // Mock and expect IOracle.responseCreatedAt to be called + _mockAndExpect( + address(oracle), abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(block.number) + ); // Mock and expect IAccountingExtension.release to be called _mockAndExpect( @@ -344,10 +348,10 @@ contract BondedResponseModule_Unit_FinalizeRequest is BaseTest { address(oracle), abi.encodeCall(IOracle.allowedModule, (_requestId, _allowedModule)), abi.encode(true) ); - // Mock and expect IOracle.createdAt to be called + // Mock and expect IOracle.responseCreatedAt to be called _mockAndExpect( address(oracle), - abi.encodeCall(IOracle.createdAt, (_getId(mockResponse))), + abi.encodeCall(IOracle.responseCreatedAt, (_getId(mockResponse))), abi.encode(block.timestamp - _baseDisputeWindow) ); diff --git a/yarn.lock b/yarn.lock index 61343fe7..8ee18c05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -193,10 +193,10 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@defi-wonderland/prophet-core-contracts@0.0.0-ad40b65b": - version "0.0.0-ad40b65b" - resolved "https://registry.yarnpkg.com/@defi-wonderland/prophet-core-contracts/-/prophet-core-contracts-0.0.0-ad40b65b.tgz#948ae61dc947577831c292f7ad2337123250aada" - integrity sha512-Aq7eu3Du+pikOgQS4oGAxt+QfTiP9PohD5qI3k1hJ6/iqpYURb/Ui9BmQ+zCC2Hn6c86J77GFxKpFVNmF1+YSQ== +"@defi-wonderland/prophet-core-contracts@0.0.0-c25103ea": + version "0.0.0-c25103ea" + resolved "https://registry.yarnpkg.com/@defi-wonderland/prophet-core-contracts/-/prophet-core-contracts-0.0.0-c25103ea.tgz#e7a83271251d6ffbe0644c5971e6748d41ae9255" + integrity sha512-VCIeXwutXaih/ZF0JeqBjqkIs1ALWoFmn9OMeM5ZGcRZfx3JSV+axhi4YiIQVfrTLxICyu2hnbIEV7T1OmLVMQ== "@defi-wonderland/solidity-utils@0.0.0-3e9c8e8b": version "0.0.0-3e9c8e8b"