Skip to content

Commit

Permalink
Sorted oracles Foundry tests (#10781)
Browse files Browse the repository at this point in the history
* SortedOracles tests

* sorted oracles typescript tests removal

* path fixes

* Update packages/protocol/test-sol/stability/SortedOracles.t.sol

Co-authored-by: soloseng <[email protected]>

* Update packages/protocol/test-sol/stability/SortedOracles.t.sol

Co-authored-by: soloseng <[email protected]>

* Update packages/protocol/test-sol/stability/SortedOracles.t.sol

Co-authored-by: soloseng <[email protected]>

* Update packages/protocol/test-sol/stability/SortedOracles.t.sol

Co-authored-by: soloseng <[email protected]>

* Update packages/protocol/test-sol/stability/SortedOracles.t.sol

Co-authored-by: soloseng <[email protected]>

* PR comments

---------

Co-authored-by: soloseng <[email protected]>
  • Loading branch information
pahor167 and soloseng authored Dec 12, 2023
1 parent 041fc92 commit ef6ac85
Show file tree
Hide file tree
Showing 3 changed files with 590 additions and 643 deletions.
9 changes: 4 additions & 5 deletions packages/protocol/contracts/stability/SortedOracles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
* @return Patch version of the contract.
*/
function getVersionNumber() external pure returns (uint256, uint256, uint256, uint256) {
return (1, 1, 2, 2);
return (1, 1, 2, 3);
}

/**
Expand Down Expand Up @@ -112,10 +112,9 @@ contract SortedOracles is ISortedOracles, ICeloVersionedContract, Ownable, Initi
* @param oracleAddress The address of the oracle.
*/
function addOracle(address token, address oracleAddress) external onlyOwner {
require(
token != address(0) && oracleAddress != address(0) && !isOracle[token][oracleAddress],
"token addr was null or oracle addr was null or oracle addr is not an oracle for token addr"
);
require(token != address(0), "token addr was null");
require(oracleAddress != address(0), "oracle addr was null");
require(!isOracle[token][oracleAddress], "oracle addr is not an oracle for token addr");
isOracle[token][oracleAddress] = true;
oracles[token].push(oracleAddress);
emit OracleAdded(token, oracleAddress);
Expand Down
Loading

1 comment on commit ef6ac85

@aaronmgdr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the test runner was not updated with this change https://github.com/celo-org/celo-monorepo/blob/master/.github/workflows/celo-monorepo.yml#L284

Please sign in to comment.