Skip to content

[Tests] Add and fix CancelByCloid - #22

Merged
sonirico merged 1 commit into
sonirico:masterfrom
terwey:test/exchange-orders-cancelbycloid
Aug 14, 2025
Merged

[Tests] Add and fix CancelByCloid#22
sonirico merged 1 commit into
sonirico:masterfrom
terwey:test/exchange-orders-cancelbycloid

Conversation

@terwey

@terwey terwey commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

fix(exchange/cancel)!: correct cancelByCloid wire format; make cloid nullable; tighten error handling

Use asset (not a) and cloid for CancelByCloidWire, matching the HL Python SDK. Rename CancelByCloidWire.OrderID → ClientID.
Change OrderStatusResting.ClientID to *string to reflect nullable cloid. Guard nil results in BulkOrders and surface errors properly in BulkCancelByCloids (FirstError, Ok/Status checks). Add CancelByCloid tests (+ cassette) and update existing tests to use pointer ClientID. BREAKING CHANGE: OrderStatusResting.ClientID type is now *string; CancelByCloidWire field renamed to ClientID and uses JSON/Msgpack tag asset. Update callers accordingly.

…nullable; tighten error handling

Use asset (not a) and cloid for CancelByCloidWire, matching the HL Python SDK.
Rename CancelByCloidWire.OrderID → ClientID.
Change OrderStatusResting.ClientID to *string to reflect nullable cloid.
Guard nil results in BulkOrders and surface errors properly in BulkCancelByCloids (FirstError, Ok/Status checks).
Add CancelByCloid tests (+ cassette) and update existing tests to use pointer ClientID.
BREAKING CHANGE: OrderStatusResting.ClientID type is now *string; CancelByCloidWire field renamed to ClientID and uses JSON/Msgpack tag asset. Update callers accordingly.
Comment thread exchange_orders_cancel_test.go
require.NoError(tt, err)
tt.Logf("cancel response: %+v", resp)

// // Optional second cancel to test error path

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

@sonirico
sonirico merged commit 0d1a189 into sonirico:master Aug 14, 2025
4 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.

2 participants