keeper

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the module

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the stored MsgServer interface for the provided keeper

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)

RegisterInvariants registers all subspaces invariants

func ValidSubspacesInvariant

func ValidSubspacesInvariant(k Keeper) sdk.Invariant

ValidSubspacesInvariant checks that all the subspaces are valid

Types

type Keeper

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

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey, cdc codec.BinaryMarshaler) Keeper

NewKeeper creates new instances of the subspaces keeper

func (Keeper) AddAdminToSubspace

func (k Keeper) AddAdminToSubspace(ctx sdk.Context, subspaceID, user, owner string) error

AddAdminToSubspace sets the given user as an admin of the subspace having the given id. Returns an error if the user is already an admin or the subspace does not exist.

func (Keeper) Admins

func (Keeper) BanUserInSubspace

func (k Keeper) BanUserInSubspace(ctx sdk.Context, subspaceID, user, admin string) error

BanUserInSubspace bans the given user inside the subspace with the given ID. It returns and error if the user is already blocked inside the subspace or the subspace does not exist.

func (Keeper) BannedUsers

func (Keeper) CheckSubspaceUserPermission

func (k Keeper) CheckSubspaceUserPermission(ctx sdk.Context, subspaceID string, user string) error

CheckSubspaceUserPermission checks the permission of the given user inside the subspace with the given id to make sure they are able to perform operations inside it

func (Keeper) DoesSubspaceExist

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

DoesSubspaceExist checks 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) GetAllAdmins

func (k Keeper) GetAllAdmins(ctx sdk.Context) []types.UsersEntry

GetAllAdmins returns the entries containing the data of all the admins of all the subspaces

func (Keeper) GetAllBannedUsers

func (k Keeper) GetAllBannedUsers(ctx sdk.Context) []types.UsersEntry

GetAllBannedUsers returns the entries containing the data of all the banned users of all the subspaces

func (Keeper) GetAllRegisteredUsers

func (k Keeper) GetAllRegisteredUsers(ctx sdk.Context) []types.UsersEntry

GetAllRegisteredUsers returns the entries containing the data of all the registered users of all the subspaces

func (Keeper) GetAllSubspaces

func (k Keeper) GetAllSubspaces(ctx sdk.Context) []types.Subspace

GetAllSubspaces returns a list of all the subspaces that have been store inside the given context

func (Keeper) GetSubspace

func (k Keeper) GetSubspace(ctx sdk.Context, subspaceID string) (subspace types.Subspace, found bool)

GetSubspace returns the subspace associated with the given ID. If there is no subspace associated with the given ID the function will return an empty subspace and false.

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

func (k Keeper) IsAdmin(ctx sdk.Context, subspaceID string, user string) bool

IsAdmin returns true iff the given user is an admin of the subspace with the given id

func (Keeper) IsBanned

func (k Keeper) IsBanned(ctx sdk.Context, subspaceID, user string) bool

IsBanned returns true iff the given user is banned inside the subspace with the given id

func (Keeper) IsRegistered

func (k Keeper) IsRegistered(ctx sdk.Context, subspaceID, user string) bool

IsRegistered returns true iff the given user is registered inside the subspace with the given id

func (Keeper) IterateSubspaceAdmins

func (k Keeper) IterateSubspaceAdmins(ctx sdk.Context, id string, fn func(index int64, admin string) (stop bool))

IterateSubspaceAdmins iterates over all the admins of the subspace having the given id

func (Keeper) IterateSubspaceBannedUsers

func (k Keeper) IterateSubspaceBannedUsers(ctx sdk.Context, id string, fn func(index int64, user string) (stop bool))

IterateSubspaceBannedUsers iterates over all the banned users of the subspace having the given id

func (Keeper) IterateSubspaceRegisteredUsers

func (k Keeper) IterateSubspaceRegisteredUsers(ctx sdk.Context, id string, fn func(index int64, user string) (stop bool))

IterateSubspaceRegisteredUsers iterates over all the registered users of the subspace having the given id

func (Keeper) IterateSubspaces

func (k Keeper) IterateSubspaces(ctx sdk.Context, fn func(index int64, subspace types.Subspace) (stop bool))

IterateSubspaces iterates through the subspaces set 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) RegisterUserInSubspace

func (k Keeper) RegisterUserInSubspace(ctx sdk.Context, subspaceID, user, admin string) error

RegisterUserInSubspace registers the given user inside the subspace with the given ID. It returns error if the user is already registered or the subspace does not exist.

func (Keeper) RemoveAdminFromSubspace

func (k Keeper) RemoveAdminFromSubspace(ctx sdk.Context, subspaceID, user, owner string) error

RemoveAdminFromSubspace removes the given user from the admin set of the subspace having the given id. It returns an error if the user was not an admin or the subspace does not exist.

func (Keeper) SaveSubspace

func (k Keeper) SaveSubspace(ctx sdk.Context, subspace types.Subspace, user string) error

SaveSubspace saves the given subspace inside the current context.

func (Keeper) Subspace

func (Keeper) Subspaces

func (Keeper) UnbanUserInSubspace

func (k Keeper) UnbanUserInSubspace(ctx sdk.Context, subspaceID, user, admin string) error

UnbanUserInSubspace unbans the given user inside the subspace with the given ID. It returns error if the user is not banned inside the subspace or the subspace does not exist.

func (Keeper) UnregisterUserFromSubspace

func (k Keeper) UnregisterUserFromSubspace(ctx sdk.Context, subspaceID, user, admin string) error

UnregisterUserFromSubspace unregisters the given user from the subspace with the given ID. It returns error if the user is not registered or the subspace does not exist.

Jump to

Keyboard shortcuts

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