keeper

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the module MsgServer interface.

Types

type Hooks

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

func (Hooks) AfterValidatorAdded

func (h Hooks) AfterValidatorAdded(ctx sdk.Context, valAddr sdk.ValAddress)

AfterValidatorAdded -> a universal validator has been added to the set

func (Hooks) AfterValidatorRemoved

func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, valAddr sdk.ValAddress)

AfterValidatorRemoved -> a universal validator has been removed from the set

func (Hooks) AfterValidatorStatusChanged

func (h Hooks) AfterValidatorStatusChanged(ctx sdk.Context, valAddr sdk.ValAddress, oldStatus, newStatus uvalidatortypes.UVStatus)

type Keeper

type Keeper struct {

	// Module State
	Params            collections.Item[types.Params]               // module params
	NextProcessId     collections.Sequence                         // counter for next process id
	CurrentTssProcess collections.Item[types.TssKeyProcess]        // current/active process
	ProcessHistory    collections.Map[uint64, types.TssKeyProcess] // history of past processes

	// TSS Key Storage
	CurrentTssKey collections.Item[types.TssKey]        // currently active finalized key
	TssKeyHistory collections.Map[string, types.TssKey] // map of key_id -> TssKey
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService storetypes.KVStoreService,
	logger log.Logger,
	authority string,
	uvalidatorKeeper types.UValidatorKeeper,
) Keeper

NewKeeper creates a new Keeper instance

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx context.Context) *types.GenesisState

ExportGenesis exports the module's state to a genesis state.

func (Keeper) FinalizeTssKeyProcess

func (k Keeper) FinalizeTssKeyProcess(ctx context.Context, processID uint64, status types.TssKeyProcessStatus) error

FinalizeTssKeyProcess updates a process status and removes it from current if completed.

func (Keeper) GetCurrentTssKey

func (k Keeper) GetCurrentTssKey(ctx context.Context) (types.TssKey, bool, error)

GetCurrentTssKey fetches the currently active finalized key.

func (Keeper) GetCurrentTssParticipants

func (k Keeper) GetCurrentTssParticipants(ctx context.Context) ([]string, error)

GetCurrentTssParticipants returns the participants of current tss (ongoing)

func (Keeper) GetTssKeyByID

func (k Keeper) GetTssKeyByID(ctx context.Context, keyID string) (types.TssKey, bool, error)

GetTssKeyByID retrieves a specific key from history using key_id.

func (Keeper) GetTssKeyProcessByID

func (k Keeper) GetTssKeyProcessByID(ctx context.Context, processID uint64) (types.TssKeyProcess, bool, error)

GetTssKeyProcessByID retrieves a specific tss key process from history using process_id.

func (Keeper) GetTssParticipants

func (k Keeper) GetTssParticipants(ctx context.Context, processType types.TssProcessType) ([]string, error)

func (Keeper) GetUValidatorKeeper

func (k Keeper) GetUValidatorKeeper() types.UValidatorKeeper

func (Keeper) HasOngoingTss

func (k Keeper) HasOngoingTss(ctx context.Context) (bool, error)

HasOngoingTss returns true if a TSS process exists and is not expired

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error

InitGenesis initializes the module's state from a genesis state.

func (Keeper) InitiateTssKeyProcess

func (k Keeper) InitiateTssKeyProcess(
	ctx context.Context,
	processType types.TssProcessType,
) error

InitiateTssKeyProcess creates a new keygen or reshare process.

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

func (Keeper) SchemaBuilder

func (k Keeper) SchemaBuilder() *collections.SchemaBuilder

func (Keeper) SetCurrentTssKey

func (k Keeper) SetCurrentTssKey(ctx context.Context, key types.TssKey) error

SetCurrentTssKey stores the finalized active TSS key.

func (Keeper) UpdateParams

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

updateParams is for updating params collections of the module

func (Keeper) VoteOnTssBallot

func (k Keeper) VoteOnTssBallot(
	ctx context.Context,
	universalValidator sdk.ValAddress,
	processId uint64,
	tssPubKey, keyId string,
) (isFinalized bool,
	isNew bool,
	err error)

func (Keeper) VoteTssKeyProcess

func (k Keeper) VoteTssKeyProcess(
	ctx context.Context,
	universalValidator sdk.ValAddress,
	tssPubKey, keyId string,
	processId uint64,
) error

type Querier

type Querier struct {
	Keeper
}

func NewQuerier

func NewQuerier(keeper Keeper) Querier

func (Querier) AllKeys

---------------- All Keys (Paginated) -------------------

func (Querier) AllProcesses

---------------- All Processes (Paginated) -------------

func (Querier) CurrentKey

---------------- Current TSS Key -----------------------

func (Querier) CurrentProcess

---------------- Current TSS Process ------------------

func (Querier) KeyById

---------------- Key By ID -----------------------------

func (Querier) Params

---------------- Params ------------------

func (Querier) ProcessById

---------------- Process By ID ------------------------

Jump to

Keyboard shortcuts

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