Skip to content

Commit f3910f1

Browse files
committed
fmt
1 parent f59f99a commit f3910f1

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

test/EulerSwap.t.sol

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,16 @@ contract EulerSwapTest is MaglevTestBase {
4343
}
4444

4545
function test_price() public {
46-
uint price = 0.5e18;
47-
uint px = price;
48-
uint py = 1e18;
46+
uint256 price = 0.5e18;
47+
uint256 px = price;
48+
uint256 py = 1e18;
4949
oracle.setPrice(address(eTST), unitOfAccount, 0.5e18);
5050
oracle.setPrice(address(assetTST), unitOfAccount, 0.5e18);
5151

5252
int256 origNAV = getHolderNAV();
5353

5454
vm.prank(owner);
55-
maglev.setEulerSwapParams(Maglev.EulerSwapParams({
56-
px: px,
57-
py: py,
58-
cx: 0.4e18,
59-
cy: 0.85e18
60-
}));
55+
maglev.setEulerSwapParams(Maglev.EulerSwapParams({px: px, py: py, cx: 0.4e18, cy: 0.85e18}));
6156

6257
uint256 amountIn = 1e18;
6358
uint256 amountOut = maglev.quoteExactInput(address(assetTST), address(assetTST2), amountIn);
@@ -90,6 +85,7 @@ contract EulerSwapTest is MaglevTestBase {
9085

9186
t2.transfer(address(maglev), q);
9287
if (dir) maglev.swap(amount - 2, 0, address(this), ""); // - 2 due to rounding
88+
9389
else maglev.swap(0, amount - 2, address(this), "");
9490

9591
uint256 q2 = maglev.quoteExactInput(address(t1), address(t2), amount);
@@ -103,18 +99,13 @@ contract EulerSwapTest is MaglevTestBase {
10399
cx = bound(cx, 0.01e18, 0.99e18);
104100
cy = bound(cy, 0.01e18, 0.99e18);
105101

106-
uint px = price;
107-
uint py = 1e18;
102+
uint256 px = price;
103+
uint256 py = 1e18;
108104
oracle.setPrice(address(eTST), unitOfAccount, price);
109105
oracle.setPrice(address(assetTST), unitOfAccount, price);
110106

111107
vm.prank(owner);
112-
maglev.setEulerSwapParams(Maglev.EulerSwapParams({
113-
px: px,
114-
py: py,
115-
cx: cx,
116-
cy: cy
117-
}));
108+
maglev.setEulerSwapParams(Maglev.EulerSwapParams({px: px, py: py, cx: cx, cy: cy}));
118109

119110
int256 origNAV = getHolderNAV();
120111

test/MaglevTestBase.t.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ contract MaglevTestBase is EVaultTestBase {
6464
uint256 balance1 = eTST2.convertToAssets(eTST2.balanceOf(holder));
6565
uint256 debt1 = eTST2.debtOf(holder);
6666

67-
uint256 balValue = oracle.getQuote(balance0, address(assetTST), unitOfAccount) + oracle.getQuote(balance1, address(assetTST2), unitOfAccount);
68-
uint256 debtValue = oracle.getQuote(debt0, address(assetTST), unitOfAccount) + oracle.getQuote(debt1, address(assetTST2), unitOfAccount);
67+
uint256 balValue = oracle.getQuote(balance0, address(assetTST), unitOfAccount)
68+
+ oracle.getQuote(balance1, address(assetTST2), unitOfAccount);
69+
uint256 debtValue = oracle.getQuote(debt0, address(assetTST), unitOfAccount)
70+
+ oracle.getQuote(debt1, address(assetTST2), unitOfAccount);
6971

70-
return int(balValue) - int(debtValue);
72+
return int256(balValue) - int256(debtValue);
7173
}
7274

7375
modifier monotonicHolderNAV() {

0 commit comments

Comments
 (0)