github.com/Finschia/finschia-sdk@v0.48.1/x/collection/event.go (about)

     1  package collection
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  const (
     8  	prefixAttributeKey = "ATTRIBUTE_KEY_"
     9  )
    10  
    11  func (x AttributeKey) String() string {
    12  	lenPrefix := len(prefixAttributeKey)
    13  	return strings.ToLower(AttributeKey_name[int32(x)][lenPrefix:])
    14  }
    15  
    16  func AttributeKeyFromString(name string) AttributeKey {
    17  	attributeKeyName := prefixAttributeKey + strings.ToUpper(name)
    18  	return AttributeKey(AttributeKey_value[attributeKeyName])
    19  }