Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() paramsModule.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateBioParams(i interface{}) error
- func ValidateDtagParams(i interface{}) error
- func ValidateGenesis(data GenesisState) error
- func ValidateMonikerParams(i interface{}) error
- type DtagParams
- type GenesisState
- type MonikerParams
- type MsgDeleteProfile
- type MsgSaveProfile
- type Params
- type Pictures
- type Profile
- type Profiles
Constants ¶
const ( ModuleName = models.ModuleName RouterKey = models.RouterKey StoreKey = models.StoreKey ActionSaveProfile = models.ActionSaveProfile ActionDeleteProfile = models.ActionDeleteProfile QuerierRoute = models.QuerierRoute QueryProfile = models.QueryProfile QueryProfiles = models.QueryProfiles QueryParams = models.QueryParams )
const ( EventTypeProfileSaved = "profile_saved" EventTypeProfileDeleted = "profile_deleted" // Profile attributes AttributeProfileDtag = "profile_dtag" AttributeProfileCreator = "profile_creator" AttributeProfileCreationTime = "profile_creation_time" )
const ( // default paramspace for paramsModule keeper DefaultParamspace = ModuleName )
Variables ¶
var ( // functions aliases ProfileStoreKey = models.ProfileStoreKey DtagStoreKey = models.DtagStoreKey NewProfile = models.NewProfile NewProfiles = models.NewProfiles NewPictures = models.NewPictures RegisterModelsCodec = models.RegisterModelsCodec NewMsgSaveProfile = msgs.NewMsgSaveProfile NewMsgDeleteProfile = msgs.NewMsgDeleteProfile RegisterMessagesCodec = msgs.RegisterMessagesCodec // variable aliases ProfileStorePrefix = models.ProfileStorePrefix DtagStorePrefix = models.DtagStorePrefix ModelsCdc = models.ModelsCdc MsgsCodec = msgs.MsgsCodec )
var ( DefaultMinMonikerLength = sdk.NewInt(2) DefaultMaxMonikerLength = sdk.NewInt(1000) //longest name on earth count 954 chars DefaultRegEx = `^[A-Za-z0-9_]+$` DefaultMinDTagLength = sdk.NewInt(3) DefaultMaxDTagLength = sdk.NewInt(30) DefaultMaxBioLength = sdk.NewInt(1000) )
Default profile paramsModule
var ( MonikerLenParamsKey = []byte("MonikerParams") DtagLenParamsKey = []byte("DtagParams") MaxBioLenParamsKey = []byte("MaxBioLen") )
Parameters store keys
var ModuleCdc = codec.New()
ModuleCdc is the codec used inside the whole profiles module
Functions ¶
func ParamKeyTable ¶
func ParamKeyTable() paramsModule.KeyTable
ParamKeyTable Key declaration for parameters
func RegisterCodec ¶
func ValidateBioParams ¶
func ValidateBioParams(i interface{}) error
func ValidateDtagParams ¶
func ValidateDtagParams(i interface{}) error
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the given genesis state and returns an error if something is invalid
func ValidateMonikerParams ¶
func ValidateMonikerParams(i interface{}) error
Types ¶
type DtagParams ¶
type DtagParams struct { RegEx string `json:"reg_ex" yaml:"reg_ex"` MinDtagLen sdk.Int `json:"min_length" yaml:"min_length"` MaxDtagLen sdk.Int `json:"max_length" yaml:"max_length"` }
DtagParams defines the paramsModule around profiles' dtag
func DefaultDtagParams ¶
func DefaultDtagParams() DtagParams
DefaultDtagParams return default paramsModule
func NewDtagParams ¶
func NewDtagParams(regEx string, minLen, maxLen sdk.Int) DtagParams
NewDtagParams creates a new DtagParams obj
func (DtagParams) String ¶
func (params DtagParams) String() string
String implements stringer interface
type GenesisState ¶
type GenesisState struct { Profiles []Profile `json:"profiles" yaml:"profiles"` Params Params `json:"params" yaml:"params"` UsersRelationships map[string][]sdk.AccAddress `json:"users_relationships"` }
GenesisState contains the data of the genesis state for the profile module
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default GenesisState
func NewGenesisState ¶
func NewGenesisState(profiles []Profile, params Params, usersRelationships map[string][]sdk.AccAddress) GenesisState
NewGenesisState creates a new genesis state
type MonikerParams ¶
type MonikerParams struct { MinMonikerLen sdk.Int `json:"min_length" yaml:"min_length"` MaxMonikerLen sdk.Int `json:"max_length" yaml:"max_length"` }
MonikerParams defines the paramsModule around moniker len
func DefaultMonikerParams ¶
func DefaultMonikerParams() MonikerParams
DefaultMonikerParams return default moniker params
func NewMonikerParams ¶
func NewMonikerParams(minLen, maxLen sdk.Int) MonikerParams
NewMonikerParams creates a new MonikerParams obj
func (MonikerParams) String ¶
func (params MonikerParams) String() string
String implements stringer interface
type MsgDeleteProfile ¶
type MsgDeleteProfile = msgs.MsgDeleteProfile
type MsgSaveProfile ¶
type MsgSaveProfile = msgs.MsgSaveProfile
type Params ¶
type Params struct { MonikerParams MonikerParams `json:"moniker_params" yaml:"moniker_params"` DtagParams DtagParams `json:"dtag_params" yaml:"dtag_params"` MaxBioLen sdk.Int `json:"max_bio_length" yaml:"max_bio_length"` }
func NewParams ¶
func NewParams(monikerLen MonikerParams, dtagLen DtagParams, maxBioLen sdk.Int) Params
NewParams creates a new ProfileParams obj
func (*Params) ParamSetPairs ¶
func (params *Params) ParamSetPairs() paramsModule.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns the key/value pairs of profile module's parameters.