mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 07:26:48 +00:00
gctcli: remove all exchange name client-side validation (#758)
* gctcli: remove all exchange name client-side validation Since now exchange names can be user-assigned we can no longer have client-side validation, all exchange name validation must now occur on the server (it was already doing that). * engine: add server side exchange name check on some RPCs
This commit is contained in:
@@ -4,24 +4,18 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
|
||||
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
||||
)
|
||||
|
||||
var (
|
||||
errInvalidPair = errors.New("invalid currency pair supplied")
|
||||
errInvalidExchange = errors.New("invalid exchange supplied")
|
||||
errInvalidAsset = errors.New("invalid asset supplied")
|
||||
errInvalidPair = errors.New("invalid currency pair supplied")
|
||||
errInvalidAsset = errors.New("invalid asset supplied")
|
||||
)
|
||||
|
||||
func validPair(pair string) bool {
|
||||
return strings.Contains(pair, pairDelimiter)
|
||||
}
|
||||
|
||||
func validExchange(exch string) bool {
|
||||
return exchange.IsSupported(exch)
|
||||
}
|
||||
|
||||
func validAsset(i string) bool {
|
||||
_, err := asset.New(i)
|
||||
return err == nil
|
||||
|
||||
Reference in New Issue
Block a user