diff --git a/contracts/v0.2/src/SubmissionProxy.sol b/contracts/v0.2/src/SubmissionProxy.sol index 47b2de9db..8d2d2ba79 100644 --- a/contracts/v0.2/src/SubmissionProxy.sol +++ b/contracts/v0.2/src/SubmissionProxy.sol @@ -486,9 +486,9 @@ contract SubmissionProxy is Ownable { * @param _threshold The threshold * @return The quorum */ - function quorum(uint8 _threshold) internal view returns (uint8) { + function quorum(uint8 _threshold) internal view returns (uint256) { uint256 nominator = oracles.length * _threshold; - return uint8((nominator / 100) + (nominator % 100 == 0 ? 0 : 1)); + return (nominator / 100) + (nominator % 100 == 0 ? 0 : 1); } /** @@ -514,14 +514,14 @@ contract SubmissionProxy is Ownable { return false; } - uint8 verifiedSignatures_ = 0; + uint256 verifiedSignatures_ = 0; uint256 lastIndex_ = 0; uint8 threshold_ = thresholds[_feedHash]; if (threshold_ == 0) { threshold_ = defaultThreshold; } - uint8 requiredSignatures_ = quorum(threshold_); + uint256 requiredSignatures_ = quorum(threshold_); uint256 proofsLength_ = _proofs.length; for (uint256 j = 0; j < proofsLength_; j++) { diff --git a/contracts/v0.2/test/SubmissionProxyMock.t.sol b/contracts/v0.2/test/SubmissionProxyMock.t.sol index 2f36ea2ec..69793c726 100644 --- a/contracts/v0.2/test/SubmissionProxyMock.t.sol +++ b/contracts/v0.2/test/SubmissionProxyMock.t.sol @@ -8,7 +8,7 @@ import {Feed} from "../src/Feed.sol"; import {IFeed} from "../src/interfaces/IFeed.sol"; contract SubmissionProxyMock is SubmissionProxy { - function callQuorum(uint8 _threshold) external view returns (uint8) { + function callQuorum(uint8 _threshold) external view returns (uint256) { return quorum(_threshold); } @@ -31,7 +31,7 @@ contract SubmissionProxyMockTest is Test { function test_QuorumWithOneOracle() public { submissionProxy.addOracle(makeAddr("zero")); - uint8 quorum_ = submissionProxy.callQuorum(1); + uint256 quorum_ = submissionProxy.callQuorum(1); assertEq(quorum_, 1); quorum_ = submissionProxy.callQuorum(100); @@ -42,7 +42,7 @@ contract SubmissionProxyMockTest is Test { submissionProxy.addOracle(makeAddr("zero")); submissionProxy.addOracle(makeAddr("one")); - uint8 quorum_ = submissionProxy.callQuorum(1); + uint256 quorum_ = submissionProxy.callQuorum(1); assertEq(quorum_, 1); quorum_ = submissionProxy.callQuorum(50); @@ -61,7 +61,7 @@ contract SubmissionProxyMockTest is Test { submissionProxy.addOracle(makeAddr("one")); submissionProxy.addOracle(makeAddr("two")); - uint8 quorum_ = submissionProxy.callQuorum(1); + uint256 quorum_ = submissionProxy.callQuorum(1); assertEq(quorum_, 1); quorum_ = submissionProxy.callQuorum(33);