Skip to content

Feat/issue127 standardize status#148

Merged
Otaiki1 merged 2 commits into
crackedstudio:masterfrom
OSEH-svg:feat/issue127-standardize-status
Apr 27, 2026
Merged

Feat/issue127 standardize status#148
Otaiki1 merged 2 commits into
crackedstudio:masterfrom
OSEH-svg:feat/issue127-standardize-status

Conversation

@OSEH-svg
Copy link
Copy Markdown
Contributor

closes #127

Changes Made

  1. Standardized RaffleStatus Enum
    Renamed Open to Active: The variant RaffleStatus::Open has been renamed to RaffleStatus::Active to align with the terminology used in logic checks and to fulfill the requirement for consistency.
    Updated All References: Audited and updated every occurrence of RaffleStatus::Open in mod.rs, lib.rs, and test.rs.
  2. Resolved Logic Inconsistencies
    buy_tickets Fix: Updated the logic in buy_tickets to ensure it only proceeds if the raffle status is Active and the prize has been deposited. This resolves the reported inconsistency where tickets could be purchased before the raffle was fully "Active" (i.e., prize-backed).
    finalize_raffle Audit: Verified that finalize_raffle correctly transitions a raffle from Active to Drawing only when the expiration or ticket-count conditions are met, ensuring state integrity.
  3. Test Suite Stabilization
    Fixed Failing Panic Tests: The rename and the addition of the prize_deposited check resolved several failing unit tests (e.g., test_invalid_state_transition_buy_before_deposit) that were previously passing incorrectly.
    Updated Mocking: Ensured all test cases use the new Active variant, maintaining a passing build.
    Verification Results
    Status Consistency: All RaffleStatus variants are now used consistently across the codebase.
    Test Results: Core raffle flow tests and status-transition tests (like test_basic_internal_raffle_flow) are passing.
    Build: cargo check and cargo test verify the structural integrity of the changes.

@Otaiki1 Otaiki1 merged commit b14aacf into crackedstudio:master Apr 27, 2026
1 check failed
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.

[Stellar Wave] Core: Standardize Raffle Status Across Contract

2 participants