Skip to content

Commit

Permalink
test: spot-order-batch-cancel-by-ids
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokisan committed Dec 4, 2021
1 parent 3802a97 commit 9b7593d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions account_spot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,35 @@ func TestSpotOrderBatchFastCancel(t *testing.T) {
testhelper.UpdateFile(t, goldenFilename, testhelper.ConvertToJSON(res.Result))
}
}

func TestSpotOrderBatchCancelByIDs(t *testing.T) {
client := NewTestClient().WithAuthFromEnv()

var orderID string
{
price := 28383.5
res, err := client.Account().SpotPostOrder(SpotPostOrderParam{
Symbol: SymbolSpotBTCUSDT,
Qty: 0.01,
Side: SideBuy,
Type: OrderTypeSpotLimit,
Price: &price,
})
{
require.NoError(t, err)
require.Equal(t, "", res.RetMsg)
}
orderID = res.Result.OrderID
}

res, err := client.Account().SpotOrderBatchCancelByIDs([]string{orderID})
{
require.NoError(t, err)
require.Equal(t, "", res.RetMsg)
}
{
goldenFilename := "./testdata/spot-v1-order-batch-cancel-by-ids.json"
testhelper.Compare(t, goldenFilename, testhelper.ConvertToJSON(res.Result))
testhelper.UpdateFile(t, goldenFilename, testhelper.ConvertToJSON(res.Result))
}
}
1 change: 1 addition & 0 deletions testdata/spot-v1-order-batch-cancel-by-ids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]

0 comments on commit 9b7593d

Please sign in to comment.