types

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
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
)
View Source
const (
	EventTypeProfileSaved   = "profile_saved"
	EventTypeProfileDeleted = "profile_deleted"

	// Profile attributes
	AttributeProfileDtag         = "profile_dtag"
	AttributeProfileCreator      = "profile_creator"
	AttributeProfileCreationTime = "profile_creation_time"
)
View Source
const (
	// default paramspace for paramsModule keeper
	DefaultParamspace = ModuleName
)

Variables

View Source
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
)
View Source
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

View Source
var (
	MonikerLenParamsKey = []byte("MonikerParams")
	DtagLenParamsKey    = []byte("DtagParams")
	MaxBioLenParamsKey  = []byte("MaxBioLen")
)

Parameters store keys

View Source
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 RegisterCodec(cdc *codec.Codec)

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 DefaultParams

func DefaultParams() Params

DefaultParams return default paramsModule

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.

func (Params) String

func (params Params) String() string

func (Params) Validate

func (params Params) Validate() error

Validate perform basic checks on all parameters to ensure they are correct

type Pictures

type Pictures = models.Pictures

type Profile

type Profile = models.Profile

type Profiles

type Profiles = models.Profiles

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL