Skip to content

Commit b6cb0ad

Browse files
committed
chore: test comments
1 parent 96dda27 commit b6cb0ad

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/horizon/OracleDynamicBounds.t.sol

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ contract OracleDynamicBoundsTest is Test {
4444
}
4545

4646
mapping(address => ExpectedParams) internal expectedParams; // asset => expected params
47-
mapping(address => NewAggregator) internal newAggregators; // asset => new aggregator address
47+
mapping(address => NewAggregator) internal newAggregators; // asset => new aggregator
4848

4949
IAaveOracle internal oracle;
5050
function setUp() public {
@@ -155,6 +155,7 @@ contract OracleDynamicBoundsTest is Test {
155155
isActionTakingEnabled: false
156156
});
157157

158+
// check that param registry admin are set properly
158159
function test_registry_admin() external {
159160
(bool success, bytes memory data) = AaveV3HorizonEthereum.PARAM_REGISTRY.call(
160161
abi.encodeWithSignature('owner()')
@@ -208,6 +209,7 @@ contract OracleDynamicBoundsTest is Test {
208209
test_new_aggregator(asset);
209210
}
210211

212+
// test param registry params are configured properly
211213
function test_registry_params(address asset) internal {
212214
bool success;
213215
bytes memory data;
@@ -247,12 +249,12 @@ contract OracleDynamicBoundsTest is Test {
247249
assertEq(isActionTakingEnabled, expectedParam.isActionTakingEnabled, 'isActionTakingEnabled');
248250
}
249251

250-
/// test that the oracle source from horizon adapter/oracle source is the same as the oracle address from the param registry
252+
/// test that the oracle source from horizon protocol adapter is the same as the oracle address from the param registry
251253
function test_horizon_adapter(address asset, address oracleSource, bool isAdapter) internal {
252254
bool success;
253255
bytes memory data;
254256
if (isAdapter) {
255-
// if adapter, get oracle source from horizon adapter source
257+
// if adapter, get oracle source from horizon adapter
256258
(success, data) = oracleSource.call(abi.encodeWithSignature('source()'));
257259
require(success, 'Failed to call source()');
258260
oracleSource = abi.decode(data, (address));
@@ -261,7 +263,7 @@ contract OracleDynamicBoundsTest is Test {
261263
assertEq(oracleSource, oracle, 'source');
262264
}
263265

264-
// read look back data from param registry
266+
// test look back data from param registry is valid
265267
function test_lookback_data(address asset) internal {
266268
bool success;
267269
bytes memory data;
@@ -297,9 +299,8 @@ contract OracleDynamicBoundsTest is Test {
297299
assertGt(answeredInRound, 0, 'lookback answeredInRound');
298300
}
299301

302+
// test new aggregator data is valid; enough rounds for lookback window and valid answers
300303
function test_new_aggregator(address asset) internal {
301-
// new aggregator data
302-
303304
vm.prank(newAggregators[asset].readAdmin); // has access to price feed
304305
(
305306
uint80 roundId,

0 commit comments

Comments
 (0)