Skip to content

test(fulfill): cover validateAndSanitizeFromOrderStatus and isOrderFulfillable - #1001

Open
devorun wants to merge 1 commit into
ProjectOpenSea:mainfrom
devorun:test/order-status-fulfill-helpers
Open

test(fulfill): cover validateAndSanitizeFromOrderStatus and isOrderFulfillable#1001
devorun wants to merge 1 commit into
ProjectOpenSea:mainfrom
devorun:test/order-status-fulfill-helpers

Conversation

@devorun

@devorun devorun commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends test/fulfill-utils.spec.ts to the two order-status helpers in utils/fulfill.ts that gate a fulfill on an order's onchain status. Both were previously only exercised indirectly through the hardhat-backed fulfill specs.

  • validateAndSanitizeFromOrderStatus — throws on a fully filled order, throws on a cancelled order, and wipes the signature of an already-validated one (to save the gas of re-supplying it), otherwise returns the order untouched. Tests cover each path, that the filled check is reported before the cancelled one, that a partial fill is not treated as filled, and that the returned object for a validated order is a fresh copy (the caller's order is left intact).
  • isOrderFulfillable — the non-throwing mirror used by batch fulfill to drop stale orders and settle the rest. Tests cover open / partially filled (true), fully filled / cancelled (false), and the zero-totalSize guard (a never-filled order stays fulfillable rather than dividing by zero).

Testing

  • hardhat testfulfill-utils.spec.ts passes (19 tests, 11 new)

…lfillable

Extend fulfill-utils.spec.ts to the two order-status helpers that gate a
fulfill on an order's onchain status. validateAndSanitizeFromOrderStatus
throws on a filled or cancelled order and wipes the signature of an
already-validated one; isOrderFulfillable mirrors those rejections without
throwing so a batch fulfill can drop stale orders and settle the rest.
Covers the filled/cancelled/validated paths, the filled-before-cancelled
ordering, partial fills, and the zero-totalSize guard.
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.

1 participant