Skip to content

Commit e770c51

Browse files
committed
minor changes to tests
1 parent cc855f9 commit e770c51

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ jobs:
3333

3434
- name: Run Forge tests
3535
run: |
36-
forge test -vvvv
36+
forge test -vvv
3737
id: test

test/Solaxy.invariant.t.sol

+7-13
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ contract Handler is Test {
4848
}
4949

5050
contract SolaxyInvarantTest is Test {
51-
Handler public handler;
52-
IERC20 public RESERVE;
5351
Solaxy public SLX;
52+
IERC20 public RESERVE;
5453
address public RESERVE_address;
5554
address public handlerAddress;
5655

@@ -61,19 +60,19 @@ contract SolaxyInvarantTest is Test {
6160
SLX = new Solaxy();
6261
RESERVE_address = SLX.asset();
6362
RESERVE = IERC20(RESERVE_address);
64-
65-
handler = new Handler(SLX, RESERVE);
66-
handlerAddress = address(handler);
63+
handlerAddress = address(new Handler(SLX, RESERVE));
6764

6865
deal(RESERVE_address, handlerAddress, reserve_balanceOneBillion, true);
6966
dealERC721(address(SLX.M3TER()), handlerAddress, 0);
7067
targetContract(handlerAddress);
7168
}
7269

7370
function invariantValuation() public view {
74-
uint256 reserve_balanceAfterTest = RESERVE.balanceOf(handlerAddress);
75-
uint256 solaxyTVL = reserve_balanceOneBillion - reserve_balanceAfterTest;
76-
assertEq(SLX.totalAssets(), solaxyTVL, "Total value locked should be strictly equal to total reserve assets");
71+
assertEq(
72+
SLX.totalAssets(),
73+
RESERVE.balanceOf(handlerAddress) - reserve_balanceOneBillion,
74+
"Total value locked should be strictly equal to total reserve assets"
75+
);
7776

7877
assertEq(
7978
SLX.totalSupply(),
@@ -88,9 +87,4 @@ contract SolaxyInvarantTest is Test {
8887
"Total reserve assets must be enough to cover the conversion of all existing tokens to less than a cent rounding error"
8988
);
9089
}
91-
92-
function test_knowHolderBalance() public view {
93-
uint256 knowHolderBalance = RESERVE.balanceOf(0x4e59b44847b379578588920cA78FbF26c0B4956C);
94-
assertEq(knowHolderBalance, 0.000864e18, "reserve balance should be equal 0.000864 reserve");
95-
}
9690
}

test/Solaxy.t.sol

-5
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,4 @@ contract SolaxyUnitTest is Test {
149149
uint256 SLX_feeBalance = SLX.balanceOf(SLX.tipAccount());
150150
assertEq(SLX_feeBalance, 17938800000000000000);
151151
}
152-
153-
function test_knowHolderBalance() public view {
154-
uint256 knowHolderBalance = RESERVE.balanceOf(0x4e59b44847b379578588920cA78FbF26c0B4956C);
155-
assertEq(knowHolderBalance, 0.000864e18, "reserve balance should be equal 0.000864 reserve");
156-
}
157152
}

0 commit comments

Comments
 (0)