Fixed issues with liqui GetTicker function. Added tests. Increased Unauth request limit. (#144)

This commit is contained in:
Ryan O'Hara-Reid
2018-06-27 14:30:22 +10:00
committed by Adrian Gallagher
parent 799cb59b3d
commit 0a8d8454b5
3 changed files with 20 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ const (
liquiWithdrawCoin = "WithdrawCoin"
liquiAuthRate = 0
liquiUnauthRate = 0
liquiUnauthRate = 1
)
// Liqui is the overarching type across the liqui package

View File

@@ -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)
}
}

View File

@@ -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)
}