Skip to content

Feat/auto suspend#272

Merged
Kaylahray merged 4 commits intogeevapp:mainfrom
Birdmannn:feat/auto-suspend
Mar 30, 2026
Merged

Feat/auto suspend#272
Kaylahray merged 4 commits intogeevapp:mainfrom
Birdmannn:feat/auto-suspend

Conversation

@Birdmannn
Copy link
Copy Markdown
Contributor

Pull Request Template

Description

Auto-Suspension Circuit Breaker (flag_content)

types.rs

  • Added Suspended variant to GiveawayStatus and HelpRequestStatus
  • Added AlreadyFlagged = 19 to Error
  • Added Debug derive to GiveawayStatus
  • Added DataKey::FlagRecord(u64, Address) and DataKey::FlagCount(u64)

governance.rs (new file)

  • FLAG_THRESHOLD = 10 constant
  • flag_content — flags content, prevents duplicates, increments count, triggers auto-suspension when threshold is reached
  • ContentFlagged and ContentAutoSuspended events
  • auto_suspend — internal helper that sets status to Suspended on the matching Giveaway or HelpRequest

mutual_aid.rs

  • donate now also rejects requests with Suspended status (alongside Cancelled)

lib.rs

  • Registered governance module and re-exported GovernanceContract / GovernanceContractClient

test.rs

  • test_giveaway_suspended_at_threshold — verifies status flips to Suspended on the 10th flag
  • test_help_request_suspended_at_threshold — same for HelpRequest
  • test_content_auto_suspended_event_emitted — verifies content_auto_suspended event topic
  • test_enter_suspended_giveaway_fails — entry rejected on suspended giveaway
  • test_donate_to_suspended_request_fails — donation rejected on suspended request

Checklist

  • I have tested my changes locally
  • I have updated documentation as needed
  • I have run npx prisma generate after schema changes
  • I have run npx prisma migrate dev or npx prisma migrate deploy as appropriate

Post-Merge Steps for Maintainers

If this PR includes changes to the Prisma schema:

  1. Run the following command to apply the migration to your database:

    npx prisma migrate deploy

    or, for local development:

    npx prisma migrate dev
  2. Ensure your CI pipeline runs the migration before tests (add this step if missing):

    - name: Run Prisma Migrate
      run: npx prisma migrate deploy
  3. Make sure the database user in CI has permission to run migrations.


If you have any questions, please comment on this PR.
This PR Closes #211

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@Birdmannn 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! 🚀

Learn more about application limits

@3m1n3nc3 3m1n3nc3 requested a review from Kaylahray March 30, 2026 12:49
@Kaylahray Kaylahray merged commit cd777c8 into geevapp:main Mar 30, 2026
2 checks passed
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.

Auto-Hide Flagged Content

2 participants