diff --git a/solidity/contracts/Oracle.sol b/solidity/contracts/Oracle.sol index 9283cb9..d786695 100644 --- a/solidity/contracts/Oracle.sol +++ b/solidity/contracts/Oracle.sol @@ -14,8 +14,6 @@ import {OracleAccessController} from './access/OracleAccessController.sol'; import {OracleTypehash} from './utils/OracleTypehash.sol'; contract Oracle is IOracle, OracleAccessController { - using ValidatorLib for *; - /// @inheritdoc IOracle mapping(bytes32 _requestId => uint256 _finalizedAt) public finalizedAt; diff --git a/solidity/libraries/ValidatorLib.sol b/solidity/libraries/ValidatorLib.sol index 8c694ca..e69da78 100644 --- a/solidity/libraries/ValidatorLib.sol +++ b/solidity/libraries/ValidatorLib.sol @@ -20,7 +20,7 @@ library ValidatorLib { * @param _request The request to compute the id for * @return _id The id the request */ - function _getId(IOracle.Request calldata _request) public pure returns (bytes32 _id) { + function _getId(IOracle.Request memory _request) internal pure returns (bytes32 _id) { _id = keccak256(abi.encode(_request)); } @@ -30,7 +30,7 @@ library ValidatorLib { * @param _response The response to compute the id for * @return _id The id the response */ - function _getId(IOracle.Response calldata _response) public pure returns (bytes32 _id) { + function _getId(IOracle.Response memory _response) internal pure returns (bytes32 _id) { _id = keccak256(abi.encode(_response)); } @@ -40,7 +40,7 @@ library ValidatorLib { * @param _dispute The dispute to compute the id for * @return _id The id the dispute */ - function _getId(IOracle.Dispute calldata _dispute) public pure returns (bytes32 _id) { + function _getId(IOracle.Dispute memory _dispute) internal pure returns (bytes32 _id) { _id = keccak256(abi.encode(_dispute)); } @@ -52,9 +52,9 @@ library ValidatorLib { * @return _responseId The id the response */ function _validateResponse( - IOracle.Request calldata _request, - IOracle.Response calldata _response - ) public pure returns (bytes32 _responseId) { + IOracle.Request memory _request, + IOracle.Response memory _response + ) internal pure returns (bytes32 _responseId) { bytes32 _requestId = _getId(_request); _responseId = _getId(_response); @@ -69,9 +69,9 @@ library ValidatorLib { * @return _disputeId The id the dispute */ function _validateDispute( - IOracle.Request calldata _request, - IOracle.Dispute calldata _dispute - ) public pure returns (bytes32 _disputeId) { + IOracle.Request memory _request, + IOracle.Dispute memory _dispute + ) internal pure returns (bytes32 _disputeId) { bytes32 _requestId = _getId(_request); _disputeId = _getId(_dispute); @@ -86,9 +86,9 @@ library ValidatorLib { * @return _disputeId The id the dispute */ function _validateDispute( - IOracle.Response calldata _response, - IOracle.Dispute calldata _dispute - ) public pure returns (bytes32 _disputeId) { + IOracle.Response memory _response, + IOracle.Dispute memory _dispute + ) internal pure returns (bytes32 _disputeId) { bytes32 _responseId = _getId(_response); _disputeId = _getId(_dispute); @@ -105,10 +105,10 @@ library ValidatorLib { * @return _disputeId The id the dispute */ function _validateResponseAndDispute( - IOracle.Request calldata _request, - IOracle.Response calldata _response, - IOracle.Dispute calldata _dispute - ) public pure returns (bytes32 _responseId, bytes32 _disputeId) { + IOracle.Request memory _request, + IOracle.Response memory _response, + IOracle.Dispute memory _dispute + ) internal pure returns (bytes32 _responseId, bytes32 _disputeId) { bytes32 _requestId = _getId(_request); _responseId = _getId(_response); _disputeId = _getId(_dispute);