diff --git a/packages/evm/contracts/Hashi.sol b/packages/evm/contracts/Hashi.sol index 623f8aa7..2fba698d 100644 --- a/packages/evm/contracts/Hashi.sol +++ b/packages/evm/contracts/Hashi.sol @@ -44,7 +44,7 @@ contract Hashi is IHashi { uint256 threshold, IOracleAdapter[] calldata oracleAdapters ) external view returns (bool) { - if (oracleAdapters.length < threshold) return false; + if (threshold > oracleAdapters.length) revert InvalidThreshold(threshold, oracleAdapters.length); bytes32[] memory hashes = new bytes32[](oracleAdapters.length); for (uint256 i = 0; i < oracleAdapters.length; ) { diff --git a/packages/evm/contracts/interfaces/IHashi.sol b/packages/evm/contracts/interfaces/IHashi.sol index 2f352c22..2fbfbda6 100644 --- a/packages/evm/contracts/interfaces/IHashi.sol +++ b/packages/evm/contracts/interfaces/IHashi.sol @@ -7,6 +7,7 @@ import { IOracleAdapter } from "./IOracleAdapter.sol"; * @title IHashi */ interface IHashi { + error InvalidThreshold(uint256 threshold, uint256 maxThreshold); error NoOracleAdaptersGiven(); error OracleDidNotReport(IOracleAdapter oracleAdapter); error OraclesDisagree(IOracleAdapter oracleOne, IOracleAdapter oracleTwo);