Documentation
¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func ValidProfileInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) DTagTransfers(ctx context.Context, request *types.QueryDTagTransfersRequest) (*types.QueryDTagTransfersResponse, error)
- func (k Keeper) DeleteAllDTagTransferRequests(ctx sdk.Context, user string)
- func (k Keeper) DeleteDTagTransferRequest(ctx sdk.Context, sender, recipient string) error
- func (k Keeper) DeleteUserBlock(ctx sdk.Context, blocker, blocked string, subspace string) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAddressFromDTag(ctx sdk.Context, dTag string) (addr string)
- func (k Keeper) GetAllRelationships(ctx sdk.Context) []types.Relationship
- func (k Keeper) GetAllUsersBlocks(ctx sdk.Context) []types.UserBlock
- func (k Keeper) GetDTagTransferRequests(ctx sdk.Context) (requests []types.DTagTransferRequest)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) GetProfile(ctx sdk.Context, address string) (profile *types.Profile, found bool, err error)
- func (k Keeper) GetProfiles(ctx sdk.Context) []*types.Profile
- func (k Keeper) GetUserBlocks(ctx sdk.Context, user string) []types.UserBlock
- func (k Keeper) GetUserIncomingDTagTransferRequests(ctx sdk.Context, user string) []types.DTagTransferRequest
- func (k Keeper) GetUserRelationships(ctx sdk.Context, user string) []types.Relationship
- func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, user, subspace string) bool
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) []abci.ValidatorUpdate
- func (k Keeper) IsUserBlocked(ctx sdk.Context, blocker, blocked string) bool
- func (k Keeper) IterateProfiles(ctx sdk.Context, fn func(index int64, profile *types.Profile) (stop bool))
- func (k Keeper) IterateRelationships(ctx sdk.Context, ...)
- func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Profile(ctx context.Context, request *types.QueryProfileRequest) (*types.QueryProfileResponse, error)
- func (k Keeper) RemoveProfile(ctx sdk.Context, address string) error
- func (k Keeper) RemoveRelationship(ctx sdk.Context, relationship types.Relationship) error
- func (k Keeper) SaveDTagTransferRequest(ctx sdk.Context, request types.DTagTransferRequest) error
- func (k Keeper) SaveRelationship(ctx sdk.Context, relationship types.Relationship) error
- func (k Keeper) SaveUserBlock(ctx sdk.Context, userBlock types.UserBlock) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) StoreProfile(ctx sdk.Context, profile *types.Profile) error
- func (k Keeper) UserBlocks(ctx context.Context, request *types.QueryUserBlocksRequest) (*types.QueryUserBlocksResponse, error)
- func (k Keeper) UserRelationships(ctx context.Context, request *types.QueryUserRelationshipsRequest) (*types.QueryUserRelationshipsResponse, error)
- func (k Keeper) ValidateProfile(ctx sdk.Context, profile *types.Profile) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
func NewMsgServerImpl ¶ added in v0.15.0
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 ¶
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:
- Address -> Profile This is used to easily retrieve the profile of a user based on an address
- DTag -> Address This is used to get the address of a user based on a DTag
func (Keeper) DTagTransfers ¶ added in v0.15.0
func (k Keeper) DTagTransfers(ctx context.Context, request *types.QueryDTagTransfersRequest) (*types.QueryDTagTransfersResponse, error)
DTagTransfers implements the Query/DTagTransfers gRPC method
func (Keeper) DeleteAllDTagTransferRequests ¶ added in v0.12.0
DeleteAllDTagTransferRequests delete all the requests made to the given user
func (Keeper) DeleteDTagTransferRequest ¶ added in v0.13.0
DeleteDTagTransferRequest deletes the transfer requests made from the sender towards the recipient
func (Keeper) DeleteUserBlock ¶ added in v0.16.0
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
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
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) 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) GetUserBlocks ¶ added in v0.16.0
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
GetUserRelationships allows to list all the stored relationships that involve the given user.
func (Keeper) HasUserBlocked ¶ added in v0.16.0
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
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
func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements the Query/Params gRPC method
func (Keeper) Profile ¶ added in v0.15.0
func (k Keeper) Profile(ctx context.Context, request *types.QueryProfileRequest) (*types.QueryProfileResponse, error)
Profile implements the Query/Profile gRPC method
func (Keeper) RemoveProfile ¶ added in v0.15.0
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
RemoveRelationship allows to delete the relationship between the given user and his counterparty
func (Keeper) SaveDTagTransferRequest ¶ added in v0.12.0
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
SaveRelationship allows to store the given relationship returning an error if he's already present.
func (Keeper) SaveUserBlock ¶ added in v0.16.0
SaveUserBlock allows to store the given block inside the store, returning an error if something goes wrong.
func (Keeper) StoreProfile ¶ added in v0.15.0
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
func (k Keeper) UserBlocks(ctx context.Context, request *types.QueryUserBlocksRequest) (*types.QueryUserBlocksResponse, error)
UserBlocks implements the Query/UserBlocks gRPC method
func (Keeper) UserRelationships ¶ added in v0.16.0
func (k Keeper) UserRelationships(ctx context.Context, request *types.QueryUserRelationshipsRequest) (*types.QueryUserRelationshipsResponse, error)
UserRelationships implements the Query/UserRelationships gRPC method