Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func ValidRelationshipsInvariant(k Keeper) sdk.Invariant
- func ValidUserBlocksInvariant(k Keeper) sdk.Invariant
- type Hooks
- func (h Hooks) AfterSubspaceDeleted(ctx sdk.Context, subspaceID uint64)
- func (h Hooks) AfterSubspaceGroupDeleted(sdk.Context, uint64, uint32)
- func (h Hooks) AfterSubspaceGroupMemberAdded(sdk.Context, uint64, uint32, string)
- func (h Hooks) AfterSubspaceGroupMemberRemoved(sdk.Context, uint64, uint32, string)
- func (h Hooks) AfterSubspaceGroupSaved(sdk.Context, uint64, uint32)
- func (h Hooks) AfterSubspaceSaved(sdk.Context, uint64)
- func (h Hooks) AfterSubspaceSectionDeleted(sdk.Context, uint64, uint32)
- func (h Hooks) AfterSubspaceSectionSaved(sdk.Context, uint64, uint32)
- func (h Hooks) AfterUserPermissionRemoved(sdk.Context, uint64, uint32, string)
- func (h Hooks) AfterUserPermissionSet(sdk.Context, uint64, uint32, string, subspacestypes.Permissions)
- type Keeper
- func (k Keeper) Blocks(ctx context.Context, request *types.QueryBlocksRequest) (*types.QueryBlocksResponse, error)
- func (k Keeper) DeleteRelationship(ctx sdk.Context, user, counterparty string, subspaceID uint64)
- func (k Keeper) DeleteUserBlock(ctx sdk.Context, blocker, blocked string, subspaceID uint64)
- func (k Keeper) DoesSubspaceExist(ctx sdk.Context, subspaceID uint64) bool
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllRelationships(ctx sdk.Context) []types.Relationship
- func (k Keeper) GetAllUserBlocks(ctx sdk.Context) []types.UserBlock
- func (k Keeper) GetRelationship(ctx sdk.Context, user, counterparty string, subspaceID uint64) (types.Relationship, bool)
- func (k Keeper) GetUserBlock(ctx sdk.Context, blocker, blocked string, subspaceID uint64) (userBlock types.UserBlock, found bool)
- func (k Keeper) HasRelationship(ctx sdk.Context, user, counterparty string, subspaceID uint64) bool
- func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, blocked string, subspaceID uint64) bool
- func (k *Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) IterateRelationships(ctx sdk.Context, ...)
- func (k Keeper) IterateSubspaceRelationships(ctx sdk.Context, subspaceID uint64, ...)
- func (k Keeper) IterateSubspaceUsersBlocks(ctx sdk.Context, subspaceID uint64, ...)
- func (k Keeper) IterateUsersBlocks(ctx sdk.Context, fn func(index int64, block types.UserBlock) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Relationships(ctx context.Context, request *types.QueryRelationshipsRequest) (*types.QueryRelationshipsResponse, error)
- func (k Keeper) SaveRelationship(ctx sdk.Context, relationship types.Relationship)
- func (k Keeper) SaveUserBlock(ctx sdk.Context, userBlock types.UserBlock)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the relationships MsgServer interface for the provided Keeper.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
RegisterInvariants registers all posts invariants
func ValidRelationshipsInvariant ¶
ValidRelationshipsInvariant checks that all relationships are associated with a creator that has a profile and they do not have the same user as creator and recipient
func ValidUserBlocksInvariant ¶
ValidUserBlocksInvariant checks that all created user blocks have been created by a user with a profile and they do not have the same user as creator and recipient
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks represents a wrapper struct
func (Hooks) AfterSubspaceDeleted ¶
func (Hooks) AfterSubspaceGroupDeleted ¶
func (Hooks) AfterSubspaceGroupMemberAdded ¶
func (Hooks) AfterSubspaceGroupMemberRemoved ¶
func (Hooks) AfterSubspaceGroupSaved ¶
func (Hooks) AfterSubspaceSectionDeleted ¶
func (Hooks) AfterSubspaceSectionSaved ¶
func (Hooks) AfterUserPermissionRemoved ¶
func (Hooks) AfterUserPermissionSet ¶
func (h Hooks) AfterUserPermissionSet(sdk.Context, uint64, uint32, string, subspacestypes.Permissions)
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.BinaryCodec, storeKey storetypes.StoreKey, sk types.SubspacesKeeper) Keeper
NewKeeper creates new instances of the relationships Keeper.
func (Keeper) Blocks ¶
func (k Keeper) Blocks(ctx context.Context, request *types.QueryBlocksRequest) (*types.QueryBlocksResponse, error)
Blocks implements the Query/Blocks gRPC method
func (Keeper) DeleteRelationship ¶
DeleteRelationship deletes the given relationship
func (Keeper) DeleteUserBlock ¶
DeleteUserBlock allows to the specified blocker to unblock the given blocked user
func (Keeper) DoesSubspaceExist ¶
DoesSubspaceExist tells if the subspace with the given id exists
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the GenesisState associated with the given context
func (Keeper) GetAllRelationships ¶
func (k Keeper) GetAllRelationships(ctx sdk.Context) []types.Relationship
GetAllRelationships returns the list of all stored relationships
func (Keeper) GetAllUserBlocks ¶
GetAllUserBlocks returns the list of all stored blocks
func (Keeper) GetRelationship ¶
func (k Keeper) GetRelationship(ctx sdk.Context, user, counterparty string, subspaceID uint64) (types.Relationship, bool)
GetRelationship returns the relationship existing between the provided creator and recipient inside the given subspace
func (Keeper) GetUserBlock ¶
func (k Keeper) GetUserBlock(ctx sdk.Context, blocker, blocked string, subspaceID uint64) (userBlock types.UserBlock, found bool)
GetUserBlock returns the user block that has been created from the given blocker towards the provided blocked address for the specified subspace.
func (Keeper) HasRelationship ¶
HasRelationship tells whether the relationship between the creator and counterparty already exists for the given subspace
func (Keeper) HasUserBlocked ¶
HasUserBlocked returns true if the provided blocker has blocked the given user for the given subspace.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis initializes the chain state based on the given GenesisState
func (Keeper) IterateRelationships ¶
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) IterateSubspaceRelationships ¶
func (k Keeper) IterateSubspaceRelationships(ctx sdk.Context, subspaceID uint64, fn func(index int64, relationship types.Relationship) (stop bool))
IterateSubspaceRelationships iterates over all the relationships present inside the given subspace
func (Keeper) IterateSubspaceUsersBlocks ¶
func (k Keeper) IterateSubspaceUsersBlocks(ctx sdk.Context, subspaceID uint64, fn func(index int64, block types.UserBlock) (stop bool))
IterateSubspaceUsersBlocks iterates through the list of user blocks stored for a subspace and performs the given function
func (Keeper) IterateUsersBlocks ¶
func (k Keeper) IterateUsersBlocks(ctx sdk.Context, fn func(index int64, block types.UserBlock) (stop bool))
IterateUsersBlocks iterates through the list of user blocks and performs the given function
func (Keeper) Relationships ¶
func (k Keeper) Relationships(ctx context.Context, request *types.QueryRelationshipsRequest) (*types.QueryRelationshipsResponse, error)
Relationships implements the Query/Relationships gRPC method
func (Keeper) SaveRelationship ¶
func (k Keeper) SaveRelationship(ctx sdk.Context, relationship types.Relationship)
SaveRelationship allows to store the given relationship returning an error if something goes wrong