Skip to content

Commit

Permalink
Fixed issues with liqui GetTicker function. Added tests. Increased Un…
Browse files Browse the repository at this point in the history
…auth request limit. (thrasher-corp#144)
  • Loading branch information
shazbert authored and thrasher- committed Jun 27, 2018
1 parent 799cb59 commit 0a8d845
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exchanges/liqui/liqui.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const (
liquiWithdrawCoin = "WithdrawCoin"

liquiAuthRate = 0
liquiUnauthRate = 0
liquiUnauthRate = 1
)

// Liqui is the overarching type across the liqui package
Expand Down
17 changes: 17 additions & 0 deletions exchanges/liqui/liqui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/thrasher-/gocryptotrader/config"
"github.com/thrasher-/gocryptotrader/currency/pair"
)

var l Liqui
Expand Down Expand Up @@ -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)
}
}
3 changes: 2 additions & 1 deletion exchanges/liqui/liqui_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 0a8d845

Please sign in to comment.