Skip to content

Commit

Permalink
minor changes to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iChristwin committed Feb 1, 2025
1 parent cc855f9 commit e770c51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:

- name: Run Forge tests
run: |
forge test -vvvv
forge test -vvv
id: test
20 changes: 7 additions & 13 deletions test/Solaxy.invariant.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ contract Handler is Test {
}

contract SolaxyInvarantTest is Test {
Handler public handler;
IERC20 public RESERVE;
Solaxy public SLX;
IERC20 public RESERVE;
address public RESERVE_address;
address public handlerAddress;

Expand All @@ -61,19 +60,19 @@ contract SolaxyInvarantTest is Test {
SLX = new Solaxy();
RESERVE_address = SLX.asset();
RESERVE = IERC20(RESERVE_address);

handler = new Handler(SLX, RESERVE);
handlerAddress = address(handler);
handlerAddress = address(new Handler(SLX, RESERVE));

deal(RESERVE_address, handlerAddress, reserve_balanceOneBillion, true);
dealERC721(address(SLX.M3TER()), handlerAddress, 0);
targetContract(handlerAddress);
}

function invariantValuation() public view {
uint256 reserve_balanceAfterTest = RESERVE.balanceOf(handlerAddress);
uint256 solaxyTVL = reserve_balanceOneBillion - reserve_balanceAfterTest;
assertEq(SLX.totalAssets(), solaxyTVL, "Total value locked should be strictly equal to total reserve assets");
assertEq(
SLX.totalAssets(),
RESERVE.balanceOf(handlerAddress) - reserve_balanceOneBillion,
"Total value locked should be strictly equal to total reserve assets"
);

assertEq(
SLX.totalSupply(),
Expand All @@ -88,9 +87,4 @@ contract SolaxyInvarantTest is Test {
"Total reserve assets must be enough to cover the conversion of all existing tokens to less than a cent rounding error"
);
}

function test_knowHolderBalance() public view {
uint256 knowHolderBalance = RESERVE.balanceOf(0x4e59b44847b379578588920cA78FbF26c0B4956C);
assertEq(knowHolderBalance, 0.000864e18, "reserve balance should be equal 0.000864 reserve");
}
}
5 changes: 0 additions & 5 deletions test/Solaxy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,4 @@ contract SolaxyUnitTest is Test {
uint256 SLX_feeBalance = SLX.balanceOf(SLX.tipAccount());
assertEq(SLX_feeBalance, 17938800000000000000);
}

function test_knowHolderBalance() public view {
uint256 knowHolderBalance = RESERVE.balanceOf(0x4e59b44847b379578588920cA78FbF26c0B4956C);
assertEq(knowHolderBalance, 0.000864e18, "reserve balance should be equal 0.000864 reserve");
}
}

0 comments on commit e770c51

Please sign in to comment.