Skip to content

fix: consolidate create_event to single clean implementation - #147

Merged
manoahLinks merged 2 commits into
crowdpass-live:mainfrom
jayteemoney:fix/malformed-create-event
Mar 29, 2026
Merged

fix: consolidate create_event to single clean implementation#147
manoahLinks merged 2 commits into
crowdpass-live:mainfrom
jayteemoney:fix/malformed-create-event

Conversation

@jayteemoney

Copy link
Copy Markdown
Contributor

Summary

  • Renames create_event_with_tierscreate_event (accepting CreateEventParams struct) as the single canonical entry point
  • Removes the legacy create_event(organizer, theme, ...) individual-param wrapper that duplicated logic
  • Removes dead validate_event_params helper that was never called
  • Fixes purchase_tickets indentation (3-space → 4-space)
  • Completely rewrites test.rs: fixes unclosed delimiters, removes duplicate fn setup definition, removes orphaned fn create_sample_event, removes duplicate test_create_event, fixes all tests that used the old individual-param API, and fixes broken test bodies with undefined variables
  • All 32 tests pass

Test plan

  • cargo test -p event_manager — 32 tests, 0 failures
  • cargo build — compiles cleanly with no warnings on changed code

Closes #78

…ss-live#78)

Renames create_event_with_tiers to create_event (accepting CreateEventParams),
removes the redundant individual-param legacy wrapper and unused
validate_event_params helper, and completely rewrites the broken test.rs
which had unclosed delimiters, duplicate function definitions, orphaned
code blocks, and references to the old multi-param API. All 32 tests pass.

Closes crowdpass-live#78
@drips-wave

drips-wave Bot commented Mar 28, 2026

Copy link
Copy Markdown

@jayteemoney 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

…live#78)

Accept withdraw_funds from main, remove validate_event_params dead code,
add missing Error variants (EventNotEnded=19, FundsAlreadyWithdrawn=20)
and DataKey variants (EventBalance, FundsWithdrawn, Waitlist) that were
referenced but never declared in the upstream merge. Fix purchase_tickets
to use the escrow model (transfer to contract address, track EventBalance)
so withdraw_funds and claim_refund work correctly. Add
try_promote_from_waitlist stub to satisfy the call site in withdraw_funds.
Align test style with origin/main (try_* + assert pattern) and fix the
broken test_withdraw_funds_double_withdrawal that was testing join_waitlist
instead. All 39 tests pass.
@jayteemoney
jayteemoney force-pushed the fix/malformed-create-event branch from a595f72 to 77be07a Compare March 28, 2026 21:39
@manoahLinks
manoahLinks merged commit ddbb630 into crowdpass-live:main Mar 29, 2026
2 of 4 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.

Fix malformed create_event function in event_manager

2 participants