Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit c93d91f

Browse files
committed
test: improve test
1 parent 18777e6 commit c93d91f

1 file changed

Lines changed: 28 additions & 21 deletions

File tree

test-foundry/prod/aave-v2/TestLens.t.sol

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,33 @@ contract TestBorrow is TestSetup {
1111
function testUpgradeLens() public {
1212
Lens lensImplV2 = new Lens(address(morpho));
1313

14-
(
15-
uint256 p2pSupplyIndexBefore,
16-
uint256 p2pBorrowIndexBefore,
17-
uint256 poolSupplyIndexBefore,
18-
uint256 poolBorrowIndexBefore
19-
) = lens.getIndexes(aDai);
20-
21-
vm.prank(proxyAdmin.owner());
22-
proxyAdmin.upgrade(lensProxy, address(lensImplV2));
23-
24-
(
25-
uint256 p2pSupplyIndexAfter,
26-
uint256 p2pBorrowIndexAfter,
27-
uint256 poolSupplyIndexAfter,
28-
uint256 poolBorrowIndexAfter
29-
) = lens.getIndexes(aDai);
30-
31-
assertEq(p2pSupplyIndexAfter, p2pSupplyIndexBefore);
32-
assertEq(p2pBorrowIndexAfter, p2pBorrowIndexBefore);
33-
assertEq(poolSupplyIndexAfter, poolSupplyIndexBefore);
34-
assertEq(poolBorrowIndexAfter, poolBorrowIndexBefore);
14+
address[] memory marketsCreated = lens.getAllMarkets();
15+
16+
for (uint256 i; i < marketsCreated.length; ++i) {
17+
address market = marketsCreated[i];
18+
if (market == aStEth) continue;
19+
20+
(
21+
uint256 p2pSupplyIndexBefore,
22+
uint256 p2pBorrowIndexBefore,
23+
uint256 poolSupplyIndexBefore,
24+
uint256 poolBorrowIndexBefore
25+
) = lens.getIndexes(market);
26+
27+
vm.prank(proxyAdmin.owner());
28+
proxyAdmin.upgrade(lensProxy, address(lensImplV2));
29+
30+
(
31+
uint256 p2pSupplyIndexAfter,
32+
uint256 p2pBorrowIndexAfter,
33+
uint256 poolSupplyIndexAfter,
34+
uint256 poolBorrowIndexAfter
35+
) = lens.getIndexes(market);
36+
37+
assertEq(p2pSupplyIndexAfter, p2pSupplyIndexBefore);
38+
assertEq(p2pBorrowIndexAfter, p2pBorrowIndexBefore);
39+
assertEq(poolSupplyIndexAfter, poolSupplyIndexBefore);
40+
assertEq(poolBorrowIndexAfter, poolBorrowIndexBefore);
41+
}
3542
}
3643
}

0 commit comments

Comments
 (0)