Skip to content

Feat/test zero price free ticket#355

Merged
Yunusabdul38 merged 2 commits intoAgora-Events:mainfrom
Coredevjay:feat/test-zero-price-free-ticket
Mar 29, 2026
Merged

Feat/test zero price free ticket#355
Yunusabdul38 merged 2 commits intoAgora-Events:mainfrom
Coredevjay:feat/test-zero-price-free-ticket

Conversation

@Coredevjay
Copy link
Copy Markdown
Contributor

Closes #322

Summary

Adds test_free_ticket.rs — a dedicated test suite for zero-price (free) ticket handling in the EventRegistry contract.

Tests added

  • Inventory increments correctly for a free tier (current_supply + current_sold)
  • Global tickets-sold counter is updated
  • No token-transfer calls are made (registry never touches tokens)
  • Bulk quantity purchase (qty > 1) works for free tiers
  • tier_limit cap is enforced even at price = 0
  • max_supply cap is enforced even at price = 0
  • decrement_inventory (refund path) rolls back supply counters
  • quantity = 0 is rejected with InvalidQuantity
  • Unauthorized caller is rejected

Adds module-level documentation covering Overview, Architecture, and
Usage sections as requested in issue Agora-Events#323. Explains the EventRegistry
module structure, key data types, storage strategy, and how
EventRegistry interacts with the TicketPayment contract for inventory
management during purchase and refund flows.
Adds test_free_ticket.rs covering the full free-ticket (price=0) surface:

- increment_inventory succeeds and updates current_supply + current_sold
- global tickets-sold counter is incremented
- no token-transfer calls are made (registry never touches tokens)
- bulk quantity purchase (qty > 1) works correctly
- tier_limit cap is enforced for free tiers
- max_supply cap is enforced for free tiers
- decrement_inventory (refund path) rolls back supply counters
- quantity=0 is rejected with InvalidQuantity
- unauthorized caller is rejected (should_panic)
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

@Coredevjay is attempting to deploy a commit to the oseh-svg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

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

@Yunusabdul38
Copy link
Copy Markdown
Contributor

@Coredevjay fix failling ci check

@Yunusabdul38 Yunusabdul38 merged commit 816e60e into Agora-Events:main Mar 29, 2026
1 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.

[Contract] Unit Test: zero-price free ticket

2 participants