Skip to content

test: add redemption-window overlap rejection test (Closes #552) - #696

Merged
thlpkee20-wq merged 2 commits into
RevoraOrg:masterfrom
Chummy-debug:test/redemption-overlap-reject
Jul 29, 2026
Merged

test: add redemption-window overlap rejection test (Closes #552)#696
thlpkee20-wq merged 2 commits into
RevoraOrg:masterfrom
Chummy-debug:test/redemption-overlap-reject

Conversation

@Chummy-debug

Copy link
Copy Markdown
Contributor

Description

Re-adds set_redemption_window / get_redemption_window (accidentally removed in commit 6939ad3) with overlap protection: setting a second window that collides with an existing unconsumed window is rejected with RedemptionWindowOverlap.

Changes

  • src/lib.rs: Added RedemptionWindowOverlap = 77 error variant; re-added set_redemption_window and get_redemption_window in the #[contractimpl] block with overlap checking; restored missing DataKey2 variants referenced by active code
  • src/test_redemption.rs: Added set_redemption_window_rejects_overlap (left/right/containment/surround) and set_redemption_window_allows_contiguous_non_overlapping (end==start boundary)
  • src/structured_error_tests.rs: Registered the new variant for discriminant uniqueness
  • tools/storage_layout_schema.rs: Synced registry with source enums

Overlap definition

Two windows [a_start, a_end) and [b_start, b_end) overlap when a_start < b_end && b_start < a_end. Adjacent windows (end == start) are allowed.

Build note

upstream/master has pre-existing compilation errors unrelated to this PR (appear on a clean checkout before these changes).

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

Hey @Chummy-debug! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#552 Add redemption-window overlap test asserting rejection when two windows collide Link to this issue

ℹ️ Learn more about linking PRs to issues

@thlpkee20-wq
thlpkee20-wq merged commit 3cdc3f6 into RevoraOrg:master Jul 29, 2026
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.

3 participants