types

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 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
	ActionRequestDtag         = models.ActionRequestDtag
	ActionAcceptDtagTransfer  = models.ActionAcceptDtagTransfer
	RefuseDTagTransferRequest = models.RefuseDTagTransferRequest
	CancelDTagTransferRequest = models.CancelDTagTransferRequest
	QuerierRoute              = models.QuerierRoute
	QueryProfile              = models.QueryProfile
	QueryProfiles             = models.QueryProfiles
	QueryDTagRequests         = models.QueryDTagRequests
	QueryParams               = models.QueryParams
)
View Source
const (
	EventTypeProfileSaved        = "profile_saved"
	EventTypeProfileDeleted      = "profile_deleted"
	EventTypeDTagTransferRequest = "dtag_transfer_request"
	EventTypeDTagTransferAccept  = "dtag_transfer_accept"
	EventTypeDTagTransferRefuse  = "dtag_transfer_refuse"
	EventTypeDTagTransferCancel  = "dtag_transfer_cancel"

	// Profile attributes
	AttributeProfileDtag         = "profile_dtag"
	AttributeProfileCreator      = "profile_creator"
	AttributeProfileCreationTime = "profile_creation_time"

	// DTag trade attributes
	AttributeRequestReceiver = "request_receiver"
	AttributeRequestSender   = "request_sender"
	AttributeDTagToTrade     = "dtag_to_trade"
	AttributeNewDTag         = "new_dtag"
)
View Source
const (
	// default paramspace for paramsModule keeper
	DefaultParamspace = ModuleName
)

Variables

View Source
var (
	// functions aliases
	NewDTagTransferRequest          = models.NewDTagTransferRequest
	RegisterModelsCodec             = models.RegisterModelsCodec
	ProfileStoreKey                 = models.ProfileStoreKey
	DtagStoreKey                    = models.DtagStoreKey
	DtagTransferRequestStoreKey     = models.DtagTransferRequestStoreKey
	NewProfile                      = models.NewProfile
	NewProfiles                     = models.NewProfiles
	NewPictures                     = models.NewPictures
	NewMsgSaveProfile               = msgs.NewMsgSaveProfile
	NewMsgDeleteProfile             = msgs.NewMsgDeleteProfile
	NewMsgRequestDTagTransfer       = msgs.NewMsgRequestDTagTransfer
	NewMsgAcceptDTagTransfer        = msgs.NewMsgAcceptDTagTransfer
	NewMsgRefuseDTagTransferRequest = msgs.NewMsgRefuseDTagTransferRequest
	NewMsgCancelDTagTransferRequest = msgs.NewMsgCancelDTagTransferRequest
	RegisterMessagesCodec           = msgs.RegisterMessagesCodec

	// variable aliases
	ModelsCdc                  = models.ModelsCdc
	ProfileStorePrefix         = models.ProfileStorePrefix
	DtagStorePrefix            = models.DtagStorePrefix
	DTagTransferRequestsPrefix = models.DTagTransferRequestsPrefix
	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 DTagTransferRequest added in v0.12.0

type DTagTransferRequest = models.DTagTransferRequest

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"`
	DTagTransferRequests []DTagTransferRequest `json:"dtag_transfer_requests" yaml:"dtag_transfer_requests"`
}

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, request []DTagTransferRequest) 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 MsgAcceptDTagTransferRequest added in v0.13.0

type MsgAcceptDTagTransferRequest = msgs.MsgAcceptDTagTransferRequest

type MsgCancelDTagTransferRequest added in v0.13.0

type MsgCancelDTagTransferRequest = msgs.MsgCancelDTagTransferRequest

type MsgDeleteProfile

type MsgDeleteProfile = msgs.MsgDeleteProfile

type MsgRefuseDTagTransferRequest added in v0.13.0

type MsgRefuseDTagTransferRequest = msgs.MsgRefuseDTagTransferRequest

type MsgRequestDTagTransfer added in v0.12.0

type MsgRequestDTagTransfer = msgs.MsgRequestDTagTransfer

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