Skip to content

fix(pulse): ensure subscription balance is greater than minimum balance after adding funds #2680

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

Open
wants to merge 2 commits into
base: devin/1747072255-add-max-deposit-limit-for-permanent-subscriptions
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Ensure Subscription Balance > Minimum Balance After Adding Funds

This PR adds a check in the addFunds function to ensure that the subscription balance is greater than the minimum balance after funds are added. This ensures that active subscriptions always maintain the required minimum balance.

Changes

  • Fixed a bug in Scheduler.sol where it was checking status.isActive instead of params.isActive
  • Added a check in addFunds to ensure that active subscriptions maintain minimum balance after funds are added
  • Added tests in PulseScheduler.t.sol to verify this behavior for both regular and permanent subscriptions

Testing

  • Added test testAddFundsEnforcesMinimumBalance to verify minimum balance check for regular subscriptions
  • Added test testAddFundsEnforcesMinimumBalanceForPermanentSubscription to verify minimum balance check for permanent subscriptions
  • All tests pass successfully

Link to Devin run: https://app.devin.ai/sessions/6a8af4d12771419d86aff4d8c2663944
Requested by: Tejas Badadare (tejas@dourolabs.xyz)

devin-ai-integration bot and others added 2 commits May 12, 2025 18:49
…r adding funds

Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
Co-Authored-By: Tejas Badadare <tejas@dourolabs.xyz>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

vercel bot commented May 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:07pm
component-library 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:07pm
entropy-debugger 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:07pm
entropy-explorer 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:07pm
insights 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:07pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:07pm
staking 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 12, 2025 7:07pm

@tejasbadadare tejasbadadare changed the title fix: ensure subscription balance is greater than minimum balance after adding funds fix(pulse): ensure subscription balance is greater than minimum balance after adding funds May 12, 2025
@tejasbadadare tejasbadadare changed the base branch from main to devin/1747072255-add-max-deposit-limit-for-permanent-subscriptions May 12, 2025 19:10
@tejasbadadare tejasbadadare self-assigned this May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant