mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +00:00
Daily engine changes
1) Although gRPC does server side validation currently, validate basic things on gctcli before relaying the request to the gRPC server 2) Make pair format consistent for the exchange sycner 3) Fix OKEX ticker failure due to thinking futures info is authenticated 4) Start filling out config tests 5) Extend timeout for golangci config so that AppVeyor has time to complete (Travis is fine) 6) Add IsSupported exchange func for easy lookup
This commit is contained in:
@@ -207,7 +207,7 @@ func (o *OKEX) GetFuturesOrderBook(request okgroup.GetFuturesOrderBookRequest) (
|
||||
// GetAllFuturesTokenInfo Get the last traded price, best bid/ask price, 24 hour trading volume and more info of all contracts.
|
||||
func (o *OKEX) GetAllFuturesTokenInfo() (resp []okgroup.GetFuturesTokenInfoResponse, _ error) {
|
||||
requestURL := fmt.Sprintf("%v/%v", okgroup.OKGroupInstruments, okgroup.OKGroupTicker)
|
||||
return resp, o.SendHTTPRequest(http.MethodGet, okGroupFuturesSubsection, requestURL, nil, &resp, true)
|
||||
return resp, o.SendHTTPRequest(http.MethodGet, okGroupFuturesSubsection, requestURL, nil, &resp, false)
|
||||
}
|
||||
|
||||
// GetFuturesTokenInfoForCurrency Get the last traded price, best bid/ask price, 24 hour trading volume and more info of a contract.
|
||||
|
||||
@@ -1045,7 +1045,9 @@ func TestGetAllFuturesTokenInfo(t *testing.T) {
|
||||
TestSetDefaults(t)
|
||||
t.Parallel()
|
||||
_, err := o.GetAllFuturesTokenInfo()
|
||||
testStandardErrorHandling(t, err)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
// TestGetAllFuturesTokenInfo API endpoint test
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
package exchange
|
||||
|
||||
import "strings"
|
||||
|
||||
// IsSupported returns whether or not a specific exchange is supported
|
||||
func IsSupported(exchangeName string) bool {
|
||||
for x := range Exchanges {
|
||||
if strings.EqualFold(exchangeName, Exchanges[x]) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Exchanges stores a list of supported exchanges
|
||||
var Exchanges = []string{
|
||||
"anx",
|
||||
|
||||
13
exchanges/support_test.go
Normal file
13
exchanges/support_test.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package exchange
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestIsSupported(t *testing.T) {
|
||||
if ok := IsSupported("BiTStaMp"); !ok {
|
||||
t.Error("supported exchange should be valid")
|
||||
}
|
||||
|
||||
if ok := IsSupported("meowexch"); ok {
|
||||
t.Error("non-supported exchange should be in valid")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user