Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exchanges/wrappers: shift bespoke fetch ticker, orderbook and accountinfo #1440

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0af3a8d
acrost: Pull thread, examine
Jan 4, 2024
7391cf1
fix tests
Jan 4, 2024
1fcc8e1
linter
Jan 4, 2024
ab41331
Merge branch 'master' into fetch_sillyness
Jan 17, 2024
9f795a5
fix_linter
Jan 17, 2024
33061cb
Merge branch 'master' into fetch_sillyness
Jan 29, 2024
9cd6001
revert rm ctx param to limit breakages when merging usptream
Jan 29, 2024
6b5bae0
linter fix
Jan 29, 2024
065b3b1
Add in priority update grouping so that tests pass
Jan 29, 2024
d1156cf
Update cmd/exchange_wrapper_standards/exchange_wrapper_standards_test.go
shazbert Jan 30, 2024
10c2448
glorious nits
Jan 30, 2024
7eea11e
fixed spelling
Jan 30, 2024
f837ce0
whoopsie
Jan 30, 2024
c999444
aanother whoops
Jan 30, 2024
14fd6c8
Merge branch 'master' into fetch_sillyness
Feb 1, 2024
82f252b
Merge branch 'master' into fetch_sillyness
Feb 15, 2024
294fea1
Merge branch 'master' into fetch_sillyness
Mar 7, 2024
7e8bad8
glorious: NITTERS!
Mar 7, 2024
3984f89
glorious: further nitters
Mar 7, 2024
4ad6acd
srry linter gods
Mar 7, 2024
0798c1a
glorious: nits continued
Mar 8, 2024
b9bffe0
sub test p ara lel
Mar 8, 2024
88d23d0
Merge branch 'master' into fetch_sillyness
Apr 15, 2024
861976e
Merge branch 'master' into fetch_sillyness
May 1, 2024
ce7f1e5
drop main t.Parallel
May 1, 2024
187dfba
fix whoops
May 1, 2024
c3c4a06
wrappertests: use context with cancel (test)
May 1, 2024
33dfb4b
Merge branch 'master' into fetch_sillyness
May 15, 2024
6c74d85
Merge branch 'master' into fetch_sillyness
Oct 12, 2024
2824a2f
Merge branch 'master' into fetch_sillyness
Dec 30, 2024
9e7b0d7
linter: fix
Dec 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions cmd/exchange_wrapper_standards/exchange_wrapper_standards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
// singleExchangeOverride enter an exchange name to only test that exchange
var singleExchangeOverride = ""

func TestAllExchangeWrappers(t *testing.T) {

Check failure on line 43 in cmd/exchange_wrapper_standards/exchange_wrapper_standards_test.go

View workflow job for this annotation

GitHub Actions / lint

TestAllExchangeWrappers's subtests should call t.Parallel (tparallel)
t.Parallel()
cfg := config.GetConfig()
err := cfg.LoadConfig("../../testdata/configtest.json", true)
Expand All @@ -50,7 +50,6 @@
for i := range cfg.Exchanges {
name := strings.ToLower(cfg.Exchanges[i].Name)
t.Run(name+" wrapper tests", func(t *testing.T) {
t.Parallel()
gloriousCode marked this conversation as resolved.
Show resolved Hide resolved
if common.StringDataContains(unsupportedExchangeNames, name) {
t.Skipf("skipping unsupported exchange %v", name)
}
Expand All @@ -62,7 +61,7 @@
// rather than skipping tests where execution is blocked, provide an expired
// context, so no executions can take place
var cancelFn context.CancelFunc
ctx, cancelFn = context.WithTimeout(context.Background(), 0)
ctx, cancelFn = context.WithTimeout(ctx, 0)
cancelFn()
}
exch, assetPairs := setupExchange(ctx, t, name, cfg)
Expand Down Expand Up @@ -197,16 +196,8 @@

func handleExchangeWrapperTests(ctx context.Context, t *testing.T, actualExchange reflect.Value, methodNames []string, exch exchange.IBotExchange, assetParams []assetPair, groupTestID string) {
t.Helper()
if groupTestID == "PRIORITY GROUP" {
// Some update requests check for authenticated support, but we don't
// want to test them. This will fail fetcher functions in secondary
// group.
exch.GetBase().API.AuthenticatedSupport = false
} else {
exch.GetBase().API.AuthenticatedSupport = true
}

t.Run(groupTestID, func(t *testing.T) {
t.Parallel()
for x := range methodNames {
method := actualExchange.MethodByName(methodNames[x])

Expand Down
6 changes: 1 addition & 5 deletions exchanges/kucoin/kucoin_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,7 @@ func (ku *Kucoin) UpdateOrderbook(ctx context.Context, pair currency.Pair, asset
case asset.Futures:
ordBook, err = ku.GetFuturesOrderbook(ctx, pair.String())
case asset.Spot, asset.Margin:
if ku.IsRESTAuthenticationSupported() && ku.AreCredentialsValid(ctx) {
ordBook, err = ku.GetOrderbook(ctx, pair.String())
} else {
ordBook, err = ku.GetPartOrderbook100(ctx, pair.String())
}
ordBook, err = ku.GetPartOrderbook100(ctx, pair.String())
default:
return nil, fmt.Errorf("%w %v", asset.ErrNotSupported, assetType)
}
Expand Down
Loading