From 56154b409b332f0c4db7240bae3fbd0babfda0da Mon Sep 17 00:00:00 2001 From: moebius <132487952+0xmoebius@users.noreply.github.com> Date: Mon, 11 Dec 2023 10:55:13 -0300 Subject: [PATCH] feat: remove sequential resolution module (#28) --- docs/src/content/intro/README.md | 36 +- docs/src/content/modules/resolution.md | 2 +- .../resolution/SequentialResolutionModule.sol | 287 ------- .../ISequentialResolutionModule.sol | 116 --- solidity/scripts/Deploy.sol | 7 - .../unit/extensions/AccountingExtension.t.sol | 18 +- .../modules/dispute/BondedDisputeModule.t.sol | 4 +- .../dispute/CircuitResolverModule.t.sol | 2 +- .../dispute/RootVerificationModule.t.sol | 2 +- .../modules/finality/CallbackModule.t.sol | 2 +- .../request/ContractCallRequestModule.t.sol | 2 +- .../modules/request/HttpRequestModule.t.sol | 2 +- .../SparseMerkleTreeRequestModule.t.sol | 2 +- .../modules/resolution/ArbitratorModule.t.sol | 8 +- .../SequentialResolutionModule.t.sol | 760 ------------------ .../response/BondedResponseModule.t.sol | 4 +- 16 files changed, 43 insertions(+), 1211 deletions(-) delete mode 100644 solidity/contracts/modules/resolution/SequentialResolutionModule.sol delete mode 100644 solidity/interfaces/modules/resolution/ISequentialResolutionModule.sol delete mode 100644 solidity/test/unit/modules/resolution/SequentialResolutionModule.t.sol diff --git a/docs/src/content/intro/README.md b/docs/src/content/intro/README.md index f859d9fb..43ff8c5e 100644 --- a/docs/src/content/intro/README.md +++ b/docs/src/content/intro/README.md @@ -3,6 +3,7 @@ Prophet presents a versatile and fully adaptable optimistic oracle solution, transcending the boundaries of conventional dispute resolution modules. With its emphasis on complete control and modularity across all aspects of the system, Prophet is an open-source public good for the Optimism community. ## Useful links + - [Explorer](https://prophet.tech/) - [Discord](https://discord.gg/hhvA9CuQRR) - [Documentation](https://docs.prophet.tech) @@ -10,6 +11,7 @@ Prophet presents a versatile and fully adaptable optimistic oracle solution, tra - [Dune Dashboard](https://dune.com/defi_wonderland/prophet-metrics) ### Repositories + - [Core Contracts](https://github.com/defi-wonderland/prophet-core) - [Modules](https://github.com/defi-wonderland/prophet-modules) - [Explorer](https://github.com/defi-wonderland/prophet-app) @@ -17,26 +19,26 @@ Prophet presents a versatile and fully adaptable optimistic oracle solution, tra - [SDK](https://github.com/defi-wonderland/prophet-sdk) ## Deployments + The addresses of the contracts deployed on Optimism Goerli are listed below. -| Contract | Goerli | -| -------- | ------ | -| [Oracle](/solidity/interfaces/core/IOracle.sol/interface.IOracle.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [AccountingExtension](/solidity/interfaces/extensions/IAccountingExtension.sol/interface.IAccountingExtension.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [BondEscalationAccounting](/solidity/interfaces/extensions/IBondEscalationAccounting.sol/interface.IBondEscalationAccounting.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [HttpRequestModule](/solidity/interfaces/modules/request/IHttpRequestModule.sol/interface.IHttpRequestModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [ContractCallRequestModule](/solidity/interfaces/modules/request/IContractCallRequestModule.sol/interface.IContractCallRequestModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [SparseMerkleTreeRequestModule](/solidity/interfaces/modules/request/ISparseMerkleTreeRequestModule.sol/interface.ISparseMerkleTreeRequestModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [BondedResponseModule](/solidity/interfaces/modules/response/IBondedResponseModule.sol/interface.IBondedResponseModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [BondedDisputeModule](/solidity/interfaces/modules/dispute/IBondedDisputeModule.sol/interface.IBondedDisputeModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [BondEscalationModule](/solidity/interfaces/modules/dispute/IBondEscalationModule.sol/interface.IBondEscalationModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [CircuitResolverModule](/solidity/interfaces/modules/dispute/ICircuitResolverModule.sol/interface.ICircuitResolverModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [RootVerificationModule](/solidity/interfaces/modules/dispute/IRootVerificationModule.sol/interface.IRootVerificationModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [ArbitratorModule](/solidity/interfaces/modules/resolution/IArbitratorModule.sol/interface.IArbitratorModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| Contract | Goerli | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| [Oracle](/solidity/interfaces/core/IOracle.sol/interface.IOracle.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [AccountingExtension](/solidity/interfaces/extensions/IAccountingExtension.sol/interface.IAccountingExtension.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [BondEscalationAccounting](/solidity/interfaces/extensions/IBondEscalationAccounting.sol/interface.IBondEscalationAccounting.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [HttpRequestModule](/solidity/interfaces/modules/request/IHttpRequestModule.sol/interface.IHttpRequestModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [ContractCallRequestModule](/solidity/interfaces/modules/request/IContractCallRequestModule.sol/interface.IContractCallRequestModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [SparseMerkleTreeRequestModule](/solidity/interfaces/modules/request/ISparseMerkleTreeRequestModule.sol/interface.ISparseMerkleTreeRequestModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [BondedResponseModule](/solidity/interfaces/modules/response/IBondedResponseModule.sol/interface.IBondedResponseModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [BondedDisputeModule](/solidity/interfaces/modules/dispute/IBondedDisputeModule.sol/interface.IBondedDisputeModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [BondEscalationModule](/solidity/interfaces/modules/dispute/IBondEscalationModule.sol/interface.IBondEscalationModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [CircuitResolverModule](/solidity/interfaces/modules/dispute/ICircuitResolverModule.sol/interface.ICircuitResolverModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [RootVerificationModule](/solidity/interfaces/modules/dispute/IRootVerificationModule.sol/interface.IRootVerificationModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [ArbitratorModule](/solidity/interfaces/modules/resolution/IArbitratorModule.sol/interface.IArbitratorModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | | [BondEscalationResolutionModule](/solidity/interfaces/modules/resolution/IBondEscalationResolutionModule.sol/interface.IBondEscalationResolutionModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [ERC20ResolutionModule](/solidity/interfaces/modules/resolution/IERC20ResolutionModule.sol/interface.IERC20ResolutionModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | -| [PrivateERC20ResolutionModule](/solidity/interfaces/modules/resolution/IPrivateERC20ResolutionModule.sol/interface.IPrivateERC20ResolutionModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | - +| [ERC20ResolutionModule](/solidity/interfaces/modules/resolution/IERC20ResolutionModule.sol/interface.IERC20ResolutionModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | +| [PrivateERC20ResolutionModule](/solidity/interfaces/modules/resolution/IPrivateERC20ResolutionModule.sol/interface.IPrivateERC20ResolutionModule.md) | [`0x0000000000000000000000000000000000000000`](https://goerli-optimism.etherscan.io/address/0x0000000000000000000000000000000000000000) | ## Licensing diff --git a/docs/src/content/modules/resolution.md b/docs/src/content/modules/resolution.md index 9b7b1918..773329bb 100644 --- a/docs/src/content/modules/resolution.md +++ b/docs/src/content/modules/resolution.md @@ -5,10 +5,10 @@ The Resolution module is responsible for providing an answer to a dispute. It is the last step of the dispute resolution process. Because of the vast amount of resolution methods, there is no general guideline for creating a Resolution module but keep in mind that some disputes cannot be resolved, in which case the Resolution module should probably refund all involved parties. In Prophet, examples of Resolution modules include: + - [ArbitratorModule](./resolution/arbitrator_module.md) that uses an external arbitrator contract to resolve disputes. - [ERC20ResolutionModule](./resolution/erc20_resolution_module.md) that resolves disputes based on a voting process using ERC20 tokens. - [PrivateERC20ResolutionModule](./resolution/private_erc20_resolution_module.md) that allows users to vote on a dispute using ERC20 tokens following a commit/reveal pattern. - [BondEscalationResolutionModule](./resolution/bond_escalation_resolution_module.md) that follows a bond escalation-like process to resolve disputes. -- [SequentialResolutionModule](./resolution/sequential_resolution_module.md) that leverages multiple resolution modules to obtain an answer. They all follow the [IResolutionModule](/solidity/interfaces/core/modules/resolution/IResolutionModule.sol/interface.IResolutionModule.md) interface. diff --git a/solidity/contracts/modules/resolution/SequentialResolutionModule.sol b/solidity/contracts/modules/resolution/SequentialResolutionModule.sol deleted file mode 100644 index e918c5df..00000000 --- a/solidity/contracts/modules/resolution/SequentialResolutionModule.sol +++ /dev/null @@ -1,287 +0,0 @@ -// // SPDX-License-Identifier: MIT -// pragma solidity ^0.8.19; - -// // solhint-disable-next-line no-unused-import -// import {Module, IModule} from '@defi-wonderland/prophet-core-contracts/solidity/contracts/Module.sol'; -// import {IOracle} from '@defi-wonderland/prophet-core-contracts/solidity/interfaces/IOracle.sol'; -// import {EnumerableSet} from '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; - -// import { -// ISequentialResolutionModule, -// IResolutionModule -// } from '../../../interfaces/modules/resolution/ISequentialResolutionModule.sol'; - -// /** -// * @notice Module that leverages multiple resolution modules to obtain an answer -// * @dev The next resolution is started if the current resolution module returns no answer -// */ -// contract SequentialResolutionModule is Module, ISequentialResolutionModule { -// using EnumerableSet for EnumerableSet.AddressSet; - -// /// @inheritdoc ISequentialResolutionModule -// mapping(bytes32 _disputeId => uint256 _moduleIndex) public currentModuleIndex; - -// /// @inheritdoc ISequentialResolutionModule -// mapping(bytes32 _disputeId => bytes32 _requestId) public requestIdForDispute; - -// /// @inheritdoc ISequentialResolutionModule -// uint256 public currentSequenceId; - -// /** -// * @notice Maps the sequenceId to the array of modules to use -// */ -// mapping(uint256 _sequenceId => EnumerableSet.AddressSet _modules) internal _resolutionModules; - -// constructor(IOracle _oracle) Module(_oracle) {} - -// /** -// * @notice Checks that the caller is a valid sub-module -// */ -// modifier onlySubmodule(bytes32 _requestId) { -// if (!_resolutionModules[_getSequenceId(_requestId)].contains(msg.sender)) { -// revert SequentialResolutionModule_OnlySubmodule(); -// } -// _; -// } - -// /// @inheritdoc ISequentialResolutionModule -// function addResolutionModuleSequence(IResolutionModule[] memory _modules) external returns (uint256 _sequenceId) { -// _sequenceId = ++currentSequenceId; -// EnumerableSet.AddressSet storage _setModules = _resolutionModules[_sequenceId]; -// for (uint256 _i; _i < _modules.length; ++_i) { -// _setModules.add(address(_modules[_i])); -// } -// emit ResolutionSequenceAdded(_sequenceId, _modules); -// } - -// /// @inheritdoc ISequentialResolutionModule -// function getCurrentResolutionModule(bytes32 _disputeId) public view returns (IResolutionModule _module) { -// uint256 _currentIndex = currentModuleIndex[_disputeId]; -// EnumerableSet.AddressSet storage _modules = _resolutionModules[_getSequenceId(requestIdForDispute[_disputeId])]; -// _module = IResolutionModule(_modules.at(_currentIndex)); -// } - -// /// @inheritdoc ISequentialResolutionModule -// function listSubmodules( -// uint256 _startFrom, -// uint256 _batchSize, -// uint256 _sequenceId -// ) external view returns (IResolutionModule[] memory _list) { -// EnumerableSet.AddressSet storage _modules = _resolutionModules[_sequenceId]; -// uint256 _length = _modules.length(); -// uint256 _count = (_batchSize > _length - _startFrom) ? _length - _startFrom : _batchSize; -// _list = new IResolutionModule[](_count); -// for (uint256 _i; _i < _count; ++_i) { -// _list[_i] = IResolutionModule(_modules.at(_startFrom + _i)); -// } -// } - -// /// @inheritdoc IModule -// function moduleName() external pure returns (string memory _moduleName) { -// return 'SequentialResolutionModule'; -// } - -// /// @inheritdoc ISequentialResolutionModule -// function decodeRequestData(bytes32 _requestId) public view returns (RequestParameters memory _params) { -// _params = abi.decode(requestData[_requestId], (RequestParameters)); -// } - -// /// @inheritdoc IModule -// function finalizeRequest( -// bytes32 _requestId, -// address _finalizer -// ) external virtual override(Module, IModule) onlyOracle { -// EnumerableSet.AddressSet storage _modules = _resolutionModules[_getSequenceId(_requestId)]; -// for (uint256 _i; _i < _modules.length(); ++_i) { -// IResolutionModule(_modules.at(_i)).finalizeRequest(_requestId, _finalizer); -// } -// } - -// /// @inheritdoc IOracle -// function updateDisputeStatus( -// bytes32 _disputeId, -// DisputeStatus _status -// ) external onlySubmodule(requestIdForDispute[_disputeId]) { -// bytes32 _requestId = requestIdForDispute[_disputeId]; -// uint256 _nextModuleIndex = currentModuleIndex[_disputeId] + 1; -// EnumerableSet.AddressSet storage _modules = _resolutionModules[_getSequenceId(_requestId)]; -// if (_status == DisputeStatus.NoResolution && _nextModuleIndex < _modules.length()) { -// currentModuleIndex[_disputeId] = _nextModuleIndex; -// IResolutionModule(_modules.at(_nextModuleIndex)).startResolution(_disputeId); -// } else { -// ORACLE.updateDisputeStatus(_disputeId, _status); -// } -// } - -// /// @inheritdoc IResolutionModule -// function startResolution(bytes32 _disputeId) external onlyOracle { -// bytes32 _requestIdForDispute = ORACLE.getDispute(_disputeId).requestId; -// requestIdForDispute[_disputeId] = _requestIdForDispute; - -// EnumerableSet.AddressSet storage _modules = _resolutionModules[_getSequenceId(_requestIdForDispute)]; -// IResolutionModule(_modules.at(0)).startResolution(_disputeId); -// } - -// /// @inheritdoc IResolutionModule -// function resolveDispute(bytes32 _disputeId) external onlyOracle { -// getCurrentResolutionModule(_disputeId).resolveDispute(_disputeId); -// } - -// /// @inheritdoc Module -// function _afterSetupRequest(bytes32 _requestId, bytes calldata _data) internal override { -// RequestParameters memory _params = _decodeData(_data); -// EnumerableSet.AddressSet storage _modules = _resolutionModules[_params.sequenceId]; -// for (uint256 _i; _i < _modules.length(); ++_i) { -// IResolutionModule(_modules.at(_i)).setupRequest(_requestId, _params.submoduleData[_i]); -// } -// } - -// /** -// * @notice Decodes the data received -// * @param _data The data received -// * @return _params The parameters of the request -// */ -// function _decodeData(bytes memory _data) internal pure returns (RequestParameters memory _params) { -// _params = abi.decode(_data, (RequestParameters)); -// } - -// /** -// * @notice Returns the sequenceId for a particular requestId -// * @param _requestId The requestId to the sequenceId -// * @return _sequenceId The sequenceId -// */ -// function _getSequenceId(bytes32 _requestId) internal view returns (uint256 _sequenceId) { -// bytes memory _data = requestData[_requestId]; -// RequestParameters memory _params = _decodeData(_data); -// _sequenceId = _params.sequenceId; -// } - -// // ============ ORACLE Proxy ============= - -// /// @inheritdoc IOracle -// function allowedModule(bytes32 _requestId, address _module) external view returns (bool _allowedModule) { -// _allowedModule = ORACLE.allowedModule(_requestId, _module); -// } - -// /// @inheritdoc IOracle -// function isParticipant(bytes32 _requestId, address _user) external view returns (bool _isParticipant) { -// _isParticipant = ORACLE.isParticipant(_requestId, _user); -// } - -// /// @inheritdoc IOracle -// function getDispute(bytes32 _disputeId) external view returns (IOracle.Dispute memory _dispute) { -// _dispute = ORACLE.getDispute(_disputeId); -// } - -// /// @inheritdoc IOracle -// function getResponse(bytes32 _responseId) external view returns (IOracle.Response memory _response) { -// _response = ORACLE.getResponse(_responseId); -// } - -// /// @inheritdoc IOracle -// function getRequestId(uint256 _nonce) external view returns (bytes32 _requestId) { -// _requestId = ORACLE.getRequestId(_nonce); -// } - -// /// @inheritdoc IOracle -// function getRequestByNonce(uint256 _nonce) external view returns (Request memory _request) { -// _request = ORACLE.getRequestByNonce(_nonce); -// } - -// /// @inheritdoc IOracle -// function getRequest(bytes32 _requestId) external view returns (IOracle.Request memory _request) { -// _request = ORACLE.getRequest(_requestId); -// } - -// /// @inheritdoc IOracle -// function getFullRequest(bytes32 _requestId) external view returns (IOracle.FullRequest memory _request) { -// _request = ORACLE.getFullRequest(_requestId); -// } - -// /// @inheritdoc IOracle -// function disputeOf(bytes32 _requestId) external view returns (bytes32 _disputeId) { -// _disputeId = ORACLE.disputeOf(_requestId); -// } - -// /// @inheritdoc IOracle -// function getFinalizedResponseId(bytes32 _requestId) external view returns (bytes32 _finalizedResponseId) { -// _finalizedResponseId = ORACLE.getFinalizedResponseId(_requestId); -// } - -// /// @inheritdoc IOracle -// function getFinalizedResponse(bytes32 _requestId) external view returns (IOracle.Response memory _response) { -// _response = ORACLE.getFinalizedResponse(_requestId); -// } - -// /// @inheritdoc IOracle -// function getResponseIds(bytes32 _requestId) external view returns (bytes32[] memory _ids) { -// _ids = ORACLE.getResponseIds(_requestId); -// } - -// /// @inheritdoc IOracle -// function listRequests(uint256 _startFrom, uint256 _amount) external view returns (IOracle.FullRequest[] memory _list) { -// _list = ORACLE.listRequests(_startFrom, _amount); -// } - -// /// @inheritdoc IOracle -// function listRequestIds(uint256 _startFrom, uint256 _batchSize) external view returns (bytes32[] memory _list) { -// _list = ORACLE.listRequestIds(_startFrom, _batchSize); -// } - -// /// @inheritdoc IOracle -// function finalize(bytes32 _requestId, bytes32 _finalizedResponseId) external onlySubmodule(_requestId) { -// ORACLE.finalize(_requestId, _finalizedResponseId); -// } - -// /// @inheritdoc IOracle -// function finalize(bytes32 _requestId) external onlySubmodule(_requestId) { -// ORACLE.finalize(_requestId); -// } - -// /// @inheritdoc IOracle -// function escalateDispute(bytes32 _disputeId) external onlySubmodule(requestIdForDispute[_disputeId]) { -// ORACLE.escalateDispute(_disputeId); -// } - -// /// @inheritdoc IOracle -// function totalRequestCount() external view returns (uint256 _count) { -// _count = ORACLE.totalRequestCount(); -// } - -// // ============ ORACLE Proxy not implemented ============= - -// // solhint-disable defi-wonderland/named-return-values - -// // This functions use msg.sender in the oracle implementation and cannot be called from a the sequential resolution module -// /// @inheritdoc IOracle -// function createRequest(IOracle.NewRequest memory) external pure returns (bytes32) { -// revert SequentialResolutionModule_NotImplemented(); -// } - -// /// @inheritdoc IOracle -// function createRequests(IOracle.NewRequest[] calldata) external pure returns (bytes32[] memory) { -// revert SequentialResolutionModule_NotImplemented(); -// } - -// /// @inheritdoc IOracle -// function disputeResponse(bytes32, bytes32) external pure returns (bytes32) { -// revert SequentialResolutionModule_NotImplemented(); -// } - -// /// @inheritdoc IOracle -// function proposeResponse(bytes32, bytes calldata) external pure returns (bytes32) { -// revert SequentialResolutionModule_NotImplemented(); -// } - -// /// @inheritdoc IOracle -// function proposeResponse(address, bytes32, bytes calldata) external pure returns (bytes32) { -// revert SequentialResolutionModule_NotImplemented(); -// } - -// /// @inheritdoc IOracle -// function deleteResponse(bytes32) external pure { -// revert SequentialResolutionModule_NotImplemented(); -// } - -// // solhint-enable defi-wonderland/named-return-values -// } diff --git a/solidity/interfaces/modules/resolution/ISequentialResolutionModule.sol b/solidity/interfaces/modules/resolution/ISequentialResolutionModule.sol deleted file mode 100644 index 8a7fc2db..00000000 --- a/solidity/interfaces/modules/resolution/ISequentialResolutionModule.sol +++ /dev/null @@ -1,116 +0,0 @@ -// // SPDX-License-Identifier: MIT -// pragma solidity ^0.8.19; - -// import {IOracle} from '@defi-wonderland/prophet-core-contracts/solidity/interfaces/IOracle.sol'; -// import {IResolutionModule} from -// '@defi-wonderland/prophet-core-contracts/solidity/interfaces/modules/resolution/IResolutionModule.sol'; - -// interface ISequentialResolutionModule is IOracle, IResolutionModule { -// /*/////////////////////////////////////////////////////////////// -// EVENTS -// //////////////////////////////////////////////////////////////*/ - -// /** -// * @notice Emitted when a new resolution sequence is added -// */ -// event ResolutionSequenceAdded(uint256 _sequenceId, IResolutionModule[] _modules); - -// /*/////////////////////////////////////////////////////////////// -// ERRORS -// //////////////////////////////////////////////////////////////*/ -// /** -// * @notice Thrown when the caller is not a valid sub-module -// */ -// error SequentialResolutionModule_OnlySubmodule(); - -// /** -// * @notice Thrown when the function called is not implemented -// */ -// error SequentialResolutionModule_NotImplemented(); - -// /** -// * @notice Thrown when trying to add a new sequenceId that was already used -// * @param _sequenceId The sequenceId that was already used -// */ -// error SequentialResolutionModule_SequenceIdAlreadyUsed(uint256 _sequenceId); - -// /*/////////////////////////////////////////////////////////////// -// STRUCTS -// //////////////////////////////////////////////////////////////*/ -// /** -// * @notice Parameters of the request as stored in the module -// * @param sequenceId The sequence ID to use in the request. -// * @param submoduleData The array of data to pass to the submodules -// */ -// struct RequestParameters { -// uint256 sequenceId; -// bytes[] submoduleData; -// } - -// /*/////////////////////////////////////////////////////////////// -// VARIABLES -// //////////////////////////////////////////////////////////////*/ - -// /** -// * @notice Returns the last sequence id that was created -// * @return _currentSequenceId The sequence id -// */ -// function currentSequenceId() external view returns (uint256 _currentSequenceId); - -// /** -// * @notice Returns the current index of the submodule in use for a dispute -// * @param _disputeId The disputeId -// * @return _moduleIndex The index of the module -// */ -// function currentModuleIndex(bytes32 _disputeId) external view returns (uint256 _moduleIndex); - -// /** -// * @notice Returns the requestId corresponding to a dispute -// * @param _disputeId The disputeId -// * @return _requestId The requestId -// */ -// function requestIdForDispute(bytes32 _disputeId) external view returns (bytes32 _requestId); - -// /** -// * @notice Returns the decoded data for a request -// * @param _requestId The ID of the request -// * @return _params The struct containing the parameters for the request -// */ -// function decodeRequestData(bytes32 _requestId) external view returns (RequestParameters memory _params); - -// /*/////////////////////////////////////////////////////////////// -// FUNCTIONS -// //////////////////////////////////////////////////////////////*/ -// /** -// * @notice Returns the list of submodules -// * @param _startFrom The index to start from -// * @param _batchSize The number of submodules to return -// * @param _sequenceId The sequence to get the submodules from -// * @return _list The list of submodules -// */ -// function listSubmodules( -// uint256 _startFrom, -// uint256 _batchSize, -// uint256 _sequenceId -// ) external view returns (IResolutionModule[] memory _list); - -// /** -// * @notice Adds a sequence of modules to the resolution module registry. -// * @param _modules The modules to add to the sequence. -// * @return _sequenceId The sequenceId created -// */ -// function addResolutionModuleSequence(IResolutionModule[] memory _modules) external returns (uint256 _sequenceId); - -// /** -// * @notice Returns the module that is currently resolving the specified dispute -// * @param _disputeId The id of the dispute -// * @return _module Te current resolution module -// */ -// function getCurrentResolutionModule(bytes32 _disputeId) external returns (IResolutionModule _module); - -// /** -// * @notice Resolves a dispute -// * @param _disputeId The id of the dispute to resolve -// */ -// function resolveDispute(bytes32 _disputeId) external override(IOracle, IResolutionModule); -// } diff --git a/solidity/scripts/Deploy.sol b/solidity/scripts/Deploy.sol index 0610e161..920bbe63 100644 --- a/solidity/scripts/Deploy.sol +++ b/solidity/scripts/Deploy.sol @@ -18,7 +18,6 @@ // import {MultipleCallbacksModule} from '../contracts/modules/finality/MultipleCallbacksModule.sol'; // import {PrivateERC20ResolutionModule} from '../contracts/modules/resolution/PrivateERC20ResolutionModule.sol'; // import {BondEscalationResolutionModule} from '../contracts/modules/resolution/BondEscalationResolutionModule.sol'; -// import {SequentialResolutionModule} from '../contracts/modules/resolution/SequentialResolutionModule.sol'; // import {RootVerificationModule} from '../contracts/modules/dispute/RootVerificationModule.sol'; // import {SparseMerkleTreeRequestModule} from '../contracts/modules/request/SparseMerkleTreeRequestModule.sol'; // import {CircuitResolverModule} from '../contracts/modules/dispute/CircuitResolverModule.sol'; @@ -42,7 +41,6 @@ // PrivateERC20ResolutionModule privateErc20ResolutionModule; // BondEscalationResolutionModule bondEscalationResolutionModule; -// SequentialResolutionModule sequentialResolutionModule; // RootVerificationModule rootVerificationModule; // SparseMerkleTreeRequestModule sparseMerkleTreeRequestModule; // CircuitResolverModule circuitResolverModule; @@ -123,11 +121,6 @@ // bondEscalationAccounting = new BondEscalationAccounting(oracle); // console.log('BOND_ESCALATION_ACCOUNTING_EXTENSION:', address(bondEscalationAccounting)); -// // Deploy multiple callbacks module -// sequentialResolutionModule = new SequentialResolutionModule(oracle); -// console.log('SEQUENTIAL_RESOLUTION_MODULE:', address(sequentialResolutionModule)); -// sequentialResolutionModule.addResolutionModuleSequence(resolutionModules); - // // Deploy circuit resolver module // circuitResolverModule = new CircuitResolverModule(oracle); // console.log('CIRCUIT_RESOLVER_MODULE:', address(circuitResolverModule)); diff --git a/solidity/test/unit/extensions/AccountingExtension.t.sol b/solidity/test/unit/extensions/AccountingExtension.t.sol index dcffcd86..c342a343 100644 --- a/solidity/test/unit/extensions/AccountingExtension.t.sol +++ b/solidity/test/unit/extensions/AccountingExtension.t.sol @@ -116,7 +116,7 @@ contract AccountingExtension_Unit_DepositAndWithdraw is BaseTest { extension.forTest_setBalanceOf(sender, token, _initialBalance); // Check: does it revert if balance is insufficient? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_InsufficientFunds.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_InsufficientFunds.selector); vm.prank(sender); extension.withdraw(token, _amount); } @@ -186,7 +186,7 @@ contract AccountingExtension_Unit_Bond is BaseTest { extension.forTest_setBalanceOf(_bonder, token, _initialBalance); // Check: does it revert if balance is insufficient? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_InsufficientFunds.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_InsufficientFunds.selector); vm.prank(_sender); extension.bond({_bonder: _bonder, _requestId: _requestId, _token: token, _amount: _amount}); @@ -205,7 +205,7 @@ contract AccountingExtension_Unit_Bond is BaseTest { _mockAndExpect(address(oracle), abi.encodeCall(IOracle.allowedModule, (_requestId, _sender)), abi.encode(false)); // Check: does it revert if the module is not allowed? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_UnauthorizedModule.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_UnauthorizedModule.selector); vm.prank(_sender); extension.bond({_bonder: _bonder, _requestId: _requestId, _token: token, _amount: _amount}); @@ -227,7 +227,7 @@ contract AccountingExtension_Unit_Bond is BaseTest { _mockAndExpect(address(oracle), abi.encodeCall(IOracle.isParticipant, (_requestId, _bonder)), abi.encode(true)); // Check: does it revert if the module is not approved? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_InsufficientAllowance.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_InsufficientAllowance.selector); vm.prank(_module); extension.bond({_bonder: _bonder, _requestId: _requestId, _token: token, _amount: _amount}); @@ -249,7 +249,7 @@ contract AccountingExtension_Unit_Bond is BaseTest { _mockAndExpect(address(oracle), abi.encodeCall(IOracle.isParticipant, (_requestId, _bonder)), abi.encode(true)); // Check: does it revert if the caller is not approved? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_InsufficientAllowance.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_InsufficientAllowance.selector); vm.prank(_sender); extension.bond({_bonder: _bonder, _requestId: _requestId, _token: token, _amount: _amount, _sender: _sender}); @@ -322,7 +322,7 @@ contract AccountingExtension_Unit_Pay is BaseTest { extension.forTest_setBondedBalanceOf(_requestId, _payer, token, _initialBalance); // Check: does it revert if the payer has insufficient funds? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_InsufficientFunds.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_InsufficientFunds.selector); vm.prank(_sender); extension.pay({_requestId: _requestId, _payer: _payer, _receiver: _receiver, _token: token, _amount: _amount}); @@ -345,7 +345,7 @@ contract AccountingExtension_Unit_Pay is BaseTest { _mockAndExpect(address(oracle), abi.encodeCall(IOracle.allowedModule, (_requestId, _sender)), abi.encode(false)); // Check: does it revert if the module calling is not approved? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_UnauthorizedModule.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_UnauthorizedModule.selector); vm.prank(_sender); extension.pay({_requestId: _requestId, _payer: _payer, _receiver: _receiver, _token: token, _amount: _amount}); @@ -410,7 +410,7 @@ contract AccountingExtension_Unit_Release is BaseTest { extension.forTest_setBondedBalanceOf(_requestId, _bonder, token, _initialBalance); // Check: does it revert if calling with insufficient balance? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_InsufficientFunds.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_InsufficientFunds.selector); vm.prank(_sender); extension.release({_bonder: _bonder, _requestId: _requestId, _token: token, _amount: _amount}); @@ -429,7 +429,7 @@ contract AccountingExtension_Unit_Release is BaseTest { _mockAndExpect(address(oracle), abi.encodeCall(IOracle.allowedModule, (_requestId, _sender)), abi.encode(false)); // Check: does it revert if the module is not approved? - vm.expectRevert(abi.encodeWithSelector(IAccountingExtension.AccountingExtension_UnauthorizedModule.selector)); + vm.expectRevert(IAccountingExtension.AccountingExtension_UnauthorizedModule.selector); vm.prank(_sender); extension.release({_bonder: _bonder, _requestId: _requestId, _token: token, _amount: _amount}); diff --git a/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol b/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol index cb93edb1..67868623 100644 --- a/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol +++ b/solidity/test/unit/modules/dispute/BondedDisputeModule.t.sol @@ -207,7 +207,7 @@ contract BondedResponseModule_Unit_OnDisputeStatusChange is BaseTest { vm.assume(_randomCaller != address(oracle)); // Check: revert if wrong caller - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); // Test: call disputeResponse from non-oracle address vm.prank(_randomCaller); @@ -247,7 +247,7 @@ contract BondedResponseModule_Unit_DisputeResponse is BaseTest { vm.assume(_randomCaller != address(oracle)); // Check: revert if wrong caller - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); // Test: call disputeResponse from non-oracle address vm.prank(_randomCaller); diff --git a/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol b/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol index a7b77377..2a9ff440 100644 --- a/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol +++ b/solidity/test/unit/modules/dispute/CircuitResolverModule.t.sol @@ -246,7 +246,7 @@ contract CircuitResolverModule_Unit_DisputeResponse is BaseTest { vm.assume(_randomCaller != address(oracle)); // Check: does it revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(_randomCaller); circuitResolverModule.disputeResponse(mockRequest, mockResponse, mockDispute); diff --git a/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol b/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol index 7959bd10..b38234e5 100644 --- a/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol +++ b/solidity/test/unit/modules/dispute/RootVerificationModule.t.sol @@ -296,7 +296,7 @@ contract RootVerificationModule_Unit_DisputeResponse is BaseTest { vm.assume(_randomCaller != address(oracle)); // Check: revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(_randomCaller); rootVerificationModule.disputeResponse(mockRequest, mockResponse, mockDispute); diff --git a/solidity/test/unit/modules/finality/CallbackModule.t.sol b/solidity/test/unit/modules/finality/CallbackModule.t.sol index 6cbf2076..e66ca402 100644 --- a/solidity/test/unit/modules/finality/CallbackModule.t.sol +++ b/solidity/test/unit/modules/finality/CallbackModule.t.sol @@ -105,7 +105,7 @@ contract CallbackModule_Unit_FinalizeRequest is BaseTest { mockResponse.requestId = _getId(mockRequest); // Check: does it revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(_caller); callbackModule.finalizeRequest(mockRequest, mockResponse, _caller); diff --git a/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol b/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol index fa3e3ebe..7d3ab8ad 100644 --- a/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol +++ b/solidity/test/unit/modules/request/ContractCallRequestModule.t.sol @@ -200,7 +200,7 @@ contract ContractCallRequestModule_Unit_FinalizeRequest is BaseTest { vm.assume(_caller != address(oracle)); // Check: does it revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(_caller); contractCallRequestModule.finalizeRequest(_request, mockResponse, address(_caller)); diff --git a/solidity/test/unit/modules/request/HttpRequestModule.t.sol b/solidity/test/unit/modules/request/HttpRequestModule.t.sol index a7baf406..40b32fe2 100644 --- a/solidity/test/unit/modules/request/HttpRequestModule.t.sol +++ b/solidity/test/unit/modules/request/HttpRequestModule.t.sol @@ -205,7 +205,7 @@ contract HttpRequestModule_Unit_FinalizeRequest is BaseTest { vm.assume(_caller != address(oracle)); // Check: does it revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(_caller); httpRequestModule.finalizeRequest(mockRequest, mockResponse, address(_caller)); diff --git a/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol b/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol index f9067ac0..17ec424e 100644 --- a/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol +++ b/solidity/test/unit/modules/request/SparseMerkleTreeRequestModule.t.sol @@ -223,7 +223,7 @@ contract SparseMerkleTreeRequestModule_Unit_FinalizeRequest is BaseTest { vm.assume(_caller != address(oracle)); // Check: does it revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(_caller); sparseMerkleTreeRequestModule.finalizeRequest(mockRequest, mockResponse, address(_caller)); diff --git a/solidity/test/unit/modules/resolution/ArbitratorModule.t.sol b/solidity/test/unit/modules/resolution/ArbitratorModule.t.sol index e431a59c..917fe04b 100644 --- a/solidity/test/unit/modules/resolution/ArbitratorModule.t.sol +++ b/solidity/test/unit/modules/resolution/ArbitratorModule.t.sol @@ -139,7 +139,7 @@ contract ArbitratorModule_Unit_StartResolution is BaseTest { vm.assume(_caller != address(oracle)); // Check: does it revert if the caller is not the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(_caller); arbitratorModule.startResolution(_getId(mockDispute), mockRequest, mockResponse, mockDispute); @@ -152,7 +152,7 @@ contract ArbitratorModule_Unit_StartResolution is BaseTest { mockDispute.requestId = _requestId; // Check: revert? - vm.expectRevert(abi.encodeWithSelector(IArbitratorModule.ArbitratorModule_InvalidArbitrator.selector)); + vm.expectRevert(IArbitratorModule.ArbitratorModule_InvalidArbitrator.selector); // Test: escalate the dispute vm.prank(address(oracle)); @@ -215,7 +215,7 @@ contract ArbitratorModule_Unit_ResolveDispute is BaseTest { ); // Check: does it revert if the resolution status is invalid? - vm.expectRevert(abi.encodeWithSelector(IArbitratorModule.ArbitratorModule_InvalidResolutionStatus.selector)); + vm.expectRevert(IArbitratorModule.ArbitratorModule_InvalidResolutionStatus.selector); vm.prank(address(oracle)); arbitratorModule.resolveDispute(_disputeId, mockRequest, mockResponse, mockDispute); @@ -268,7 +268,7 @@ contract ArbitratorModule_Unit_ResolveDispute is BaseTest { address(oracle), abi.encodeCall(oracle.disputeStatus, (_disputeId)), abi.encode(IOracle.DisputeStatus(_status)) ); - vm.expectRevert(abi.encodeWithSelector(IArbitratorModule.ArbitratorModule_InvalidDisputeId.selector)); + vm.expectRevert(IArbitratorModule.ArbitratorModule_InvalidDisputeId.selector); vm.prank(address(oracle)); arbitratorModule.resolveDispute(_disputeId, _request, mockResponse, mockDispute); diff --git a/solidity/test/unit/modules/resolution/SequentialResolutionModule.t.sol b/solidity/test/unit/modules/resolution/SequentialResolutionModule.t.sol deleted file mode 100644 index e46f5d55..00000000 --- a/solidity/test/unit/modules/resolution/SequentialResolutionModule.t.sol +++ /dev/null @@ -1,760 +0,0 @@ -// // SPDX-License-Identifier: AGPL-3.0-only -// pragma solidity ^0.8.19; - -// import 'forge-std/Test.sol'; - -// import {Helpers} from '../../../utils/Helpers.sol'; - -// import {IOracle} from '@defi-wonderland/prophet-core-contracts/solidity/interfaces/IOracle.sol'; -// import {Module, IModule} from '@defi-wonderland/prophet-core-contracts/solidity/contracts/Module.sol'; - -// import { -// SequentialResolutionModule, -// IResolutionModule, -// ISequentialResolutionModule -// } from '../../../../contracts/modules/resolution/SequentialResolutionModule.sol'; - -// contract ForTest_ResolutionModule is Module { -// string public name; -// IOracle.DisputeStatus internal _responseStatus; - -// constructor(IOracle _oracle, string memory _name) payable Module(_oracle) { -// name = _name; -// } - -// function resolveDispute(bytes32 _disputeId) external { -// ORACLE.updateDisputeStatus(_disputeId, _responseStatus); -// } - -// function startResolution(bytes32 _disputeId) external {} - -// function moduleName() external view returns (string memory _moduleName) { -// return name; -// } - -// function forTest_setResponseStatus(IOracle.DisputeStatus _status) external { -// _responseStatus = _status; -// } -// } - -// contract BaseTest is Test, Helpers { -// SequentialResolutionModule public module; -// IOracle public oracle; -// bytes32 public disputeId = bytes32(uint256(1)); -// bytes32 public responseId = bytes32(uint256(2)); -// bytes32 public requestId = bytes32(uint256(3)); - -// bytes32 public disputeId2 = bytes32(uint256(4)); -// bytes32 public requestId2 = bytes32(uint256(5)); - -// address public proposer = makeAddr('proposer'); -// address public disputer = makeAddr('disputer'); -// bytes public responseData = abi.encode('responseData'); - -// ForTest_ResolutionModule public submodule1; -// ForTest_ResolutionModule public submodule2; -// ForTest_ResolutionModule public submodule3; -// IResolutionModule[] public resolutionModules; -// IResolutionModule[] public resolutionModules2; -// uint256 public sequenceId; -// uint256 public sequenceId2; - -// event ResolutionSequenceAdded(uint256 _sequenceId, IResolutionModule[] _modules); - -// function setUp() public { -// oracle = IOracle(makeAddr('Oracle')); -// vm.etch(address(oracle), hex'069420'); - -// vm.mockCall( -// address(oracle), -// abi.encodeWithSelector(IOracle.getDispute.selector, disputeId), -// abi.encode( -// IOracle.Dispute(block.timestamp, disputer, proposer, responseId, requestId, IOracle.DisputeStatus.Escalated) -// ) -// ); - -// vm.mockCall( -// address(oracle), -// abi.encodeWithSelector(IOracle.getDispute.selector, disputeId2), -// abi.encode( -// IOracle.Dispute(block.timestamp, disputer, proposer, responseId, requestId2, IOracle.DisputeStatus.Escalated) -// ) -// ); - -// vm.mockCall(address(oracle), abi.encodeWithSelector(IOracle.updateDisputeStatus.selector), abi.encode()); - -// module = new SequentialResolutionModule(oracle); - -// submodule1 = new ForTest_ResolutionModule(module, 'module1'); -// submodule2 = new ForTest_ResolutionModule(module, 'module2'); -// submodule3 = new ForTest_ResolutionModule(module, 'module3'); - -// vm.mockCall(address(submodule1), abi.encodeWithSelector(IModule.setupRequest.selector), abi.encode()); -// vm.mockCall(address(submodule2), abi.encodeWithSelector(IModule.setupRequest.selector), abi.encode()); -// vm.mockCall(address(submodule3), abi.encodeWithSelector(IModule.setupRequest.selector), abi.encode()); - -// resolutionModules.push(IResolutionModule(address(submodule1))); -// resolutionModules.push(IResolutionModule(address(submodule2))); -// resolutionModules.push(IResolutionModule(address(submodule3))); - -// sequenceId = module.addResolutionModuleSequence(resolutionModules); - -// bytes[] memory _submoduleData = new bytes[](3); -// _submoduleData[0] = abi.encode('submodule1Data'); -// _submoduleData[1] = abi.encode('submodule2Data'); -// _submoduleData[2] = abi.encode('submodule3Data'); - -// vm.prank(address(oracle)); -// module.setupRequest( -// requestId, -// abi.encode(ISequentialResolutionModule.RequestParameters({sequenceId: sequenceId, submoduleData: _submoduleData})) -// ); - -// resolutionModules2.push(IResolutionModule(address(submodule2))); -// resolutionModules2.push(IResolutionModule(address(submodule3))); -// resolutionModules2.push(IResolutionModule(address(submodule1))); - -// sequenceId2 = module.addResolutionModuleSequence(resolutionModules2); - -// vm.prank(address(oracle)); -// module.setupRequest( -// requestId2, -// abi.encode( -// ISequentialResolutionModule.RequestParameters({sequenceId: sequenceId2, submoduleData: _submoduleData}) -// ) -// ); -// } -// } - -// /** -// * @title SequentialResolutionModule Unit tests -// */ -// contract SequentialResolutionModule_Unit_ModuleData is BaseTest { -// function test_decodeRequestParameters() public { -// ISequentialResolutionModule.RequestParameters memory _params = module.decodeRequestData(requestId); - -// // Check: are all request parameters properly stored? -// assertEq(_params.sequenceId, sequenceId); -// assertEq(_params.submoduleData[0], abi.encode('submodule1Data')); -// assertEq(_params.submoduleData[1], abi.encode('submodule2Data')); -// assertEq(_params.submoduleData[2], abi.encode('submodule3Data')); -// } - -// function test_moduleName() public { -// assertEq(module.moduleName(), 'SequentialResolutionModule'); -// } -// } - -// contract SequentialResolutionModule_Unit_Setup is BaseTest { -// function test_setupRequestCallsAllSubmodules(bytes32 _requestId) public { -// bytes memory _submodule1Data = abi.encode('submodule1Data'); -// bytes memory _submodule2Data = abi.encode('submodule2Data'); -// bytes memory _submodule3Data = abi.encode('submodule3Data'); - -// bytes[] memory _submoduleData = new bytes[](3); -// _submoduleData[0] = _submodule1Data; -// _submoduleData[1] = _submodule2Data; -// _submoduleData[2] = _submodule3Data; - -// // Check: is the submodule 1 called with the proper data? -// vm.expectCall( -// address(submodule1), abi.encodeWithSelector(IModule.setupRequest.selector, _requestId, _submodule1Data) -// ); -// // Check: is the submodule 2 called with the proper data? -// vm.expectCall( -// address(submodule2), abi.encodeWithSelector(IModule.setupRequest.selector, _requestId, _submodule2Data) -// ); -// // Check: is the submodule 3 called with the proper data? -// vm.expectCall( -// address(submodule3), abi.encodeWithSelector(IModule.setupRequest.selector, _requestId, _submodule3Data) -// ); - -// vm.prank(address(oracle)); -// module.setupRequest( -// _requestId, -// abi.encode(ISequentialResolutionModule.RequestParameters({sequenceId: sequenceId, submoduleData: _submoduleData})) -// ); -// } - -// function test_addResolutionModuleSequence(IResolutionModule[] memory _testModules) public { -// uint256 _beforeSequenceId = module.currentSequenceId(); - -// // Check: is the event emitted? -// vm.expectEmit(true, true, true, true, address(module)); -// emit ResolutionSequenceAdded(_beforeSequenceId + 1, _testModules); - -// uint256 _afterSequenceId = module.addResolutionModuleSequence(_testModules); -// // Check: is the sequence id updated? -// assertEq(_beforeSequenceId + 1, _afterSequenceId); -// } - -// function test_setupRequestRevertsIfNotOracle() public { -// // Check: does it revert if not called by the Oracle? -// vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); - -// vm.prank(makeAddr('other_sender')); -// module.setupRequest(requestId, abi.encode()); -// } -// } - -// contract SequentialResolutionModule_Unit_OracleProxy is BaseTest { -// function test_allowedModuleCallsOracle() public { -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.allowedModule.selector), abi.encode(true)); -// module.allowedModule(requestId, address(module)); -// } - -// function test_getDisputeCallsOracle() public { -// IOracle.Dispute memory _dispute; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getDispute.selector), abi.encode(_dispute)); -// module.getDispute(disputeId); -// } - -// function test_getResponseCallsOracle() public { -// IOracle.Response memory _response; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getResponse.selector), abi.encode(_response)); -// module.getResponse(responseId); -// } - -// function test_getRequestCallsOracle() public { -// IOracle.Request memory _request; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getRequest.selector), abi.encode(_request)); -// module.getRequest(requestId); -// } - -// function test_getFullRequestCallsOracle() public { -// IOracle.FullRequest memory _request; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getFullRequest.selector), abi.encode(_request)); -// module.getFullRequest(requestId); -// } - -// function test_disputeOfCallsOracle() public { -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.disputeOf.selector), abi.encode(disputeId)); -// module.disputeOf(requestId); -// } - -// function test_getFinalizedResponseCallsOracle() public { -// IOracle.Response memory _response; -// _mockAndExpect( -// address(oracle), abi.encodeWithSelector(IOracle.getFinalizedResponse.selector), abi.encode(_response) -// ); -// module.getFinalizedResponse(requestId); -// } - -// function test_getResponseIdsCallsOracle() public { -// bytes32[] memory _ids; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getResponseIds.selector), abi.encode(_ids)); -// module.getResponseIds(requestId); -// } - -// function test_listRequestsCallsOracle() public { -// IOracle.FullRequest[] memory _list; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.listRequests.selector), abi.encode(_list)); -// module.listRequests(0, 10); -// } - -// function test_listRequestIdsCallsOracle() public { -// bytes32[] memory _list; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.listRequestIds.selector), abi.encode(_list)); -// module.listRequestIds(0, 10); -// } - -// function test_getRequestIdCallsOracle(uint256 _nonce) public { -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getRequestId.selector), abi.encode(bytes32(0))); -// module.getRequestId(_nonce); -// } - -// function test_getRequestByNonceCallsOracle(uint256 _nonce) public { -// IOracle.Request memory _request; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getRequestByNonce.selector), abi.encode(_request)); -// module.getRequestByNonce(_nonce); -// } - -// function test_finalizeCallsOracle() public { -// _mockAndExpect(address(oracle), abi.encodeWithSignature('finalize(bytes32,bytes32)'), abi.encode()); -// vm.prank(address(submodule1)); -// module.finalize(requestId, responseId); -// } - -// function test_escalateDisputeCallsOracle() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.escalateDispute.selector), abi.encode()); - -// vm.prank(address(submodule1)); -// module.escalateDispute(disputeId); -// } - -// function test_isParticipantCallsOracle(bytes32 _requestId, address _user) public { -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.isParticipant.selector), abi.encode(true)); -// module.isParticipant(_requestId, _user); -// } - -// function test_getFinalizedResponseIdCallsOracle(bytes32 _requestId) public { -// _mockAndExpect( -// address(oracle), abi.encodeWithSelector(IOracle.getFinalizedResponseId.selector), abi.encode(bytes32('69')) -// ); -// module.getFinalizedResponseId(_requestId); -// } - -// function test_totalRequestCountCallsOracle() public { -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.totalRequestCount.selector), abi.encode(uint256(69))); -// module.totalRequestCount(); -// } - -// function test_finalizeWithoutResponseCallsOracle() public { -// _mockAndExpect(address(oracle), abi.encodeWithSignature('finalize(bytes32)'), abi.encode()); -// vm.prank(address(submodule1)); -// module.finalize(requestId); -// } - -// function test_getDisputeCallsManager(bytes32 _disputeId) public { -// IOracle.Dispute memory _dispute; -// _mockAndExpect(address(oracle), abi.encodeWithSelector(IOracle.getDispute.selector), abi.encode(_dispute)); -// module.getDispute(_disputeId); -// } -// } - -// contract SequentialResolutionModule_Unit_ResolveDispute is BaseTest { -// function test_revertIfNotOracle() public { -// // Check: does it revert if not called by the Oracle? -// vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); - -// vm.prank(makeAddr('other_sender')); -// module.resolveDispute(disputeId); -// } - -// function test_callsFirstModuleAndResolvesIfWon() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); -// submodule1.forTest_setResponseStatus(IOracle.DisputeStatus.Won); - -// // Check: is the module called with IOracle.updateDisputeStatus and DisputeStatus.Won? -// vm.expectCall( -// address(module), -// abi.encodeWithSelector(IOracle.updateDisputeStatus.selector, disputeId, IOracle.DisputeStatus.Won) -// ); - -// // Check: is the oracle called with IOracle.updateDisputeStatus and DisputeStatus.Won? -// vm.expectCall( -// address(oracle), -// abi.encodeWithSelector(IOracle.updateDisputeStatus.selector, disputeId, IOracle.DisputeStatus.Won) -// ); - -// vm.prank(address(oracle)); -// module.resolveDispute(disputeId); -// } - -// function test_callsFirstModuleAndResolvesIfLost() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); -// submodule1.forTest_setResponseStatus(IOracle.DisputeStatus.Lost); - -// // Check: is the module called with IOracle.updateDisputeStatus and DisputeStatus.Lost? -// vm.expectCall( -// address(module), -// abi.encodeWithSelector(IOracle.updateDisputeStatus.selector, disputeId, IOracle.DisputeStatus.Lost) -// ); - -// // Check: is the oracle called with IOracle.updateDisputeStatus and DisputeStatus.Lost? -// vm.expectCall( -// address(oracle), -// abi.encodeWithSelector(IOracle.updateDisputeStatus.selector, disputeId, IOracle.DisputeStatus.Lost) -// ); - -// vm.prank(address(oracle)); -// module.resolveDispute(disputeId); -// } - -// function test_goesToTheNextResolutionModule() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); -// submodule1.forTest_setResponseStatus(IOracle.DisputeStatus.NoResolution); - -// // Check: is the submodule 2 called with IResolutionModule.startResolution? -// vm.expectCall(address(submodule2), abi.encodeWithSelector(IResolutionModule.startResolution.selector, disputeId)); - -// // Check: is the current resolution module the submodule 1? -// assertEq(address(module.getCurrentResolutionModule(disputeId)), address(submodule1)); - -// vm.prank(address(oracle)); -// module.resolveDispute(disputeId); - -// // Check: is the current resolution module the submodule 2? -// assertEq(address(module.getCurrentResolutionModule(disputeId)), address(submodule2)); - -// // Check: is the submodule 2 called with IResolutionModule.resolveDispute? -// vm.expectCall(address(submodule2), abi.encodeWithSelector(IResolutionModule.resolveDispute.selector, disputeId)); - -// vm.prank(address(oracle)); -// module.resolveDispute(disputeId); -// } - -// function test_callsTheManagerWhenThereAreNoMoreSubmodulesLeft() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// submodule1.forTest_setResponseStatus(IOracle.DisputeStatus.NoResolution); - -// vm.prank(address(oracle)); -// module.resolveDispute(disputeId); - -// submodule2.forTest_setResponseStatus(IOracle.DisputeStatus.NoResolution); - -// vm.prank(address(oracle)); -// module.resolveDispute(disputeId); - -// // Check: is the oracle called with IOracle.updateDisputeStatus and DisputeStatus.NoResolution? -// vm.expectCall( -// address(oracle), -// abi.encodeWithSelector(IOracle.updateDisputeStatus.selector, disputeId, IOracle.DisputeStatus.NoResolution) -// ); - -// submodule3.forTest_setResponseStatus(IOracle.DisputeStatus.NoResolution); -// vm.prank(address(oracle)); -// module.resolveDispute(disputeId); -// } -// } - -// contract SequentialResolutionModule_Unit_StartResolution is BaseTest { -// function test_revertsIfNotOracle() public { -// // Check: does it revert if not called by the Oracle? -// vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); - -// vm.prank(makeAddr('other_sender')); -// module.startResolution(disputeId); -// } - -// function test_callsFirstModule() public { -// // Check: is the submodule 1 called with IResolutionModule.startResolution? -// vm.expectCall(address(submodule1), abi.encodeWithSelector(IResolutionModule.startResolution.selector, disputeId)); - -// vm.prank(address(oracle)); -// module.startResolution(disputeId); -// } - -// function test_callsFirstModuleSequence2() public { -// // Check: is the submodule 2 called with IResolutionModule.startResolution? -// vm.expectCall(address(submodule2), abi.encodeWithSelector(IResolutionModule.startResolution.selector, disputeId2)); - -// vm.prank(address(oracle)); -// module.startResolution(disputeId2); -// } - -// function test_newDispute() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// vm.prank(address(submodule1)); -// module.updateDisputeStatus(disputeId, IOracle.DisputeStatus.NoResolution); - -// // Check: is the submodule 2 stored as the current resolution module for the dispute? -// assertEq(address(module.getCurrentResolutionModule(disputeId)), address(submodule2)); - -// bytes32 _dispute3 = bytes32(uint256(6969)); - -// _mockAndExpect( -// address(oracle), -// abi.encodeWithSelector(IOracle.getDispute.selector, _dispute3), -// abi.encode( -// IOracle.Dispute(block.timestamp, disputer, proposer, responseId, requestId, IOracle.DisputeStatus.Escalated) -// ) -// ); - -// vm.prank(address(oracle)); -// module.startResolution(_dispute3); - -// // Check: is the submodule 1 stored as the current resolution module for the dispute 3? -// assertEq(address(module.getCurrentResolutionModule(_dispute3)), address(submodule1)); -// } -// } - -// contract SequentialResolutionModule_Unit_UpdateDisputeStatus is BaseTest { -// function test_revertsIfNotValidSubmodule() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); -// // Check: does it revert if not called by a submodule? - -// // Check: does it revert if not called by a submodule? -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_OnlySubmodule.selector) -// ); - -// vm.prank(makeAddr('other_sender')); -// module.updateDisputeStatus(disputeId, IOracle.DisputeStatus.NoResolution); -// } - -// function test_revertsIfNotSubmodule() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// // Check: does it revert if not called by a submodule? -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_OnlySubmodule.selector) -// ); - -// vm.prank(makeAddr('caller')); -// module.updateDisputeStatus(disputeId, IOracle.DisputeStatus.NoResolution); -// } - -// function test_revertsIfNotSubmoduleSequence2() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId2); - -// // Check: does it revert if not called by a submodule? -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_OnlySubmodule.selector) -// ); - -// vm.prank(makeAddr('caller')); -// module.updateDisputeStatus(disputeId2, IOracle.DisputeStatus.NoResolution); -// } - -// function test_changesCurrentIndex() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// // Check: is the submodule 2 called with IResolutionModule.startResolution? -// vm.expectCall(address(submodule2), abi.encodeWithSelector(IResolutionModule.startResolution.selector, disputeId)); - -// // Check: is the submodule 1 stored as the current resolution module for the dispute? -// assertEq(address(module.getCurrentResolutionModule(disputeId)), address(submodule1)); - -// vm.prank(address(submodule1)); -// module.updateDisputeStatus(disputeId, IOracle.DisputeStatus.NoResolution); - -// // Check: is the submodule 2 stored as the current resolution module for the dispute? -// assertEq(address(module.getCurrentResolutionModule(disputeId)), address(submodule2)); -// } - -// function test_changesCurrentIndexSequence2() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId2); - -// // Check: is the submodule 3 called with IResolutionModule.startResolution? -// vm.expectCall(address(submodule3), abi.encodeWithSelector(IResolutionModule.startResolution.selector, disputeId2)); - -// // Check: is the submodule 2 stored as the current resolution module for the dispute? -// assertEq(address(module.getCurrentResolutionModule(disputeId2)), address(submodule2)); - -// vm.prank(address(submodule2)); -// module.updateDisputeStatus(disputeId2, IOracle.DisputeStatus.NoResolution); - -// // Check: is the submodule 3 stored as the current resolution module for the dispute? -// assertEq(address(module.getCurrentResolutionModule(disputeId2)), address(submodule3)); -// } - -// function test_callsManagerWhenResolved() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// // Check: is the Oracle called with IOracle.updateDisputeStatus? -// vm.expectCall( -// address(oracle), -// abi.encodeWithSelector(IOracle.updateDisputeStatus.selector, disputeId, IOracle.DisputeStatus.Won) -// ); - -// vm.prank(address(submodule1)); -// module.updateDisputeStatus(disputeId, IOracle.DisputeStatus.Won); -// } - -// function test_callsManagerWhenResolvedSequence2() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId2); - -// // Check: is the Oracle called with IOracle.updateDisputeStatus? -// vm.expectCall( -// address(oracle), -// abi.encodeWithSelector(IOracle.updateDisputeStatus.selector, disputeId2, IOracle.DisputeStatus.Won) -// ); - -// vm.prank(address(submodule2)); -// module.updateDisputeStatus(disputeId2, IOracle.DisputeStatus.Won); -// } -// } - -// contract SequentialResolutionModule_Unit_EscalateDispute is BaseTest { -// function test_revertsIfNotSubmodule() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// // Check: does it revert if not called by a submodule? -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_OnlySubmodule.selector) -// ); -// module.escalateDispute(disputeId); -// } -// } - -// contract SequentialResolutionModule_Unit_FinalizeRequest is BaseTest { -// function test_finalizesAllSubmodules() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// // Check: are the submodules called with IModule.finalizeRequest? -// vm.expectCall(address(submodule1), abi.encodeWithSelector(IModule.finalizeRequest.selector, requestId)); -// vm.expectCall(address(submodule2), abi.encodeWithSelector(IModule.finalizeRequest.selector, requestId)); -// vm.expectCall(address(submodule3), abi.encodeWithSelector(IModule.finalizeRequest.selector, requestId)); - -// vm.prank(address(oracle)); -// module.finalizeRequest(requestId, address(oracle)); -// } - -// function test_revertsIfNotOracle() public { -// // Check: does it revert if not called by the Oracle? -// vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); - -// vm.prank(makeAddr('caller')); -// module.finalizeRequest(requestId, makeAddr('caller')); -// } - -// function test_revertsIfNotSubmodule() public { -// vm.prank(address(oracle)); -// module.startResolution(disputeId); - -// // Check: does it revert if not called by a submodule? -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_OnlySubmodule.selector) -// ); -// module.finalize(requestId, responseId); -// } -// } - -// contract SequentialResolutionModule_Unit_ListSubmodules is BaseTest { -// function test_fullList() public { -// IResolutionModule[] memory _submodules = module.listSubmodules(0, 3, 1); - -// // Check: do the stored submodules match? -// assertEq(_submodules.length, 3); -// assertEq(address(_submodules[0]), address(submodule1)); -// assertEq(address(_submodules[1]), address(submodule2)); -// assertEq(address(_submodules[2]), address(submodule3)); -// } - -// function test_fullListSequence2() public { -// IResolutionModule[] memory _submodules = module.listSubmodules(0, 3, sequenceId2); - -// // Check: do the stored submodules match? -// assertEq(_submodules.length, 3); -// assertEq(address(_submodules[0]), address(submodule2)); -// assertEq(address(_submodules[1]), address(submodule3)); -// assertEq(address(_submodules[2]), address(submodule1)); -// } - -// function test_moreThanExist() public { -// IResolutionModule[] memory _submodules = module.listSubmodules(0, 200, 1); - -// // Check: do the stored submodules match? -// assertEq(_submodules.length, 3); -// assertEq(address(_submodules[0]), address(submodule1)); -// assertEq(address(_submodules[1]), address(submodule2)); -// assertEq(address(_submodules[2]), address(submodule3)); -// } - -// function test_partialListMiddle() public { -// IResolutionModule[] memory _submodules = module.listSubmodules(1, 2, 1); - -// // Check: do the stored submodules match? -// assertEq(_submodules.length, 2); -// assertEq(address(_submodules[0]), address(submodule2)); -// assertEq(address(_submodules[1]), address(submodule3)); -// } - -// function test_partialListStart() public { -// IResolutionModule[] memory _submodules = module.listSubmodules(0, 2, sequenceId); - -// // Check: do the stored submodules match? -// assertEq(_submodules.length, 2); -// assertEq(address(_submodules[0]), address(submodule1)); -// assertEq(address(_submodules[1]), address(submodule2)); -// } -// } - -// contract SequentialResolutionModule_Unit_NotImplemented is BaseTest { -// function testReverts_disputeResponseNotSubmodule() public { -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// module.disputeResponse(requestId, responseId); -// } - -// function testReverts_proposeResponseNotSubmodule() public { -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// module.proposeResponse(requestId, responseData); -// } - -// function testReverts_proposeResponseWithProposerNotSubmodule() public { -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// module.proposeResponse(proposer, requestId, responseData); -// } - -// function testReverts_disputeResponseNotImplemented() public { -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// vm.prank(address(submodule1)); -// module.disputeResponse(requestId, responseId); -// } - -// function testReverts_proposeResponseNotImplemented() public { -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// vm.prank(address(submodule1)); -// module.proposeResponse(requestId, responseData); -// } - -// function testReverts_proposeResponseWithProposerNotImplemented() public { -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// vm.prank(address(submodule1)); -// module.proposeResponse(proposer, requestId, responseData); -// } - -// function testReverts_createRequestNotImplemented() public { -// IOracle.NewRequest memory _request; -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// vm.prank(address(submodule1)); -// module.createRequest(_request); -// } - -// function testReverts_createRequestsNotImplemented() public { -// IOracle.NewRequest[] memory _requests; -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// vm.prank(address(submodule1)); -// module.createRequests(_requests); -// } - -// function testReverts_deleteResponseNotImplemented() public { -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// vm.prank(address(submodule1)); -// module.deleteResponse(requestId); -// } - -// function testReverts_createRequestNotSubmodule() public { -// IOracle.NewRequest memory _request; -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// module.createRequest(_request); -// } - -// function testReverts_createRequestsNotSubmodule() public { -// IOracle.NewRequest[] memory _requests; -// vm.expectRevert( -// abi.encodeWithSelector(ISequentialResolutionModule.SequentialResolutionModule_NotImplemented.selector) -// ); -// module.createRequests(_requests); -// } -// } diff --git a/solidity/test/unit/modules/response/BondedResponseModule.t.sol b/solidity/test/unit/modules/response/BondedResponseModule.t.sol index f402a180..290d056d 100644 --- a/solidity/test/unit/modules/response/BondedResponseModule.t.sol +++ b/solidity/test/unit/modules/response/BondedResponseModule.t.sol @@ -81,7 +81,7 @@ contract BondedResponseModule_Unit_Propose is BaseTest { vm.assume(_sender != address(oracle)); // Check: does it revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(address(_sender)); bondedResponseModule.propose(mockRequest, mockResponse, _sender); @@ -171,7 +171,7 @@ contract BondedResponseModule_Unit_FinalizeRequest is BaseTest { vm.assume(_sender != address(oracle)); // Check: does it revert if not called by the Oracle? - vm.expectRevert(abi.encodeWithSelector(IModule.Module_OnlyOracle.selector)); + vm.expectRevert(IModule.Module_OnlyOracle.selector); vm.prank(address(_sender)); bondedResponseModule.finalizeRequest(mockRequest, mockResponse, _sender);