pub fn validate_attribute_name<S: Into<String>>(
    name: S
) -> Result<(), ContractError>
Expand description

Verifies that the provided string is a valid attribute name for the Provenance Blockchain, following their rules:

  • The attribute must not be empty.
  • The attribute must have at maximum 16 segments, separated by periods.
  • Each segment must be between 2 and 32 characters.
  • Each segment must be alphanumeric.
  • Each segment can have a single ‘-’ character, or be a valid uuid if it includes ‘-’ characters.

Referenced code (at time of writing): https://github.com/provenance-io/provenance/blob/main/x/name/types/name.go#L82 Referenced documentation describing these requirements (at time of writing): https://github.com/provenance-io/provenance/blob/main/x/name/spec/01_concepts.md

§Parameters

  • name The fully-qualified attribute name. Ex: name-thing.name