test(pair): claim/clean owner + no-transfer coverage (#271) #734

Merged
Brouie merged 1 commit from qa/271-claim-clean-test-coverage into main 2026-06-02 14:21:11 +00:00
Brouie commented 2026-06-02 12:45:11 +00:00 (Migrated from gitlab.com)

Tests-only follow-ups for #271 (closes the #263 / #264 coverage gaps). No wasm behavior change — only limit_order_tests.rs + contracts-security-audit.md.

Adds three integration tests:

  • clean_limit_book_emits_no_cw20_transfers (#263 / audit L15) — force-dust CleanLimitBook parks a sub-threshold bid with zero CW20 transfer to the maker in the clean tx, checked by both event scan and maker balance-delta. The scanner is self-checked against the real transfer in the claim tx so the clean-tx assertion can't pass vacuously. The owner claim then pays the full remaining, which also proves PENDING_ESCROW was untouched by the clean.
  • claim_expired_limit_order_non_owner_rejected (#264 / audit L1) — non-owner ClaimExpiredLimitOrder -> Unauthorized; parked row + maker/attacker balances unchanged; owner can still claim afterward. Mirror of cancel_limit_order_non_owner_rejected.
  • batch_claim_expired_foreign_owner_reverts_whole_tx (audit L11, the optional stretch) — foreign-owner batch claim reverts the whole tx, both rows persist. Twin of batch_cancel_foreign_owner_reverts_whole_tx.

Covered the force-dust clean path only — both force and time-expiry park through the same park_limit_order_for_clean path (L15/L16), so per the issue one test suffices.

contracts-security-audit.md L1/L11/L15 cite the new test names.

Verification:

  • make test-contracts: 405 passed, 0 failed (was 402).
  • cargo test -p cl8y-dex-tests limit_order: 71 passed, 0 failed.
  • cargo clippy -p cl8y-dex-tests --tests: clean.
  • No wasm code diff.

Closes #271 once merged.

Tests-only follow-ups for #271 (closes the #263 / #264 coverage gaps). No wasm behavior change — only `limit_order_tests.rs` + `contracts-security-audit.md`. Adds three integration tests: - `clean_limit_book_emits_no_cw20_transfers` (#263 / audit L15) — force-dust `CleanLimitBook` parks a sub-threshold bid with **zero CW20 transfer to the maker** in the clean tx, checked by **both** event scan and maker balance-delta. The scanner is self-checked against the real transfer in the claim tx so the clean-tx assertion can't pass vacuously. The owner claim then pays the **full** remaining, which also proves `PENDING_ESCROW` was untouched by the clean. - `claim_expired_limit_order_non_owner_rejected` (#264 / audit L1) — non-owner `ClaimExpiredLimitOrder` -> `Unauthorized`; parked row + maker/attacker balances unchanged; owner can still claim afterward. Mirror of `cancel_limit_order_non_owner_rejected`. - `batch_claim_expired_foreign_owner_reverts_whole_tx` (audit L11, the optional stretch) — foreign-owner batch claim reverts the whole tx, both rows persist. Twin of `batch_cancel_foreign_owner_reverts_whole_tx`. Covered the force-dust clean path only — both force and time-expiry park through the same `park_limit_order_for_clean` path (L15/L16), so per the issue one test suffices. `contracts-security-audit.md` L1/L11/L15 cite the new test names. Verification: - `make test-contracts`: 405 passed, 0 failed (was 402). - `cargo test -p cl8y-dex-tests limit_order`: 71 passed, 0 failed. - `cargo clippy -p cl8y-dex-tests --tests`: clean. - No wasm code diff. Closes #271 once merged.
Brouie commented 2026-06-02 12:45:36 +00:00 (Migrated from gitlab.com)

mentioned in issue #271

mentioned in issue #271
PlasticDigits commented 2026-06-02 14:21:12 +00:00 (Migrated from gitlab.com)

mentioned in commit 12308a3803

mentioned in commit 12308a3803962cb57308d8564be4f540d1ee9d93
PlasticDigits (Migrated from gitlab.com) merged commit 12308a3803 into main 2026-06-02 14:21:12 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!734
No description provided.