Skip to content

fix(clob): use correct orderID key in cancel_order request body#320

Open
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
skyc1e:fix/cancel-order-key-casing
Open

fix(clob): use correct orderID key in cancel_order request body#320
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
skyc1e:fix/cancel-order-key-casing

Conversation

@skyc1e
Copy link
Copy Markdown

@skyc1e skyc1e commented Apr 6, 2026

Note

Low Risk
Low risk: a small request-body key change limited to the cancel_order endpoint plus aligned unit tests.

Overview
Fixes Client::cancel_order to send the correct JSON key (orderID instead of orderId) when issuing the DELETE /order request.

Updates the corresponding httpmock expectations in tests/clob.rs to match the new request body.

Reviewed by Cursor Bugbot for commit 616288e. Bugbot is set up for automated code reviews on this repo. Configure here.

The cancel_order method was sending `orderId` (camelCase) but the CLOB API
expects `orderID` (capital D), matching the TypeScript and Python clients.
The mock test was also using the wrong key, masking the issue.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.54%. Comparing base (77264a4) to head (616288e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #320   +/-   ##
=======================================
  Coverage   85.54%   85.54%           
=======================================
  Files          32       32           
  Lines        5167     5167           
=======================================
  Hits         4420     4420           
  Misses        747      747           
Flag Coverage Δ
rust 85.54% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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