diff --git a/tapgarden/seedling.go b/tapgarden/seedling.go index 601d1d944..4c56797db 100644 --- a/tapgarden/seedling.go +++ b/tapgarden/seedling.go @@ -103,6 +103,12 @@ type Seedling struct { // // TODO(roasbeef): have this series of check be a DB level constraint? func (c Seedling) validateFields() error { + // Validate the asset name. + err := asset.ValidateAssetName(c.AssetName) + if err != nil { + return err + } + switch { // Only normal and collectible asset types are supported. // @@ -111,13 +117,6 @@ func (c Seedling) validateFields() error { return fmt.Errorf("%v: %v", int(c.AssetType), ErrInvalidAssetType) - // The asset name can't be blank as that's needed to generate the asset - // ID. - // - // TODO(roasbeef): also bubble up to the spec? - case c.AssetName == "": - return ErrNoAssetName - // Creating an asset with zero available supply is not allowed. case c.Amount == 0: return ErrInvalidAssetAmt