Skip to content

Commit

Permalink
test: Remove redundant test contracts folder
Browse files Browse the repository at this point in the history
  • Loading branch information
bingen committed Mar 6, 2024
1 parent a7f19ff commit 24928ba
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 292 deletions.
16 changes: 0 additions & 16 deletions contracts/src/TestContracts/ActivePoolTester.sol

This file was deleted.

29 changes: 0 additions & 29 deletions contracts/src/TestContracts/BoldTokenCaller.sol

This file was deleted.

69 changes: 0 additions & 69 deletions contracts/src/TestContracts/BoldTokenTester.sol

This file was deleted.

16 changes: 0 additions & 16 deletions contracts/src/TestContracts/DefaultPoolTester.sol

This file was deleted.

12 changes: 0 additions & 12 deletions contracts/src/TestContracts/Destructible.sol

This file was deleted.

49 changes: 0 additions & 49 deletions contracts/src/TestContracts/FunctionCaller.sol

This file was deleted.

51 changes: 0 additions & 51 deletions contracts/src/TestContracts/MockTellor.sol

This file was deleted.

16 changes: 0 additions & 16 deletions contracts/src/TestContracts/PriceFeedTester.sol

This file was deleted.

20 changes: 0 additions & 20 deletions contracts/src/TestContracts/StabilityPoolTester.sol

This file was deleted.

4 changes: 2 additions & 2 deletions contracts/src/TroveManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,8 @@ contract TroveManager is LiquityBase, Ownable, CheckContract, ITroveManager {
function _updateSystemSnapshots_excludeCollRemainder(IActivePool _activePool, uint _collRemainder) internal {
totalStakesSnapshot = totalStakes;

uint activeColl = _activePool.getETH();
uint liquidatedColl = defaultPool.getETH();
uint activeColl = _activePool.getETHBalance();
uint liquidatedColl = defaultPool.getETHBalance();
totalCollateralSnapshot = activeColl - _collRemainder + liquidatedColl;

emit SystemSnapshotsUpdated(totalStakesSnapshot, totalCollateralSnapshot);
Expand Down
2 changes: 2 additions & 0 deletions contracts/src/test/TestContracts/BaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import "../../Interfaces/IPriceFeed.sol";
import "../../Interfaces/ISortedTroves.sol";
import "../../Interfaces/IStabilityPool.sol";
import "../../Interfaces/ITroveManager.sol";
import "./PriceFeedTestnet.sol";

import "../../GasPool.sol";

Expand Down Expand Up @@ -44,6 +45,7 @@ contract BaseTest is Test {
IStabilityPool stabilityPool;
ITroveManager troveManager;
IBoldToken boldToken;
IPriceFeedTestnet priceFeed;

GasPool gasPool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

pragma solidity 0.8.18;

import "../BorrowerOperations.sol";
import "../../BorrowerOperations.sol";

/* Tester contract inherits from BorrowerOperations, and provides external functions
for testing the parent's internal functions. */
contract BorrowerOperationsTester is BorrowerOperations {

constructor(address _ETHAddress) BorrowerOperations(_ETHAddress) {}

function getNewICRFromTroveChange
(
uint _coll,
Expand Down Expand Up @@ -53,9 +55,7 @@ contract BorrowerOperationsTester is BorrowerOperations {
)
external
{
_adjustTrove(_borrower, _collWithdrawal, _debtChange, _isDebtIncrease, 0);
// TODO: Add coll increase
_adjustTrove(_borrower, _collWithdrawal, false, _debtChange, _isDebtIncrease, 0);
}

// Payable fallback function
receive() external payable { }
}
2 changes: 1 addition & 1 deletion contracts/src/test/TestContracts/DevTestSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "../../DefaultPool.sol";
import "../../GasPool.sol";
import "../../HintHelpers.sol";
import "../../MultiTroveGetter.sol";
import "../../TestContracts/PriceFeedTestnet.sol";
import "./PriceFeedTestnet.sol";
import "../../SortedTroves.sol";
import "../../StabilityPool.sol";
import "../../TroveManager.sol";
Expand Down
8 changes: 8 additions & 0 deletions contracts/src/test/TestContracts/ERC20MinterMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pragma solidity ^0.8.18;

import "openzeppelin-contracts/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";


contract ERC20MinterMock is ERC20PresetMinterPauser {
constructor(string memory name, string memory symbol) ERC20PresetMinterPauser(name, symbol) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import "../../../Interfaces/IPriceFeed.sol";

interface IPriceFeedTestnet is IPriceFeed {
function setPrice(uint256 _price) external returns (bool);
}
function getPrice() external view returns (uint256);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity 0.8.18;

import "../Dependencies/LiquityMath.sol";
import "../../Dependencies/LiquityMath.sol";

/* Tester contract for math functions in Math.sol library. */

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity 0.8.18;

import "../test/TestContracts/Interfaces/IPriceFeedTestnet.sol";
import "./Interfaces/IPriceFeedTestnet.sol";

/*
* PriceFeed placeholder for testnet and development. The price is simply set manually and saved in a state
Expand All @@ -16,7 +16,7 @@ contract PriceFeedTestnet is IPriceFeedTestnet {
// --- Functions ---

// View price getter for simplicity in tests
function getPrice() external view returns (uint256) {
function getPrice() external view override returns (uint256) {
return _price;
}

Expand Down
Loading

0 comments on commit 24928ba

Please sign in to comment.