mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 07:26:48 +00:00
exchanges: Initial context propagation (#744)
* gct: phase one context awareness pass * exchanges: context propagation pass * common/requester: force context requirement * gctcli/exchanges: linter fix * rpcserver: fix test using dummy rpc server * backtester: fix comments * grpc: add correct cancel and timeout for commands * rpcserver_test: add comment on dummy server * common: deprecated SendHTTPGetRequest * linter: fix * linter: turn on no context check * apichecker: fix context linter issue * binance: use param context * common: remove checks as this gets executed before main * common: change mutex to RW as clients can be used by multiple go routines. * common: remove init and JIT default client. Unexport global variables and add protection. * common: Add comments * bithumb: after dinner mints fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package engine
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/ecdsa"
|
||||
"crypto/elliptic"
|
||||
"crypto/rand"
|
||||
@@ -773,7 +774,8 @@ func TestGetSpecificOrderbook(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
ob, err := e.GetSpecificOrderbook(btsusd, testExchange, asset.Spot)
|
||||
ob, err := e.GetSpecificOrderbook(context.Background(),
|
||||
btsusd, testExchange, asset.Spot)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -787,7 +789,8 @@ func TestGetSpecificOrderbook(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = e.GetSpecificOrderbook(ethltc, testExchange, asset.Spot)
|
||||
_, err = e.GetSpecificOrderbook(context.Background(),
|
||||
ethltc, testExchange, asset.Spot)
|
||||
if err == nil {
|
||||
t.Fatal("Unexpected result")
|
||||
}
|
||||
@@ -815,7 +818,8 @@ func TestGetSpecificTicker(t *testing.T) {
|
||||
t.Fatal("ProcessTicker error", err)
|
||||
}
|
||||
|
||||
tick, err := e.GetSpecificTicker(p, testExchange, asset.Spot)
|
||||
tick, err := e.GetSpecificTicker(context.Background(),
|
||||
p, testExchange, asset.Spot)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -829,7 +833,8 @@ func TestGetSpecificTicker(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = e.GetSpecificTicker(ethltc, testExchange, asset.Spot)
|
||||
_, err = e.GetSpecificTicker(context.Background(),
|
||||
ethltc, testExchange, asset.Spot)
|
||||
if err == nil {
|
||||
t.Fatal("Unexpected result")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user