Skip to content

Commit 3392e26

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

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ 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+
// For both to be fresh: block.timestamp <= updatedAt + heartbeat for each // Warp to min(numeratorUpdatedAt + heartbeat, denominatorUpdatedAt + heartbeat) - 1
42+
uint256 numeratorExpiry = numeratorUpdatedAt + USDC_USD_HEARTBEAT;
43+
uint256 denominatorExpiry = denominatorUpdatedAt + ETH_USD_HEARTBEAT;
44+
uint256 minExpiry = numeratorExpiry < denominatorExpiry ? numeratorExpiry : denominatorExpiry;
45+
46+
vm.warp(minExpiry - 1);
4447
}
4548

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

0 commit comments

Comments
 (0)