Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper Keeper)
- func ValidSubspacesInvariant(k Keeper) sdk.Invariant
- type Keeper
- func (k Keeper) AddAdminToSubspace(ctx sdk.Context, subspaceID, user, owner string) error
- func (k Keeper) Admins(goCtx context.Context, request *types.QueryAdminsRequest) (*types.QueryAdminsResponse, error)
- func (k Keeper) BanUserInSubspace(ctx sdk.Context, subspaceID, user, admin string) error
- func (k Keeper) BannedUsers(goCtx context.Context, request *types.QueryBannedUsersRequest) (*types.QueryBannedUsersResponse, error)
- func (k Keeper) CheckSubspaceUserPermission(ctx sdk.Context, subspaceID string, user string) error
- func (k Keeper) DoesSubspaceExist(ctx sdk.Context, subspaceID string) bool
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllAdmins(ctx sdk.Context) []types.UsersEntry
- func (k Keeper) GetAllBannedUsers(ctx sdk.Context) []types.UsersEntry
- func (k Keeper) GetAllRegisteredUsers(ctx sdk.Context) []types.UsersEntry
- func (k Keeper) GetAllSubspaces(ctx sdk.Context) []types.Subspace
- func (k Keeper) GetSubspace(ctx sdk.Context, subspaceID string) (subspace types.Subspace, found bool)
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState)
- func (k Keeper) IsAdmin(ctx sdk.Context, subspaceID string, user string) bool
- func (k Keeper) IsBanned(ctx sdk.Context, subspaceID, user string) bool
- func (k Keeper) IsRegistered(ctx sdk.Context, subspaceID, user string) bool
- func (k Keeper) IterateSubspaceAdmins(ctx sdk.Context, id string, fn func(index int64, admin string) (stop bool))
- func (k Keeper) IterateSubspaceBannedUsers(ctx sdk.Context, id string, fn func(index int64, user string) (stop bool))
- func (k Keeper) IterateSubspaceRegisteredUsers(ctx sdk.Context, id string, fn func(index int64, user string) (stop bool))
- func (k Keeper) IterateSubspaces(ctx sdk.Context, fn func(index int64, subspace types.Subspace) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RegisterUserInSubspace(ctx sdk.Context, subspaceID, user, admin string) error
- func (k Keeper) RegisteredUsers(goCtx context.Context, request *types.QueryRegisteredUsersRequest) (*types.QueryRegisteredUsersResponse, error)
- func (k Keeper) RemoveAdminFromSubspace(ctx sdk.Context, subspaceID, user, owner string) error
- func (k Keeper) SaveSubspace(ctx sdk.Context, subspace types.Subspace, user string) error
- func (k Keeper) Subspace(ctx context.Context, request *types.QuerySubspaceRequest) (*types.QuerySubspaceResponse, error)
- func (k Keeper) Subspaces(goCtx context.Context, request *types.QuerySubspacesRequest) (*types.QuerySubspacesResponse, error)
- func (k Keeper) UnbanUserInSubspace(ctx sdk.Context, subspaceID, user, admin string) error
- func (k Keeper) UnregisterUserFromSubspace(ctx sdk.Context, subspaceID, user, admin string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the module
func NewMsgServerImpl ¶
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 ¶
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.BinaryCodec) Keeper
NewKeeper creates new instances of the subspaces keeper
func (Keeper) AddAdminToSubspace ¶
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 (k Keeper) Admins(goCtx context.Context, request *types.QueryAdminsRequest) (*types.QueryAdminsResponse, error)
func (Keeper) BanUserInSubspace ¶
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 (k Keeper) BannedUsers(goCtx context.Context, request *types.QueryBannedUsersRequest) (*types.QueryBannedUsersResponse, error)
func (Keeper) CheckSubspaceUserPermission ¶
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 ¶
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 ¶
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 ¶
IsAdmin returns true iff the given user is an admin of the subspace with the given id
func (Keeper) IsBanned ¶
IsBanned returns true iff the given user is banned inside the subspace with the given id
func (Keeper) IsRegistered ¶
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) RegisterUserInSubspace ¶
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) RegisteredUsers ¶
func (k Keeper) RegisteredUsers(goCtx context.Context, request *types.QueryRegisteredUsersRequest) (*types.QueryRegisteredUsersResponse, error)
func (Keeper) RemoveAdminFromSubspace ¶
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 ¶
SaveSubspace saves the given subspace inside the current context.
func (Keeper) Subspace ¶
func (k Keeper) Subspace(ctx context.Context, request *types.QuerySubspaceRequest) (*types.QuerySubspaceResponse, error)
func (Keeper) Subspaces ¶
func (k Keeper) Subspaces(goCtx context.Context, request *types.QuerySubspacesRequest) (*types.QuerySubspacesResponse, error)
func (Keeper) UnbanUserInSubspace ¶
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 ¶
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.