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
- type Keeper
- func (k Keeper) AssociateMonikerWithAddress(ctx sdk.Context, moniker string, address sdk.AccAddress)
- func (k Keeper) DeleteMonikerAddressAssociation(ctx sdk.Context, moniker string)
- func (k Keeper) DeleteProfile(ctx sdk.Context, address sdk.AccAddress, moniker string)
- func (k Keeper) GetMonikerFromAddress(ctx sdk.Context, addr sdk.AccAddress) (moniker string)
- func (k Keeper) GetMonikerRelatedAddress(ctx sdk.Context, moniker string) (addr sdk.AccAddress)
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶ added in v0.5.0
func NewHandler ¶
NewHandler returns a handler for "profile" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶ added in v0.5.0
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all posts invariants
func ValidProfileInvariant ¶ added in v0.5.0
ValidProfileInvariant checks that all registered profiles have a non-empty moniker 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. }
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func (Keeper) AssociateMonikerWithAddress ¶
func (k Keeper) AssociateMonikerWithAddress(ctx sdk.Context, moniker string, address sdk.AccAddress)
AssociateMonikerWithAddress save the relation of moniker and address on chain
func (Keeper) DeleteMonikerAddressAssociation ¶
DeleteMonikerAddressAssociation delete the given moniker 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) GetMonikerFromAddress ¶
GetMonikerFromAddress returns the moniker associated with the given address or an empty string if no moniker exists
func (Keeper) GetMonikerRelatedAddress ¶
GetMonikerRelatedAddress returns the address associated to the given moniker 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 ¶ added in v0.5.0
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 moniker from a different creator already exists