Skip to content

Commit 3720575

Browse files
test: address PR comments for price updates removal test
Co-Authored-By: Tejas Badadare <[email protected]>
1 parent 9052d1b commit 3720575

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

target_chains/ethereum/contracts/forge-test/PulseScheduler.t.sol

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,17 +2087,17 @@ contract SchedulerTest is Test, SchedulerEvents, PulseSchedulerTestUtils {
20872087
"Querying all should only return remaining feeds"
20882088
);
20892089

2090-
// - Verify that the removed price ID is not included in the returned prices
2091-
for (uint i = 0; i < allPricesAfterUpdate.length; i++) {
2092-
// We can't directly check the price ID from the Price struct
2093-
// But we can verify that the number of returned prices matches the number of price IDs
2094-
// in the updated subscription, which indirectly confirms that removed price IDs are not included
2095-
assertEq(
2096-
allPricesAfterUpdate.length,
2097-
updatedParams.priceIds.length,
2098-
"Number of returned prices should match number of price IDs in subscription"
2099-
);
2100-
}
2090+
// - Verify that trying to get the price of the removed feed directly reverts
2091+
bytes32[] memory removedIdArray = new bytes32[](1);
2092+
removedIdArray[0] = removedPriceId;
2093+
vm.expectRevert(
2094+
abi.encodeWithSelector(
2095+
InvalidPriceId.selector,
2096+
removedPriceId,
2097+
bytes32(0)
2098+
)
2099+
);
2100+
scheduler.getPricesUnsafe(subscriptionId, removedIdArray);
21012101
}
21022102

21032103
function testUpdateSubscriptionRevertsWithTooManyPriceIds() public {

0 commit comments

Comments
 (0)