mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 15:11:10 +00:00
orderbook: flatpack map and mutex to rwmutex (#1909)
* orderbook: flatpack map and mutex to rwmutex * glorious: benchmark * Update exchanges/orderbook/orderbook.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/orderbook/orderbook_types.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/orderbook/orderbook_types.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * Update exchanges/orderbook/orderbook_types.go Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> * gk: nits * linter: fix * Update exchanges/orderbook/orderbook_test.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * Update exchanges/orderbook/orderbook_test.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * thrasher-: nits * okx: fix tests/thrasher niterino * gk: nits --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com> Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
This commit is contained in:
@@ -4470,13 +4470,13 @@ func TestWsProcessOrderbook5(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
required := currency.NewPairWithDelimiter("OKB", "USDT", "-")
|
||||
got, err := orderbook.Get("okx", required, asset.Spot)
|
||||
got, err := orderbook.Get(ok.Name, required, asset.Spot)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, got.Asks, 5)
|
||||
require.Len(t, got.Bids, 5)
|
||||
// Book replicated to margin
|
||||
got, err = orderbook.Get("okx", required, asset.Margin)
|
||||
got, err = orderbook.Get(ok.Name, required, asset.Margin)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, got.Asks, 5)
|
||||
assert.Len(t, got.Bids, 5)
|
||||
|
||||
Reference in New Issue
Block a user