Skip to content

test(shipment): add idempotency window boundary regression tests#414

Merged
dinahmaccodes merged 1 commit into
Navin-xmr:mainfrom
CHEF-SAVY:feat/Add-regression-tests-for-shipment-creation-idempotency-boundaries
May 30, 2026
Merged

test(shipment): add idempotency window boundary regression tests#414
dinahmaccodes merged 1 commit into
Navin-xmr:mainfrom
CHEF-SAVY:feat/Add-regression-tests-for-shipment-creation-idempotency-boundaries

Conversation

@CHEF-SAVY
Copy link
Copy Markdown
Contributor

Closes #366

Add two regression tests to test_replay_protection.rs that prove create_shipment deduplication is bounded by the idempotency window:

  • test_idempotency_create_shipment_replay_within_window_rejected: immediate replay returns DuplicateAction ([CONTRACT] Implement escrow deposit for shipments #41)
  • test_idempotency_create_shipment_replay_after_window_accepted: same payload succeeds after advancing 61 ledgers past the 60-ledger TTL (300 s ÷ 5 s/ledger)

Also adds advance_past_idempotency_window() to test_utils for reuse.

Add two regression tests to test_replay_protection.rs that prove
create_shipment deduplication is bounded by the idempotency window:

- test_idempotency_create_shipment_replay_within_window_rejected:
  immediate replay returns DuplicateAction (Navin-xmr#41)
- test_idempotency_create_shipment_replay_after_window_accepted:
  same payload succeeds after advancing 61 ledgers past the 60-ledger
  TTL (300 s ÷ 5 s/ledger)

Also adds advance_past_idempotency_window() to test_utils for reuse.
@dinahmaccodes dinahmaccodes merged commit 537bef8 into Navin-xmr:main May 30, 2026
2 of 5 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] Add regression tests for shipment creation idempotency boundaries

2 participants