keeper

package
v0.0.0-...-03ee383 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 15 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

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func ValidRelationshipsInvariant(k Keeper) sdk.Invariant

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

func ValidUserBlocksInvariant(k Keeper) sdk.Invariant

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 (h Hooks) AfterSubspaceDeleted(ctx sdk.Context, subspaceID uint64)

func (Hooks) AfterSubspaceGroupDeleted

func (h Hooks) AfterSubspaceGroupDeleted(sdk.Context, uint64, uint32)

func (Hooks) AfterSubspaceGroupMemberAdded

func (h Hooks) AfterSubspaceGroupMemberAdded(sdk.Context, uint64, uint32, string)

func (Hooks) AfterSubspaceGroupMemberRemoved

func (h Hooks) AfterSubspaceGroupMemberRemoved(sdk.Context, uint64, uint32, string)

func (Hooks) AfterSubspaceGroupSaved

func (h Hooks) AfterSubspaceGroupSaved(sdk.Context, uint64, uint32)

func (Hooks) AfterSubspaceSaved

func (h Hooks) AfterSubspaceSaved(sdk.Context, uint64)

func (Hooks) AfterSubspaceSectionDeleted

func (h Hooks) AfterSubspaceSectionDeleted(sdk.Context, uint64, uint32)

func (Hooks) AfterSubspaceSectionSaved

func (h Hooks) AfterSubspaceSectionSaved(sdk.Context, uint64, uint32)

func (Hooks) AfterUserPermissionRemoved

func (h Hooks) AfterUserPermissionRemoved(sdk.Context, uint64, uint32, string)

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 sdk.StoreKey, sk types.SubspacesKeeper) Keeper

NewKeeper creates new instances of the relationships Keeper.

func (Keeper) Blocks

Blocks implements the Query/Blocks gRPC method

func (Keeper) DeleteRelationship

func (k Keeper) DeleteRelationship(ctx sdk.Context, user, counterparty string, subspaceID uint64)

DeleteRelationship deletes the given relationship

func (Keeper) DeleteUserBlock

func (k Keeper) DeleteUserBlock(ctx sdk.Context, blocker, blocked string, subspaceID uint64)

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

func (Keeper) DoesSubspaceExist

func (k Keeper) DoesSubspaceExist(ctx sdk.Context, subspaceID uint64) bool

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

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

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

func (k Keeper) HasRelationship(ctx sdk.Context, user, counterparty string, subspaceID uint64) bool

HasRelationship tells whether the relationship between the creator and counterparty already exists for the given subspace

func (Keeper) HasUserBlocked

func (k Keeper) HasUserBlocked(ctx sdk.Context, blocker, blocked string, subspaceID uint64) bool

HasUserBlocked returns true if the provided blocker has blocked the given user for the given subspace.

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Hooks creates new relationships hooks

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) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) Relationships

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

func (Keeper) SaveUserBlock

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

SaveUserBlock allows to store the given block inside the store

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper, pk profilesv4.Keeper) Migrator

NewMigrator returns a new Migrator

func (Migrator) Migrate1To2

func (m Migrator) Migrate1To2(ctx sdk.Context) error

Migrate1To2 migrates from version 1 to 2.

func (Migrator) Migrate2To3

func (m Migrator) Migrate2To3(ctx sdk.Context) error

Migrate1To2 migrates from version 2 to 3.

Jump to

Keyboard shortcuts

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