Exchanges: Bypass websocket book validation (#613)

* Exchanges: Bypass websocket book validation on exchanges when checksum is implemented, fix FTX test, go mod tidy

* Orderbook: Change orderbook base field name
This commit is contained in:
Ryan O'Hara-Reid
2021-01-05 15:55:46 +11:00
committed by GitHub
parent eb0571cc9b
commit 010fab02ca
8 changed files with 28 additions and 18 deletions

View File

@@ -275,9 +275,11 @@ func (b *Base) Process() error {
b.LastUpdated = time.Now()
}
err := b.Verify()
if err != nil {
return err
if !b.HasChecksumValidation {
err := b.Verify()
if err != nil {
return err
}
}
return service.Update(b)

View File

@@ -79,10 +79,15 @@ type Base struct {
LastUpdateID int64 `json:"lastUpdateId"`
AssetType asset.Item `json:"assetType"`
ExchangeName string `json:"exchangeName"`
// NotAggregated defines whether an orderbook can contain duplicate prices
// in a payload
NotAggregated bool `json:"-"`
IsFundingRate bool `json:"fundingRate"`
// HasChecksumValidation defines an allowance to bypass internal
// verification if the book has been verified by checksum.
HasChecksumValidation bool `json:"-"`
}
type byOBPrice []Item