keeper

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 14 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 NewMsgServerImpl added in v0.15.0

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the profiles MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) 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

Types

type Keeper

type Keeper struct {
	// 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.BinaryMarshaler, storeKey sdk.StoreKey, paramSpace paramstypes.Subspace, ak authkeeper.AccountKeeper,
) Keeper

NewKeeper creates new instances of the Profiles Keeper. This k stores the profile data using two different associations:

  1. Address -> Profile This is used to easily retrieve the profile of a user based on an address
  2. DTag -> Address This is used to get the address of a user based on a DTag

func (Keeper) DTagTransfers added in v0.15.0

DTagTransfers implements the Query/DTagTransfers gRPC method

func (Keeper) DeleteAllDTagTransferRequests added in v0.12.0

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

DeleteAllDTagTransferRequests delete all the requests made to the given user

func (Keeper) DeleteDTagTransferRequest added in v0.13.0

func (k Keeper) DeleteDTagTransferRequest(ctx sdk.Context, sender, recipient string) error

DeleteDTagTransferRequest deletes the transfer requests made from the sender towards the recipient

func (Keeper) DeleteUserBlock added in v0.16.0

func (k Keeper) DeleteUserBlock(ctx sdk.Context, blocker, blocked string, subspace string) error

DeleteUserBlock allows to the specified blocker to unblock the given blocked user.

func (Keeper) ExportGenesis added in v0.15.0

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the GenesisState associated with the given context

func (Keeper) GetAddressFromDTag added in v0.16.0

func (k Keeper) GetAddressFromDTag(ctx sdk.Context, dTag string) (addr string)

GetAddressFromDTag returns the address associated to the given DTag or an empty string if it does not exists

func (Keeper) GetAllRelationships added in v0.16.0

func (k Keeper) GetAllRelationships(ctx sdk.Context) []types.Relationship

GetAllRelationships allows to returns the list of all stored relationships

func (Keeper) GetAllUsersBlocks added in v0.16.0

func (k Keeper) GetAllUsersBlocks(ctx sdk.Context) []types.UserBlock

GetAllUsersBlocks returns a list of all the users blocks inside the given context.

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) 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 string) (profile *types.Profile, found bool, err error)

GetProfile returns the profile corresponding to the given address inside the current context.

func (Keeper) GetProfiles

func (k Keeper) GetProfiles(ctx sdk.Context) []*types.Profile

func (Keeper) GetUserBlocks added in v0.16.0

func (k Keeper) GetUserBlocks(ctx sdk.Context, user string) []types.UserBlock

GetUserBlocks returns the list of users that the specified user has blocked.

func (Keeper) GetUserIncomingDTagTransferRequests added in v0.15.0

func (k Keeper) GetUserIncomingDTagTransferRequests(ctx sdk.Context, user string) []types.DTagTransferRequest

GetUserIncomingDTagTransferRequests returns all the request made to the given user inside the current context.

func (Keeper) GetUserRelationships added in v0.16.0

func (k Keeper) GetUserRelationships(ctx sdk.Context, user string) []types.Relationship

GetUserRelationships allows to list all the stored relationships that involve the given user.

func (Keeper) HasUserBlocked added in v0.16.0

func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, user, subspace string) bool

HasUserBlocked returns true if the provided blocker has blocked the given user for the given subspace. If the provided subspace is empty, all subspaces will be checked

func (Keeper) InitGenesis added in v0.15.0

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) []abci.ValidatorUpdate

InitGenesis initializes the chain state based on the given GenesisState

func (Keeper) IsUserBlocked added in v0.14.0

func (k Keeper) IsUserBlocked(ctx sdk.Context, blocker, blocked string) bool

IsUserBlocked tells if the given blocker has blocked the given blocked user

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) IterateRelationships added in v0.16.0

func (k Keeper) IterateRelationships(ctx sdk.Context, fn func(index int64, relationship types.Relationship) (stop bool))

IterateRelationships iterates through the relationships and perform the provided function

func (Keeper) Params added in v0.15.0

Params implements the Query/Params gRPC method

func (Keeper) Profile added in v0.15.0

Profile implements the Query/Profile gRPC method

func (Keeper) RemoveProfile added in v0.15.0

func (k Keeper) RemoveProfile(ctx sdk.Context, address string) error

RemoveProfile allows to delete a profile associated with the given address inside the current context. It assumes that the address-related profile exists.

func (Keeper) RemoveRelationship added in v0.16.0

func (k Keeper) RemoveRelationship(ctx sdk.Context, relationship types.Relationship) error

RemoveRelationship allows to delete the relationship between the given user and his counterparty

func (Keeper) SaveDTagTransferRequest added in v0.12.0

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

SaveDTagTransferRequest save the given request associating it to the request recipient. It returns an error if the same request already exists.

func (Keeper) SaveRelationship added in v0.16.0

func (k Keeper) SaveRelationship(ctx sdk.Context, relationship types.Relationship) error

SaveRelationship allows to store the given relationship returning an error if he's already present.

func (Keeper) SaveUserBlock added in v0.16.0

func (k Keeper) SaveUserBlock(ctx sdk.Context, userBlock types.UserBlock) error

SaveUserBlock allows to store the given block inside the store, returning an error if something goes wrong.

func (Keeper) SetParams

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

SetParams sets params on the store

func (Keeper) StoreProfile added in v0.15.0

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

StoreProfile stores 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) UserBlocks added in v0.16.0

UserBlocks implements the Query/UserBlocks gRPC method

func (Keeper) UserRelationships added in v0.16.0

UserRelationships implements the Query/UserRelationships gRPC method

func (Keeper) ValidateProfile added in v0.15.0

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

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

Jump to

Keyboard shortcuts

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