mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-05 23:16:53 +00:00
Asset package update (#581)
* Rewrite new function and deploy where we can minimise the chance of setting an asset type that is different to supported list - sets validation to exact supported list * change wording
This commit is contained in:
@@ -280,10 +280,11 @@ func testWrappers(e exchange.IBotExchange, base *exchange.Base, config *Config)
|
||||
testOrderType := parseOrderType(config.OrderSubmission.OrderType)
|
||||
assetTypes := base.GetAssetTypes()
|
||||
if assetTypeOverride != "" {
|
||||
if asset.IsValid(asset.Item(assetTypeOverride)) {
|
||||
assetTypes = asset.Items{asset.Item(assetTypeOverride)}
|
||||
} else {
|
||||
a, err := asset.New(assetTypeOverride)
|
||||
if err != nil {
|
||||
log.Printf("%v Asset Type '%v' not recognised, defaulting to exchange defaults", base.GetName(), assetTypeOverride)
|
||||
} else {
|
||||
assetTypes = asset.Items{a}
|
||||
}
|
||||
}
|
||||
for i := range assetTypes {
|
||||
|
||||
@@ -23,5 +23,6 @@ func validExchange(exch string) bool {
|
||||
}
|
||||
|
||||
func validAsset(i string) bool {
|
||||
return asset.IsValid(asset.Item(i))
|
||||
_, err := asset.New(i)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user