Skip to content

Commit

Permalink
refactor(evm): adds InvalidThreshold instead of returning false withi…
Browse files Browse the repository at this point in the history
…n checkHashWithThresholdFromOracles
  • Loading branch information
allemanfredi committed Jan 25, 2024
1 parent 7effd40 commit 88a5673
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/evm/contracts/Hashi.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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; ) {
Expand Down
1 change: 1 addition & 0 deletions packages/evm/contracts/interfaces/IHashi.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 88a5673

Please sign in to comment.