v080

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "profiles"
)

Variables

This section is empty.

Functions

func GetProfileDTag

func GetProfileDTag(moniker string) string

GetProfileDTag returns the Dtag for the given profile. To do so, it takes the current profile moniker and remove all the whitespaces from it.

func GetProfileMoniker

func GetProfileMoniker(name, surname *string) *string

GetProfileMoniker returns the moniker for the given profile. To do so, it uses the name and surname currently set, joining them using a whitespace as the separator.

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

type GenesisState

type GenesisState struct {
	Profiles []Profile `json:"profiles"`
	Params   Params    `json:"params" yaml:"params"`
}

GenesisState contains the data of a v0.8.0 genesis state for the profile module

func Migrate

func Migrate(oldGenState v060profile.GenesisState, genesisTime time.Time) GenesisState

Migrate accepts an exported v0.6.0 profile genesis state and migrates it to a v0.8.0 profile 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

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"`
}

type Pictures

type Pictures struct {
	Profile *string `json:"profile,omitempty" yaml:"profile,omitempty"`
	Cover   *string `json:"cover,omitempty" yaml:"cover,omitempty"`
}

Pictures is a struct for Profile Pictures

type Profile

type Profile struct {
	DTag         string         `json:"dtag" yaml:"dtag"`
	Moniker      *string        `json:"moniker,omitempty" yaml:"moniker,omitempty"`
	Bio          *string        `json:"bio,omitempty" yaml:"bio,omitempty"`
	Pictures     *Pictures      `json:"pictures,omitempty" yaml:"pictures,omitempty"`
	Creator      sdk.AccAddress `json:"creator" yaml:"creator"`
	CreationDate time.Time      `json:"creation_date" yaml:"creation_date"`
}

Profile is a struct for a Profile

func ConvertProfiles

func ConvertProfiles(oldProfiles []v060profile.Profile, genesisTime time.Time) []Profile

ConvertProfiles take a list of v0.6.0 profiles and converts them to a list of v0.8.0 profiles. To do so it get rids of all the name and surname fields and moves the value of the moniker field to the dtag one. It also sets the creation date to the genesis time given.

Jump to

Keyboard shortcuts

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