fix: minor cleanups from grant review (COW-996, COW-999, COW-1003)#80
fix: minor cleanups from grant review (COW-996, COW-999, COW-1003)#80lgahdl wants to merge 2 commits into
Conversation
- COW-1003 [F2]: add CirclesBackingOrder to DETERMINISTIC_ORDER_TYPES; it was already precomputed in uidPrecompute.ts but missing from the set, causing spurious non-deterministic log warnings - COW-996 [F3]: replace nonexistent ConditionalOrderCancelled event reference with accurate description of actual cancellation detection (SingleOrderNotAuthed + C5 singleOrders() sweep) - COW-999 [F10]: remove decode-only-for-logging dead code in settlement.ts; decodeAbiParameters block and console.log were decoding Trade log fields solely for a log line, with no downstream use Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Documentation / CI reviewCOW-996 [F3] — comment in
This is the PR that renames C1→ COW-999 [F10] — dead COW-1003 [F2] — Overall: One actionable item (stale C1/C5 in composableCow.ts comment). No deployment.md or .env.example changes needed. |
|
Review: Minor cleanups (COW-996/999/1003)
The removed block decoded
The type is already in the
Cosmetic; the updated description is more accurate. No code change. Tests in Overall the changes look correct, just flag the |
… precompute (COW-996/999/1003) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| * this is rare — the standard on-chain cancellation path is detected via | ||
| * SingleOrderNotAuthed (OrderDiscoveryPoller) and the CancellationWatcher, | ||
| * both of which work correctly. |
There was a problem hiding this comment.
There was a problem hiding this comment.
Maybe it worth to log this on a issue
There was a problem hiding this comment.
tbh I don't think this tests are relevant. Instead, we should properly handle types related to order types and deterministic order types.
Two things that would make it better:
- replace
isDeterministicOrderTypeto aRecord<OrderType, boolean> - in multiple places, order type is being typed as
stringwhileOrderTypeshould be used
Summary
Three self-contained minor fixes from the grant review, batched together since each is a single-file change with no risk of conflict.
Changes
src/utils/order-types.ts— addCirclesBackingOrdertoDETERMINISTIC_ORDER_TYPES. It was already precomputed as deterministic inuidPrecompute.ts(added in COW-906) but missing from this set, causing a spurious non-deterministic log warning for every CirclesBackingOrder generatorsrc/application/handlers/composableCow.ts— replace the reference to the nonexistentConditionalOrderCancelledevent with an accurate description of the actual on-chain cancellation detection (SingleOrderNotAuthedin C1 + C5singleOrders()sweep)src/application/handlers/settlement.ts— remove thedecodeAbiParametersblock andconsole.logat lines 194–222 that decoded Trade log fields solely for a log line; also removes the now-unuseddecodeAbiParametersimport from viemHow to Test
pnpm test— all tests pass (includes newtests/utils/order-types.test.tswith 6 assertions guarding COW-1003)pnpm typecheck— no errorspnpm lint— no errorsChecklist
Breaking Changes
None
Related Issues
Closes COW-996
Closes COW-999
Closes COW-1003