Skip to content

Fix/issues 130 132 138 140 - #308

Merged
EmmanuelOchaje merged 5 commits into
StellarTickets:mainfrom
Alaka-ibr:fix/issues-130-132-138-140
Sep 29, 2026
Merged

EmmanuelOchaje merged 5 commits into
StellarTickets:mainfrom
Alaka-ibr:fix/issues-130-132-138-140

Conversation

@Alaka-ibr

Copy link
Copy Markdown
Contributor

Summary

Closes #130, Closes #132, Closes #138, Closes #140.


Changes

#130 — Reject revocation of already revoked tickets

revoke_ticket, revoke_with_refund, and revoke_batch previously silently
accepted a second revocation on an already-revoked ticket. They now return
Error::Revoked immediately, making the duplicate call a hard failure.

Tests added:

  • revoke_ticket_rejects_already_revoked_ticket
  • revoke_with_refund_rejects_already_revoked_ticket
  • revoke_batch_rejects_already_revoked_ticket

#132 — Reject check_in for tickets in Resale status

check_in and check_in_batch now return the new Error::ResaleListingActive
(code 42) when the target ticket has TicketStatus::Resale. The owner must
cancel the listing before checking in. The error is documented in ERRORS.md
and classified as a permanent client error (no retry).

Tests added:

  • check_in_rejects_resale_listed_ticket
  • check_in_batch_rejects_resale_listed_tickets

#138 — Add proptest fuzz targets for price/cap math and state transitions

Adds contracts/ticketing/src/test/proptests.rs with five property-based tests
backed by proptest 1.6:

Test Cases Type
prop_resale_cap_math 500 pure arithmetic
prop_royalty_split_math 500 conservation of funds
prop_resale_floor_and_cap_bounds 500 boundary arithmetic
prop_on_chain_resale_cap_and_settlement 20 on-chain
prop_ticket_state_transitions 25 on-chain state machine

A dedicated Proptest step is added to .github/workflows/ci.yml and runs on
every push and pull request against main with PROPTEST_CASES=64.


#140 — Test maximum resale cap boundary with rounding

Integer division in list_for_resale truncates towards zero
(original_price * bps / 10_000), so the computed cap is always a whole number
that is never rounded up. The new test resale_cap_boundary_with_rounding_truncates_down
exercises five cases where original_price * bps % 10_000 != 0, asserting that
cap + 1 is rejected and exactly cap is accepted. Rounding behaviour is
documented in docs/CAP_ROYALTY_ROUNDING.md.


Test results

Ensure revoke_ticket, revoke_with_refund, and revoke_batch return Error::Revoked when attempting to revoke an already revoked ticket.
Enforce policy that tickets actively listed for resale must be cancelled before check-in, returning Error::ResaleListingActive (42).
Add tests for prices where original_price * bps is not evenly divisible by 10000, asserting cap truncation and documenting rounding behavior.
Introduces contracts/ticketing/src/test/proptests.rs with three pure-math properties (resale cap, royalty split, floor/cap bounds) and two on-chain properties (cap+settlement, ticket state-machine). CI runs them at PROPTEST_CASES=64 via a dedicated Proptest step added to .github/workflows/ci.yml.
@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for stellarticketscontracts ready!

Name Link
🔨 Latest commit 5f90c91
🔍 Latest deploy log https://app.netlify.com/projects/stellarticketscontracts/deploys/6abb709aeb603d0008b11eb1
😎 Deploy Preview https://deploy-preview-308--stellarticketscontracts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Resolve merge conflict in contracts/ticketing/src/error.rs by retaining codes 35-41, code 42 (ResaleListingActive), and assigning code 43 to InvalidTicketLifecycle. Update docs/ERRORS.md and restore label validation and organizer allowlist checks in lib.rs.
@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@Alaka-ibr 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

@EmmanuelOchaje
EmmanuelOchaje merged commit 0f4bdc4 into StellarTickets:main Sep 29, 2026
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

2 participants