keeper

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidPermission

func IsValidPermission(perm types.Permission, country string, checkTime time.Time) error

IsValidPermission checks if a perm is valid for a given country code and time A valid perm (ACTIVE state): - Has a matching country (perm country is null or matches the provided country) - Is currently effective (effective_from must be set and effective_from ≤ now < effective_until) - Is not revoked - Is not slashed - Is not repaid According to the spec, if validator permission is INACTIVE (not valid), it must abort. INACTIVE means: effective_from is null OR effective_from equals now() exactly (not before).

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {

	// state
	Permission        collections.Map[uint64, types.Permission]
	PermissionCounter collections.Item[uint64]
	PermissionSession collections.Map[string, types.PermissionSession]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,
	credentialSchemaKeeper types.CredentialSchemaKeeper,
	trustRegistryKeeper types.TrustRegistryKeeper,
	trustDeposit types.TrustDepositKeeper,
	bankKeeper types.BankKeeper,
) Keeper

func (Keeper) CreatePermission

func (k Keeper) CreatePermission(ctx sdk.Context, perm types.Permission) (uint64, error)

CreatePermission creates a new perm and returns its ID

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) GetPermissionByID

func (k Keeper) GetPermissionByID(ctx sdk.Context, id uint64) (types.Permission, error)

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) SetParams

func (k Keeper) SetParams(ctx context.Context, params types.Params) error

SetParams set the params

func (Keeper) UpdatePermission

func (k Keeper) UpdatePermission(ctx sdk.Context, perm types.Permission) error

Jump to

Keyboard shortcuts

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