Skip to content

Commit 6c13435

Browse files
committed
fix: adjust cross-rate price feed tests to ensure fresh price round data
1 parent 5e0df9c commit 6c13435

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ jobs:
1818
- uses: go-semantic-release/action@2e9dc4247a6004f8377781bef4cb9dad273a741f # v1.24.1
1919
with:
2020
github-token: ${{ secrets.GITHUB_TOKEN }}
21-
force-bump-patch-version: true # ensure patch version updates trigger releases

test/infrastructure/CrossRatePriceFeed.t.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ contract CrossRatePriceFeedTest is Test {
3838
(,,, uint256 numeratorUpdatedAt,) = usdcUsdFeed.latestRoundData();
3939
(,,, uint256 denominatorUpdatedAt,) = ethUsdFeed.latestRoundData();
4040

41-
// Warp to the later of the two update times to ensure both are fresh
42-
uint256 latestUpdate = numeratorUpdatedAt > denominatorUpdatedAt ? numeratorUpdatedAt : denominatorUpdatedAt;
43-
vm.warp(latestUpdate);
41+
// Warp to just before the earliest feed expiration
42+
uint256 numeratorExpiry = numeratorUpdatedAt + USDC_USD_HEARTBEAT;
43+
uint256 denominatorExpiry = denominatorUpdatedAt + ETH_USD_HEARTBEAT;
44+
uint256 minExpiry = numeratorExpiry < denominatorExpiry ? numeratorExpiry : denominatorExpiry;
45+
vm.warp(minExpiry - 1);
4446
}
4547

4648
/// @notice test constructor reverts with zero numerator feed

0 commit comments

Comments
 (0)