websocket/exchanges: populate context before multi connection upgrade (#1933)

* websocket/exchanges: populate context before multi connection upgrade

* fix test

* linter: fix

* gk: dial

* gk: nits rm param names

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
Ryan O'Hara-Reid
2025-06-17 13:43:00 +10:00
committed by GitHub
parent 2958e64afe
commit 3e80f1b9e5
64 changed files with 1160 additions and 1124 deletions

View File

@@ -542,7 +542,7 @@ func (a *Alphapoint) GetOrderFee(ctx context.Context, symbol, side string, quant
}
// SendHTTPRequest sends an unauthenticated HTTP request
func (a *Alphapoint) SendHTTPRequest(_ context.Context, ep exchange.URL, method, path string, data map[string]any, result any) error {
func (a *Alphapoint) SendHTTPRequest(ctx context.Context, ep exchange.URL, method, path string, data map[string]any, result any) error {
endpoint, err := a.API.Endpoints.GetURL(ep)
if err != nil {
return err
@@ -566,7 +566,7 @@ func (a *Alphapoint) SendHTTPRequest(_ context.Context, ep exchange.URL, method,
HTTPRecording: a.HTTPRecording,
}
return a.SendPayload(context.Background(), request.Unset, func() (*request.Item, error) {
return a.SendPayload(ctx, request.Unset, func() (*request.Item, error) {
item.Body = bytes.NewBuffer(PayloadJSON)
return item, nil
}, request.UnauthenticatedRequest)
@@ -617,7 +617,7 @@ func (a *Alphapoint) SendAuthenticatedHTTPRequest(ctx context.Context, ep exchan
HTTPRecording: a.HTTPRecording,
}
return a.SendPayload(context.Background(), request.Unset, func() (*request.Item, error) {
return a.SendPayload(ctx, request.Unset, func() (*request.Item, error) {
item.Body = bytes.NewBuffer(PayloadJSON)
return item, nil
}, request.AuthenticatedRequest)