Fix/revert 616 618 restore 503 - #722
Conversation
…ransfer (Iris-IV#453) Prevents users from wasting a Freighter signature when the contract is paused. The paused check now happens before pending.require_auth().
…ed payload The update_campaign function now emits (old_title, old_description, title, event_description) as a 4-tuple, but the tests were still unpacking as a 2-tuple (String, String), causing HostError(UnexpectedSize). Updated test_update_campaign_emits_title_and_description and test_update_campaign_event_tracks_latest_description to unpack the 4-tuple and assert against the correct indices (2 and 3 for new values).
…sonal_cap (Iris-IV#503) Reverts the broken duplicate contract and stray files shipped by two bad merges, and properly re-implements the feature they attempted: - Remove the stray `#[contract] ProofOfHeartContract` duplicate contract (list_active_campaigns with tag_filter, category max-goal caps) from lib.rs/admin.rs, leaving the real ProofOfHeart contract as the only one. - Delete orphaned files from Iris-IV#616/Iris-IV#618 that referenced the removed contract or were stray: src/proof_of_heart/, src/tests/voting_tests.rs, src/events.ts, src/types.ts, src/campaigns.rs, src/clients.rs, src/test.rs, and the frontend/ directory (no build setup; README references a separate frontend repo). - Re-implement issue Iris-IV#503 properly on the real contract: public remove_personal_cap(campaign_id, contributor) entrypoint that removes a contributor's personal contribution cap (requires contributor auth and an active campaign), new Error::PersonalCapNotFound (46), and a personal_cap_removed event. - Update docs: AUTHORIZATION.md, EVENT_PAYLOADS.md (count 49), CHANGELOG.md, and merge the duplicated sections of CAMPAIGN_LIFECYCLE.md into one coherent document (DataKey -> AdminKey renames). - Add tests covering restore/remove flow, event shape, not-found and inactive-campaign errors, and contributor auth recording. All 405 tests pass; cargo check, fmt, clippy clean.
- Removed the redundant explicit match self block in Error::name() that duplicated the error_names! macro, making the macro dead code. Added PersonalCapNotFound to the error_names! variant list instead. - Fixed the display_matches_variant_name test where the PersonalCapNotFound assertion was incorrectly inserted, breaking the InvalidStateTransition assertion syntax. - Updated stale comment (45 -> 46 variants).
|
really solid cleanup. i traced the fallout from #616/#618 and confirmed this diff against current main only deletes the two leftover frontend files (MilestoneProgressBar.tsx and types/campaign.ts), nothing else, so no recently merged work gets caught in the revert. the remove_personal_cap implementation mirrors set_personal_cap's guards nicely, the PersonalCapNotFound-instead-of-silent-noop choice is the right call for indexers, and the auth invocation test is exactly the kind of assertion i like to see. the CAMPAIGN_LIFECYCLE.md de-dup was overdue too. one note, not blocking:
update: i merged #609 just now and that flipped this branch to conflicting (the test_campaign_update.rs hunks overlap). please rebase onto current main and push, the conflicts should be trivial since the hunks are near-identical. once ci is green again i'll merge right away, this is approved in substance. |
📌 Description
Provide a clear and concise description of the changes in this PR.
🔗 Related Issues
Use GitHub's auto-close keywords with the
#prefix (one issue per line):Closes #453
Fixes #456
Resolves #789
Multiple issues can be closed by repeating the keyword on separate lines.
🧪 Changes Made
✅ Checklist
If this PR introduces breaking changes, describe them here.
📸 Screenshots (if applicable)
Add screenshots to help reviewers understand the changes.
🧩 Additional Notes
Anything else reviewers should know.