mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* 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
23 lines
398 B
Go
23 lines
398 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"strings"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/exchanges/asset"
|
|
)
|
|
|
|
var (
|
|
errInvalidPair = errors.New("invalid currency pair supplied")
|
|
errInvalidAsset = errors.New("invalid asset supplied")
|
|
)
|
|
|
|
func validPair(pair string) bool {
|
|
return strings.Contains(pair, pairDelimiter)
|
|
}
|
|
|
|
func validAsset(i string) bool {
|
|
_, err := asset.New(i)
|
|
return err == nil
|
|
}
|