keeper

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants added in v0.5.0

func AllInvariants(k Keeper) sdk.Invariant

func GetEditedProfile

func GetEditedProfile(account types.Profile, msg types.MsgEditProfile) types.Profile

returns the profile with the proper edited fields default string is used to let user replace previous inserted values with blank or empty ones

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "profile" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

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

func ValidProfileInvariant(k Keeper) sdk.Invariant

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 NewKeeper

func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey) Keeper

NewKeeper creates new instances of the magpie Keeper

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

func (k Keeper) DeleteMonikerAddressAssociation(ctx sdk.Context, moniker string)

DeleteMonikerAddressAssociation delete the given moniker association with an address

func (Keeper) DeleteProfile

func (k Keeper) DeleteProfile(ctx sdk.Context, address sdk.AccAddress, moniker string)

DeleteProfile allows to delete an account associated with the given address inside the current context. It assumes that the address-related account exists. nolint: interfacer

func (Keeper) GetMonikerFromAddress

func (k Keeper) GetMonikerFromAddress(ctx sdk.Context, addr sdk.AccAddress) (moniker string)

GetMonikerFromAddress returns the moniker associated with the given address or an empty string if no moniker exists

func (Keeper) GetMonikerRelatedAddress

func (k Keeper) GetMonikerRelatedAddress(ctx sdk.Context, moniker string) (addr sdk.AccAddress)

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) (account types.Profile, found bool)

GetProfile returns the account corresponding to the given address inside the current context. nolint: interfacer

func (Keeper) GetProfiles

func (k Keeper) GetProfiles(ctx sdk.Context) (accounts types.Profiles)

GetProfiles returns all the created accounts 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

func (k Keeper) SaveProfile(ctx sdk.Context, profile types.Profile) error

SaveProfile allows to save the given account inside the current context. It assumes that the given account has already been validated. It returns an error if an account with the same moniker from a different creator already exists

Jump to

Keyboard shortcuts

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