keeper

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

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

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all posts invariants

func ValidProfileInvariant

func ValidProfileInvariant(k Keeper) sdk.Invariant

ValidProfileInvariant checks that all registered profiles have a non-empty dtag and a non-empty creator

func ValidateProfile

func ValidateProfile(ctx sdk.Context, keeper Keeper, profile types.Profile) error

ValidateProfile checks if the given profile is valid according to the current profile's module params

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 NewKeeper

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

NewKeeper creates new instances of the magpie Keeper

func (Keeper) AssociateDtagWithAddress

func (k Keeper) AssociateDtagWithAddress(ctx sdk.Context, dtag string, address sdk.AccAddress)

AssociateDtagWithAddress save the relation of dtag and address on chain

func (Keeper) DeleteAllDTagTransferRequests added in v0.12.0

func (k Keeper) DeleteAllDTagTransferRequests(ctx sdk.Context, user sdk.AccAddress)

DeleteAllDTagTransferRequests delete all the requests made to the given user

func (Keeper) DeleteDtagAddressAssociation

func (k Keeper) DeleteDtagAddressAssociation(ctx sdk.Context, dtag string)

DeleteDtagAddressAssociation delete the given dtag association with an address

func (Keeper) DeleteProfile

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

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) GetDTagTransferRequests added in v0.12.0

func (k Keeper) GetDTagTransferRequests(ctx sdk.Context) (requests []types.DTagTransferRequest)

GetDTagTransferRequests returns all the requests inside the given context

func (Keeper) GetDtagFromAddress

func (k Keeper) GetDtagFromAddress(ctx sdk.Context, addr sdk.AccAddress) (dtag string)

GetDtagFromAddress returns the dtag associated with the given address or an empty string if no dtag exists

func (Keeper) GetDtagRelatedAddress

func (k Keeper) GetDtagRelatedAddress(ctx sdk.Context, dtag string) (addr sdk.AccAddress)

GetDtagRelatedAddress returns the address associated to the given dtag or nil if it not exists

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)

GetParams returns the params from the store

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

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

GetProfiles returns all the created profiles inside the current context.

func (Keeper) GetUserDTagTransferRequests added in v0.12.0

func (k Keeper) GetUserDTagTransferRequests(ctx sdk.Context, user sdk.AccAddress) []types.DTagTransferRequest

GetUserDTagTransferRequests returns all the request made to the given user 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) SaveDTagTransferRequest added in v0.12.0

func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, transferRequest types.DTagTransferRequest) error

SaveDTagTransferRequest save the given request into the currentOwner's requests returning errors if an equal one already exists.

func (Keeper) SaveProfile

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

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

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets params on the store

Jump to

Keyboard shortcuts

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