func ValidateQoS(qos uint64) error {
	if qos == 0 {
		return sdkerrors.Wrap(ErrInvalidQoS, "qos must be greater than 0")
	}
	return nil
}
ValidateQoS verifies whether the  parameters are legal
package types
import (
	"encoding/hex"
	"encoding/json"
	"fmt"
	"regexp"
	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
const (
	MaxNameLength = 70
	MaxDescriptionLength = 280
	MaxTagsNum = 10
	MaxTagLength = 70
	MaxProvidersNum = 10
)
var (
	regexpServiceName = regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9_-]*$`)
	regexpTag         = regexp.MustCompile(`^[\S]{1,70}$`)
)
func ValidateAuthor(author string) error {
	if _, err := sdk.AccAddressFromBech32(author); err != nil {
		return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid author address (%s)", err)
	}
	return nil
}
func ValidateServiceName(name string) error {
	if !regexpServiceName.MatchString(name) || len(name) > MaxNameLength {
		return sdkerrors.Wrap(ErrInvalidServiceName, name)
	}
	return nil
}
func ValidateTags(tags []string) error {
	if len(tags) > MaxTagsNum {
		return sdkerrors.Wrap(ErrInvalidTags, fmt.Sprintf("invalid tags size; got: %d, max: %d", len(tags), MaxTagsNum))
	}
	if HasDuplicate(tags) {
		return sdkerrors.Wrap(ErrInvalidTags, "duplicate tag")
	}
	for i, tag := range tags {
		if !regexpTag.MatchString(tag) {
			return sdkerrors.Wrapf(ErrInvalidTags, "tag [%d] is invalid, must match regexp: %s", i, regexpTag.String())
		}
	}
	return nil
}
func ValidateServiceDescription(svcDescription string) error {
	if len(svcDescription) > MaxDescriptionLength {
		return sdkerrors.Wrap(ErrInvalidDescription, fmt.Sprintf("invalid service description length; got: %d, max: %d", len(svcDescription), MaxDescriptionLength))
	}
	return nil
}
func ValidateAuthorDescription(authorDescription string) error {
	if len(authorDescription) > MaxDescriptionLength {
		return sdkerrors.Wrap(ErrInvalidDescription, fmt.Sprintf("invalid author description length; got: %d, max: %d", len(authorDescription), MaxDescriptionLength))
	}
	return nil
}
func ValidateProvider(provider string) error {
	if _, err := sdk.AccAddressFromBech32(provider); err != nil {
		return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid provider address (%s)", err)
	}
	return nil
}
func ValidateOwner(owner string) error {
	if _, err := sdk.AccAddressFromBech32(owner); err != nil {
		return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err)
	}
	return nil
}
func ValidateServiceDeposit(deposit sdk.Coins) error {
	if !deposit.IsValid() {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "invalid deposit")
	}
	if deposit.IsAnyNegative() {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "invalid deposit")
	}
	return nil
}
func ValidatePricing(pricing string) error {
	if err := ValidateBindingPricing(pricing); err != nil {
		return err
	}
	parsedPricing, err := ParsePricing(pricing)
	if err != nil {
		return err
	}
	return CheckPricing(parsedPricing)
}