keeper

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMigrationHandler added in v0.22.0

func GetMigrationHandler() func(ctx sdk.Context) error

GetMigrationHandler returns the handler that performs in-place store migrations

func NewMsgServer

func NewMsgServer(keeper Keeper, snapshotter Snapshotter, staker types.Staker, nexus types.Nexus) types.MsgServiceServer

NewMsgServer returns an implementation of the MsgServiceServer interface for the provided Keeper.

Types

type Keeper

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

Keeper provides access to all state changes regarding this module

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace) Keeper

NewKeeper is the constructor for the keeper

func (Keeper) AssignKey

func (k Keeper) AssignKey(ctx sdk.Context, chainName nexus.ChainName, keyID exported.KeyID) error

AssignKey assigns the given key ID to be the next key of the given chain

func (Keeper) DeleteKeygenSession

func (k Keeper) DeleteKeygenSession(ctx sdk.Context, id exported.KeyID)

DeleteKeygenSession deletes the keygen session with the given key ID

func (Keeper) DeleteSigningSession

func (k Keeper) DeleteSigningSession(ctx sdk.Context, id uint64)

DeleteSigningSession deletes the signing session with the given ID

func (Keeper) ExportGenesis

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

ExportGenesis generates a genesis file from the state

func (Keeper) GetActiveKeyIDs

func (k Keeper) GetActiveKeyIDs(ctx sdk.Context, chainName nexus.ChainName) []exported.KeyID

GetActiveKeyIDs returns all active keys in reverse temporal order. The first key is the key of the current epoch

func (Keeper) GetCurrentKey

func (k Keeper) GetCurrentKey(ctx sdk.Context, chainName nexus.ChainName) (exported.Key, bool)

GetCurrentKey returns the current key of the given chain

func (Keeper) GetCurrentKeyID

func (k Keeper) GetCurrentKeyID(ctx sdk.Context, chainName nexus.ChainName) (exported.KeyID, bool)

GetCurrentKeyID returns the current key ID of the given chain

func (Keeper) GetKey

func (k Keeper) GetKey(ctx sdk.Context, keyID exported.KeyID) (exported.Key, bool)

GetKey returns the key of the given ID

func (Keeper) GetKeygenSession added in v0.21.1

func (k Keeper) GetKeygenSession(ctx sdk.Context, id exported.KeyID) (types.KeygenSession, bool)

GetKeygenSession returns a keygen session by key ID if it exists

func (Keeper) GetKeygenSessionsByExpiry

func (k Keeper) GetKeygenSessionsByExpiry(ctx sdk.Context, expiry int64) []types.KeygenSession

GetKeygenSessionsByExpiry returns all keygen sessions that either expires at or goes out of the grace period at the given block height

func (Keeper) GetNextKeyID

func (k Keeper) GetNextKeyID(ctx sdk.Context, chainName nexus.ChainName) (exported.KeyID, bool)

GetNextKeyID returns the next key ID of the given chain

func (Keeper) GetParams added in v0.34.0

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

func (Keeper) GetSigRouter

func (k Keeper) GetSigRouter() types.SigRouter

GetSigRouter returns the sig router. If no router was set, it returns a (sealed) router with no handlers

func (Keeper) GetSigningSessionsByExpiry

func (k Keeper) GetSigningSessionsByExpiry(ctx sdk.Context, expiry int64) []types.SigningSession

GetSigningSessionsByExpiry returns all signing sessions that either expires at or goes out of the grace period at the given block height

func (Keeper) HasOptedOut added in v0.27.0

func (k Keeper) HasOptedOut(ctx sdk.Context, participant sdk.AccAddress) bool

HasOptedOut returns true if the given participant is opted out of future keygens

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, state *types.GenesisState)

InitGenesis initializes the state from a genesis file

func (Keeper) KeygenOptIn added in v0.27.0

func (k Keeper) KeygenOptIn(ctx sdk.Context, participant sdk.AccAddress)

KeygenOptIn opts in the given participant to future keygens

func (Keeper) KeygenOptOut added in v0.27.0

func (k Keeper) KeygenOptOut(ctx sdk.Context, participant sdk.AccAddress)

KeygenOptOut opts out the given participant of future keygens

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger

func (Keeper) RotateKey

func (k Keeper) RotateKey(ctx sdk.Context, chainName nexus.ChainName) error

RotateKey rotates to the given chain's next key

func (Keeper) SetKey

func (k Keeper) SetKey(ctx sdk.Context, key types.Key)

SetKey sets the given key

func (*Keeper) SetSigRouter

func (k *Keeper) SetSigRouter(router types.SigRouter)

SetSigRouter sets the sig router. It will panic if called more than once

func (Keeper) Sign

func (k Keeper) Sign(ctx sdk.Context, keyID exported.KeyID, payloadHash exported.Hash, module string, moduleMetadata ...codec.ProtoMarshaler) error

Sign starts a signing session to sign the given payload's hash with the given key ID

type Querier

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

Querier implements the grpc queries for the multisig module

func NewGRPCQuerier

func NewGRPCQuerier(k types.Keeper, s types.Staker) Querier

NewGRPCQuerier creates a new multisig Querier

func (Querier) Key

Key returns the key corresponding to a given key ID

func (Querier) KeyID

KeyID returns the key ID assigned to a given chain

func (Querier) KeygenSession added in v0.21.1

KeygenSession returns the keygen session info for the given key ID

func (Querier) NextKeyID

NextKeyID returns the key ID assigned for the next rotation on a given chain and empty if none is assigned

func (Querier) Params added in v0.34.0

Params returns the reward module params

type SnapshotCreator

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

SnapshotCreator is an implementation of Snapshotter

func NewSnapshotCreator

func NewSnapshotCreator(keygen types.KeygenParticipator, snapshotter types.Snapshotter, staker types.Staker, slasher types.Slasher) SnapshotCreator

NewSnapshotCreator is the constructor for snapshot creator

func (SnapshotCreator) CreateSnapshot

func (sc SnapshotCreator) CreateSnapshot(ctx sdk.Context, threshold utils.Threshold) (snapshot.Snapshot, error)

CreateSnapshot creates a snapshot for multisig keygen

func (SnapshotCreator) GetOperator

func (sc SnapshotCreator) GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress

GetOperator returns the operator of the given proxy

type Snapshotter

type Snapshotter interface {
	CreateSnapshot(ctx sdk.Context, threshold utils.Threshold) (snapshot.Snapshot, error)
	GetOperator(ctx sdk.Context, proxy sdk.AccAddress) sdk.ValAddress
}

Snapshotter is an interface to create snapshots for multisig keygen

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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