Skip to content

Replace public distribution with winner claim lifecycle - #447

Merged
3m1n3nc3 merged 2 commits into
geevapp:mainfrom
Birdmannn:main
Aug 30, 2026
Merged

Replace public distribution with winner claim lifecycle #447
3m1n3nc3 merged 2 commits into
geevapp:mainfrom
Birdmannn:main

Conversation

@Birdmannn

Copy link
Copy Markdown
Contributor

Pull Request Template

Description

this PR closes #405

test(giveaway): add two edge-case tests for claim lifecycle

What changed

test.rs

Added two tests to cover gaps in the existing claim lifecycle suite:

test_pick_winner_emits_winner_selected_event
Verifies that pick_winner emits a GiveawayWinnerSelected event with the correct topics (giveaway, winner, winner address) and that the prize_amount in the data vec equals the full gross share before any fee deduction.

test_partial_claim_creator_receives_exact_unclaimed_gross_shares
3-winner giveaway where only winner-0 claims before the deadline. After the window expires, asserts the creator recovers exactly the two unclaimed gross shares with no fee deduction on recovery, and the contract retains only the fee from the single successful claim.

Test results

  • 143 → 145 passing, 0 failing

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.

@3m1n3nc3
3m1n3nc3 merged commit 73c138e into geevapp:main Aug 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.

[Giveaway] Replace public distribution with winner claim lifecycle

2 participants