mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-17 15:09:59 +00:00
Fixed issues with liqui GetTicker function. Added tests. Increased Unauth request limit. (#144)
This commit is contained in:
committed by
Adrian Gallagher
parent
799cb59b3d
commit
0a8d8454b5
@@ -34,7 +34,7 @@ const (
|
||||
liquiWithdrawCoin = "WithdrawCoin"
|
||||
|
||||
liquiAuthRate = 0
|
||||
liquiUnauthRate = 0
|
||||
liquiUnauthRate = 1
|
||||
)
|
||||
|
||||
// Liqui is the overarching type across the liqui package
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/thrasher-/gocryptotrader/config"
|
||||
"github.com/thrasher-/gocryptotrader/currency/pair"
|
||||
)
|
||||
|
||||
var l Liqui
|
||||
@@ -119,3 +120,19 @@ func TestAuthRequests(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateTicker(t *testing.T) {
|
||||
p := pair.NewCurrencyPairDelimiter("ETH_BTC", "_")
|
||||
_, err := l.UpdateTicker(p, "SPOT")
|
||||
if err != nil {
|
||||
t.Error("Test Failed - liqui UpdateTicker() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateOrderbook(t *testing.T) {
|
||||
p := pair.NewCurrencyPairDelimiter("ETH_BTC", "_")
|
||||
_, err := l.UpdateOrderbook(p, "SPOT")
|
||||
if err != nil {
|
||||
t.Error("Test Failed - liqui UpdateOrderbook() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,12 +59,13 @@ func (l *Liqui) UpdateTicker(p pair.CurrencyPair, assetType string) (ticker.Pric
|
||||
currency := exchange.FormatExchangeCurrency(l.Name, x).String()
|
||||
var tp ticker.Price
|
||||
tp.Pair = x
|
||||
tp.High = result[currency].High
|
||||
tp.Last = result[currency].Last
|
||||
tp.Ask = result[currency].Sell
|
||||
tp.Bid = result[currency].Buy
|
||||
tp.Last = result[currency].Last
|
||||
tp.Low = result[currency].Low
|
||||
tp.Volume = result[currency].VolumeCurrency
|
||||
tp.Volume = result[currency].Vol
|
||||
ticker.ProcessTicker(l.Name, x, tp, assetType)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user