keeper

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 16 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

	// TSS Events Storage
	TssEvents        collections.Map[uint64, types.TssEvent] // Key: event ID -> Value: TssEvent
	NextTssEventId   collections.Sequence                    // auto-increment counter for event IDs
	PendingTssEvents collections.Map[uint64, uint64]         // Key: process_id -> Value: event_id (ACTIVE only)

	// Fund Migration Storage
	FundMigrations    collections.Map[uint64, types.FundMigration] // migration_id -> FundMigration
	NextMigrationId   collections.Sequence                         // auto-increment counter for migration IDs
	PendingMigrations collections.Map[uint64, uint64]              // migration_id -> migration_id (pending index)
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService storetypes.KVStoreService,
	logger log.Logger,
	authority string,
	uvalidatorKeeper types.UValidatorKeeper,
	uregistryKeeper types.URegistryKeeper,
	uexecutorKeeper types.UExecutorKeeper,
) 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) InitiateFundMigration added in v0.0.28

func (k Keeper) InitiateFundMigration(ctx context.Context, oldKeyId, chain string) (uint64, error)

InitiateFundMigration validates and creates a fund migration from an old TSS key vault to the current TSS key vault for a specific chain.

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) MigrateFundMigrationsL1GasFee added in v0.0.33

func (k Keeper) MigrateFundMigrationsL1GasFee(ctx context.Context) error

MigrateFundMigrationsL1GasFee walks every FundMigration record and sets L1GasFee to "0" when unset. Records stored before the l1_gas_fee proto field existed decode with an empty string; downstream relayer/universalClient code parses this value as a decimal wei amount, so we normalize it here.

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) VoteFundMigration added in v0.0.28

func (k Keeper) VoteFundMigration(
	ctx context.Context,
	universalValidator sdk.ValAddress,
	migrationId uint64,
	txHash string,
	success bool,
) error

VoteFundMigration handles a validator's vote on an observed fund migration tx.

func (Keeper) VoteOnFundMigrationBallot added in v0.0.28

func (k Keeper) VoteOnFundMigrationBallot(
	ctx context.Context,
	universalValidator sdk.ValAddress,
	migrationId uint64,
	txHash string,
	success bool,
) (isFinalized bool, isNew bool, err error)

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) AllFundMigrations added in v0.0.28

AllFundMigrations implements types.QueryServer.

func (Querier) AllKeys

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

func (Querier) AllPendingTssEvents added in v0.0.23

AllPendingTssEvents returns all pending TSS events (paginated). Uses pagination.reverse for descending order (default: ascending by process_id).

func (Querier) AllProcesses

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

func (Querier) AllTssEvents added in v0.0.23

---------------- All TSS Events (Paginated) -------------

func (Querier) CurrentKey

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

func (Querier) CurrentProcess

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

func (Querier) GetFundMigration added in v0.0.28

GetFundMigration implements types.QueryServer.

func (Querier) GetPendingTssEvent added in v0.0.23

GetPendingTssEvent returns a single pending TSS event by process ID.

func (Querier) GetTssEvent added in v0.0.23

---------------- Get TSS Event by ID --------------------

func (Querier) KeyById

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

func (Querier) Params

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

func (Querier) PendingFundMigrations added in v0.0.28

PendingFundMigrations implements types.QueryServer.

func (Querier) ProcessById

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

Jump to

Keyboard shortcuts

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