Skip to content

Commit 7baa99a

Browse files
committed
test: clean up; add current emode label
1 parent b18f305 commit 7baa99a

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tests/deployments/HorizonBase.t.sol

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,14 @@ abstract contract HorizonBaseTest is Test {
403403
assertEq(abi.encode(a), abi.encode(b), 'assertEq(interestRateData): all fields');
404404
}
405405

406+
// check current emode category label is empty so it can be overridden
407+
function _checkExistingEModeCategory(uint8 eModeCategory) internal virtual {
408+
DataTypes.EModeCategoryLegacy memory eModeCategoryData = pool.getEModeCategoryData(
409+
eModeCategory
410+
);
411+
assertEq(eModeCategoryData.label, '', 'EMode category does not exist');
412+
}
413+
406414
function _toDynamicAddressArray(address a) internal pure returns (address[] memory) {
407415
address[] memory array = new address[](1);
408416
array[0] = a;

tests/deployments/HorizonPhaseTwoListing.t.sol

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ contract HorizonPhaseTwoListingTest is HorizonBaseTest {
5151
borrowableAssets: _toDynamicAddressArray(AaveV3EthereumHorizonAssets.GHO_UNDERLYING)
5252
});
5353

54+
uint8 internal constant VBILL_GHO_EMODE_CATEGORY = 1;
55+
5456
function setUp() public virtual {
5557
vm.createSelectFork('mainnet');
58+
5659
initEnvironment();
60+
_checkExistingEModeCategory(VBILL_GHO_EMODE_CATEGORY);
5761
_loadDeployment();
5862

5963
_whitelistVbillRwa(alice);
@@ -67,7 +71,11 @@ contract HorizonPhaseTwoListingTest is HorizonBaseTest {
6771
}
6872

6973
function test_eMode_VBILL_GHO() public {
70-
test_eMode({eModeCategory: 1, params: VBILL_GHO_EMODE_PARAMS, dealCollateral: false});
74+
test_eMode({
75+
eModeCategory: VBILL_GHO_EMODE_CATEGORY,
76+
params: VBILL_GHO_EMODE_PARAMS,
77+
dealCollateral: false
78+
});
7179
}
7280

7381
// fund accounts by transferring existing VBILL, as `deal` causes issues on token contract accounting
@@ -148,9 +156,11 @@ contract HorizonPhaseTwoListingTest is HorizonBaseTest {
148156
/// forge-config: default.evm_version = "cancun"
149157
contract HorizonPhaseTwoListingVTestnetTest is HorizonPhaseTwoListingTest {
150158
function setUp() public virtual override {
159+
vm.skip(true, 'vtestnet with VBILL listed');
151160
vm.createSelectFork('vtestnet');
152161

153162
initEnvironment();
163+
_checkExistingEModeCategory(VBILL_GHO_EMODE_CATEGORY);
154164

155165
_whitelistVbillRwa(alice);
156166
_whitelistVbillRwa(pool.getReserveAToken(AaveV3EthereumHorizonCustom.VBILL_UNDERLYING));
@@ -184,6 +194,7 @@ contract HorizonPhaseTwoListingPostDeploymentForkTest is HorizonPhaseTwoListingT
184194
vm.createSelectFork('mainnet');
185195

186196
initEnvironment();
197+
_checkExistingEModeCategory(VBILL_GHO_EMODE_CATEGORY);
187198
_loadDeployment();
188199

189200
_whitelistVbillRwa(alice);

0 commit comments

Comments
 (0)