feat: add batch_approve_milestones to crowdfund_vault#981
Open
Mayorlay wants to merge 2 commits into
Open
Conversation
- Accept up to 10 milestone decisions per call (BatchTooLarge/EmptyBatch guards) - Per-item MilestoneApprovedEvent identifies each processed milestone ID - Summary BatchMilestoneProcessedEvent emitted once per batch - Skips missing projects and already-approved milestones deterministically - Add BatchMilestoneDecision contracttype and BatchMilestoneProcessedEvent - 6 new tests covering happy path and all guard conditions
|
@Mayorlay Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@Mayorlay please fix workfow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds batch_approve_milestones to the crowdfund_vault Soroban contract, allowing maintainers to
approve multiple project milestones in a single transaction instead of one call per milestone.
Changes
src/errors.rs
src/events.rs
src/lib.rs
src/test.rs
oversized_batch_fails, non_admin_fails, paused_fails
Acceptance criteria
┌──────────────────────────────────────────┬───────────────┐
│ Criterion │ How satisfied │
├──────────────────────────────────────────┼───────────────────────────────────┤
│ Contract accepts a bounded batch payload │ BatchTooLarge guard at > 10 items │
├──────────────────────────────────────────┼────────────────────────────────────────────────┤
│ Per-item outcomes are deterministic │ Missing/already-approved items are always │
│ │ skipped; no partial-fail rollback │
├──────────────────────────────────────────┼────────────────────────────────────────────────┤
├───────────────────────────────────┼──────────────────────────────────────────────────────┤
│ Events identify processed │ MilestoneApprovedEvent { project_id, milestone_id } │
│ milestone IDs │ fired per approved item │
├─────────────────────────────────┼────────────────────────────────────────────────────────┤
│ Guards prevent oversized or │ EmptyBatch, BatchTooLarge, Unauthorized, │
│ inconsistent batches │ ContractPaused all checked before mutations │
└─────────────────────────────────┴────────────────────────────────────────────────────────┘
Testing
All existing tests remain unmodified. Run new tests with:
cargo test -p crowdfund_vault -- batch_approve_milestones
▸ Closes #869