fix(crowdfund): count collected pledges toward milestone voting/refun… - #1387
Merged
afurious merged 2 commits intoAug 24, 2026
Conversation
…d weight collect_pledges() folded collected pledge amounts into TotalRaised (and therefore the frozen MilestoneBasis) but never wrote a DataKey::Contribution record for the pledger. execute_vote_milestone and execute_claim_milestone_refund derive weight solely from DataKey::Contribution, so a campaign funded predominantly or entirely through pledges had milestone governance with no electorate and no way for backers to reclaim their share of a rejected milestone. Fold each successfully collected pledge into the pledger's Contribution record at collection time, and add the pledger to Contributors (capacity permitting) so get_stats and NFT reward minting see them too. Note: this changes fund-accounting semantics going forward only. Existing deployed campaigns with pledges already collected before this fix will still show zero weight for those pledgers unless a storage backfill is performed.
CI's Check, Lint & Test job failed on cargo fmt --all -- --check for the new pledge-funded milestone governance tests added in b07fd40.
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.
closes #1374
…d weight
collect_pledges() folded collected pledge amounts into TotalRaised (and therefore the frozen MilestoneBasis) but never wrote a DataKey::Contribution record for the pledger. execute_vote_milestone and execute_claim_milestone_refund derive weight solely from DataKey::Contribution, so a campaign funded predominantly or entirely through pledges had milestone governance with no electorate and no way for backers to reclaim their share of a rejected milestone.
Fold each successfully collected pledge into the pledger's Contribution record at collection time, and add the pledger to Contributors (capacity permitting) so get_stats and NFT reward minting see them too.
Note: this changes fund-accounting semantics going forward only. Existing deployed campaigns with pledges already collected before this fix will still show zero weight for those pledgers unless a storage backfill is performed.
Description
Related Issues
Closes #
Type of Change
Required CI Checks
The following status checks must pass before this PR can be merged:
Frontend CI (
frontend_ci.yml—ci-frontendjob):pnpm --filter @stellar-raise/frontend typecheck)pnpm --filter @stellar-raise/frontend test)pnpm lint)pnpm format:check)Rust CI (
rust_ci.yml—checkjob):cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo build --release --target wasm32-unknown-unknowncargo test --workspaceChecklist
develop, notmaincargo fmt --alland the code is properly formattedcargo clippy --all-targets -- -D warningswith no warningscargo testand all tests passpnpm typecheckwith no type errorspnpm testand all frontend tests passpnpm lintwith no ESLint errorspnpm format:checkwith no formatting violations///doc commentsCHANGELOG.mdif applicableScreenshots / Logs (if applicable)
Additional Notes