Exchanges: Add config variable to set bypassing of orderbook verification by exchange (#614)

* Exchanges: Add config variable to set bypassing of orderbook verification

* Exchanges: Consolidate orderbook variables into config struct

* Exchanges: Addr nit; set verification bypass on websocket book implementations
This commit is contained in:
Ryan O'Hara-Reid
2021-01-06 12:56:30 +11:00
committed by GitHub
parent 010fab02ca
commit 7431bf8866
56 changed files with 291 additions and 128 deletions

View File

@@ -353,6 +353,7 @@ func (g *Gateio) wsHandleData(respRaw []byte) error {
newOrderBook.AssetType = asset.Spot
newOrderBook.Pair = p
newOrderBook.ExchangeName = g.Name
newOrderBook.VerificationBypass = g.OrderbookVerificationBypass
err = g.Websocket.Orderbook.LoadSnapshot(&newOrderBook)
if err != nil {

View File

@@ -163,8 +163,8 @@ func (g *Gateio) Setup(exch *config.ExchangeConfig) error {
Subscriber: g.Subscribe,
GenerateSubscriptions: g.GenerateDefaultSubscriptions,
Features: &g.Features.Supports.WebsocketCapabilities,
OrderbookBufferLimit: exch.WebsocketOrderbookBufferLimit,
BufferEnabled: exch.WebsocketOrderbookBufferEnabled,
OrderbookBufferLimit: exch.OrderbookConfig.WebsocketBufferLimit,
BufferEnabled: exch.OrderbookConfig.WebsocketBufferEnabled,
})
if err != nil {
return err
@@ -278,7 +278,12 @@ func (g *Gateio) FetchOrderbook(p currency.Pair, assetType asset.Item) (*orderbo
// UpdateOrderbook updates and returns the orderbook for a currency pair
func (g *Gateio) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error) {
book := &orderbook.Base{ExchangeName: g.Name, Pair: p, AssetType: assetType}
book := &orderbook.Base{
ExchangeName: g.Name,
Pair: p,
AssetType: assetType,
VerificationBypass: g.OrderbookVerificationBypass,
}
curr, err := g.FormatExchangeCurrency(p, assetType)
if err != nil {
return book, err