-
Notifications
You must be signed in to change notification settings - Fork 260
test(pulse): add tests for price updates removal and max price IDs validation #2676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(pulse): add tests for price updates removal and max price IDs validation #2676
Conversation
Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
Closing due to inactivity for more than 7 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Devin please fix my comments.
@tejasbadadare you can approve and merge it when it fixes the tests
); | ||
|
||
// - Verify that the removed price ID is not included in the returned prices | ||
for (uint i = 0; i < allPricesAfterUpdate.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this for is unnecessary, but why we cannot check all the priceIds directly? Does the order change?
allPricesAfterUpdate.length, | ||
updatedParams.priceIds.length, | ||
"Number of returned prices should match number of price IDs in subscription" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also test the behaviour of getting the price of the removed feed?
Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
…evin/1747075585-add-pulse-scheduler-tests
Add tests for PulseScheduler
This PR adds two new test cases to the PulseScheduler test suite:
testUpdateSubscriptionRemovesPriceUpdatesForRemovedPriceIds()
- Verifies that after updating a subscription's price IDs list, thepriceUpdates
mapping no longer contains price data for removed price IDs.testUpdateSubscriptionRevertsWithTooManyPriceIds()
- Asserts thatupdateSubscription
reverts ifpriceIds.length > MAX_PRICE_IDS_PER_SUBSCRIPTION
.Both tests pass when run with forge test and the code passes linting checks.
Link to Devin run: https://app.devin.ai/sessions/01e1cd793ef8465090357079505e07c0
Requested by: Tejas Badadare