Fix/issues 130 132 138 140 - #308
Merged
EmmanuelOchaje merged 5 commits intoSep 29, 2026
Merged
Conversation
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.
✅ Deploy Preview for stellarticketscontracts ready!
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.
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #130, Closes #132, Closes #138, Closes #140.
Changes
#130 — Reject revocation of already revoked tickets
revoke_ticket,revoke_with_refund, andrevoke_batchpreviously silentlyaccepted a second revocation on an already-revoked ticket. They now return
Error::Revokedimmediately, making the duplicate call a hard failure.Tests added:
revoke_ticket_rejects_already_revoked_ticketrevoke_with_refund_rejects_already_revoked_ticketrevoke_batch_rejects_already_revoked_ticket#132 — Reject check_in for tickets in Resale status
check_inandcheck_in_batchnow return the newError::ResaleListingActive(code 42) when the target ticket has
TicketStatus::Resale. The owner mustcancel the listing before checking in. The error is documented in
ERRORS.mdand classified as a permanent client error (no retry).
Tests added:
check_in_rejects_resale_listed_ticketcheck_in_batch_rejects_resale_listed_tickets#138 — Add proptest fuzz targets for price/cap math and state transitions
Adds
contracts/ticketing/src/test/proptests.rswith five property-based testsbacked by
proptest 1.6:prop_resale_cap_mathprop_royalty_split_mathprop_resale_floor_and_cap_boundsprop_on_chain_resale_cap_and_settlementprop_ticket_state_transitionsA dedicated
Propteststep is added to.github/workflows/ci.ymland runs onevery push and pull request against
mainwithPROPTEST_CASES=64.#140 — Test maximum resale cap boundary with rounding
Integer division in
list_for_resaletruncates towards zero(
original_price * bps / 10_000), so the computed cap is always a whole numberthat is never rounded up. The new test
resale_cap_boundary_with_rounding_truncates_downexercises five cases where
original_price * bps % 10_000 != 0, asserting thatcap + 1is rejected and exactlycapis accepted. Rounding behaviour isdocumented in
docs/CAP_ROYALTY_ROUNDING.md.Test results