exchange: upgrade UpdatePair method (#991)

* exchange: upgrade update pair

* exchanges: Add enabled string matching and format handling if discrepency is found.

* linter: fixes

* bithumb: fix tests

* BTSE: api change fix ordering

* huobi: fix tests

* gloriousnits: stage 1

* gloriousnits: stage 2

* currency: more nits

* bitmex: add spot and process pairs before currency package call.

* bitmex: finished correct orderbook matching and other implementations

* linter: fix issue

* currency: Fix linter

* currency: segregate and protect pair store, update tests

* currency/manager: clean code, rm log output

* currency: Add store method and make sure formatting stays nil if not stored.

* gct: check errors

* engine/websocketroutineman: fix tests

* bybit: fix duplication bug

* huobi: fix test

* btse: fix tests?

* ob/buffer: fix tests

* Update currency/manager.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* glorious: nits strikes again.

* exchange: add bypassConfigFormatUpgrades to stop formatting

* GLORIOUS LINTER

* Update exchanges/bithumb/bithumb_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* exchange: fix pair upgrade issue when duplications are in both avail and enabled pairs

* linter: fix shadow dec

* config: fix test

* Update currency/pair_test.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
Ryan O'Hara-Reid
2022-09-16 08:59:27 +10:00
committed by GitHub
parent ecc3b10402
commit f843b7d277
55 changed files with 1832 additions and 685 deletions

View File

@@ -1348,8 +1348,12 @@ func TestGetHistoricTrades(t *testing.T) {
if err != nil {
t.Fatal(err)
}
rPair, err := enabledPairs.GetRandomPair()
if !errors.Is(err, nil) {
t.Fatalf("received: '%v' but expected: '%v'", err, nil)
}
_, err = f.GetHistoricTrades(context.Background(),
enabledPairs.GetRandomPair(),
rPair,
assets[i],
time.Now().Add(-time.Minute*15),
time.Now())
@@ -1367,8 +1371,12 @@ func TestGetRecentTrades(t *testing.T) {
if err != nil {
t.Fatal(err)
}
rPair, err := enabledPairs.GetRandomPair()
if !errors.Is(err, nil) {
t.Fatalf("received: '%v' but expected: '%v'", err, nil)
}
_, err = f.GetRecentTrades(context.Background(),
enabledPairs.GetRandomPair(), assets[i])
rPair, assets[i])
if err != nil {
t.Error(err)
}

View File

@@ -2067,7 +2067,7 @@ func (f *FTX) GetFundingRates(ctx context.Context, request *order.FundingRatesRe
if err != nil {
return nil, err
}
request.Pairs = request.Pairs.Format(pairFmt.Delimiter, pairFmt.Index, pairFmt.Uppercase)
request.Pairs = request.Pairs.Format(pairFmt)
response := make([]order.FundingRates, 0, len(request.Pairs))
for x := range request.Pairs {
var isPerp bool