Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func ValidProfileInvariant(k Keeper) sdk.Invariant
- func ValidateProfile(ctx sdk.Context, keeper Keeper, profile types.Profile) error
- type Keeper
- func (k Keeper) AssociateDtagWithAddress(ctx sdk.Context, dtag string, address sdk.AccAddress)
- func (k Keeper) DeleteDtagAddressAssociation(ctx sdk.Context, dtag string)
- func (k Keeper) DeleteProfile(ctx sdk.Context, address sdk.AccAddress, dtag string)
- func (k Keeper) GetDtagFromAddress(ctx sdk.Context, addr sdk.AccAddress) (dtag string)
- func (k Keeper) GetDtagRelatedAddress(ctx sdk.Context, dtag string) (addr sdk.AccAddress)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetProfile(ctx sdk.Context, address sdk.AccAddress) (profile types.Profile, found bool)
- func (k Keeper) GetProfiles(ctx sdk.Context) (profiles types.Profiles)
- func (k Keeper) IterateProfiles(ctx sdk.Context, fn func(index int64, profile types.Profile) (stop bool))
- func (k Keeper) SaveProfile(ctx sdk.Context, profile types.Profile) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
func NewHandler ¶
NewHandler returns a handler for "profile" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all posts invariants
func ValidProfileInvariant ¶
ValidProfileInvariant checks that all registered profiles have a non-empty dtag and a non-empty creator
Types ¶
type Keeper ¶
type Keeper struct { StoreKey sdk.StoreKey // Unexposed key to access store from sdk.Context Cdc *codec.Codec // The wire codec for binary encoding/decoding. // contains filtered or unexported fields }
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func (Keeper) AssociateDtagWithAddress ¶
AssociateDtagWithAddress save the relation of dtag and address on chain
func (Keeper) DeleteDtagAddressAssociation ¶
DeleteDtagAddressAssociation delete the given dtag association with an address
func (Keeper) DeleteProfile ¶
DeleteProfile allows to delete a profile associated with the given address inside the current context. It assumes that the address-related profile exists. nolint: interfacer
func (Keeper) GetDtagFromAddress ¶
GetDtagFromAddress returns the dtag associated with the given address or an empty string if no dtag exists
func (Keeper) GetDtagRelatedAddress ¶
GetDtagRelatedAddress returns the address associated to the given dtag or nil if it not exists
func (Keeper) GetProfile ¶
func (k Keeper) GetProfile(ctx sdk.Context, address sdk.AccAddress) (profile types.Profile, found bool)
GetProfile returns the profile corresponding to the given address inside the current context. nolint: interfacer
func (Keeper) GetProfiles ¶
GetProfiles returns all the created profiles inside the current context.
func (Keeper) IterateProfiles ¶
func (k Keeper) IterateProfiles(ctx sdk.Context, fn func(index int64, profile types.Profile) (stop bool))
IterateProfiles iterates through the profiles set and performs the provided function
func (Keeper) SaveProfile ¶
SaveProfile allows to save the given profile inside the current context. It assumes that the given profile has already been validated. It returns an error if a profile with the same dtag from a different creator already exists