generated from bgd-labs/bgd-forge-template
-
Notifications
You must be signed in to change notification settings - Fork 17
/
AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412.t.sol
60 lines (51 loc) · 2.14 KB
/
AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {AaveV2Polygon, AaveV2PolygonAssets} from 'aave-address-book/AaveV2Polygon.sol';
import {ProtocolV2TestBase, ReserveConfig} from 'aave-helpers/ProtocolV2TestBase.sol';
import {AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412} from './AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412.sol';
/**
* @dev Test for AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412
* command: make test-contract filter=AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412
*/
contract AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412_Test is ProtocolV2TestBase {
struct Changes {
address asset;
uint256 reserveFactor;
}
AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412 internal proposal;
function setUp() public {
vm.createSelectFork(vm.rpcUrl('polygon'), 56422116);
proposal = new AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412();
}
/**
* @dev executes the generic test suite including e2e and config snapshots
*/
function test_defaultProposalExecution() public {
(, ReserveConfig[] memory allConfigsAfter) = defaultTest(
'AaveV2Polygon_ReserveFactorAndBorrowRateUpdates_20240412',
AaveV2Polygon.POOL,
address(proposal)
);
address[] memory assetsChanged = new address[](3);
assetsChanged[0] = AaveV2PolygonAssets.DAI_UNDERLYING;
assetsChanged[1] = AaveV2PolygonAssets.USDC_UNDERLYING;
assetsChanged[2] = AaveV2PolygonAssets.USDT_UNDERLYING;
Changes[] memory assetChanges = new Changes[](3);
assetChanges[0] = Changes({
asset: AaveV2PolygonAssets.DAI_UNDERLYING,
reserveFactor: proposal.DAI_RF()
});
assetChanges[1] = Changes({
asset: AaveV2PolygonAssets.USDC_UNDERLYING,
reserveFactor: proposal.USDC_RF()
});
assetChanges[2] = Changes({
asset: AaveV2PolygonAssets.USDT_UNDERLYING,
reserveFactor: proposal.USDT_RF()
});
for (uint i = 0; i < assetChanges.length; i++) {
ReserveConfig memory cfg = _findReserveConfig(allConfigsAfter, assetChanges[i].asset);
assertEq(cfg.reserveFactor, assetChanges[i].reserveFactor);
}
}
}