keeper

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_RETRIES = 5
View Source
const (
	PrivateGovIdentity = "private-gov-identity"
)

Variables

View Source
var SupportedIDTypes = []string{PrivateGovIdentity}

Functions

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 {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,
	ibcKeeperFn func() *ibckeeper.Keeper,
	scopedKeeper exported.ScopedKeeper,

	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	pepKeeper types.PepKeeper,
	slashingKeeper types.SlashingKeeper,
	stakingKeeper types.StakingKeeper,
	govKeeper types.GovKeeper,
) Keeper

func (Keeper) AggregatedKeyShare

AggregatedKeyShare returns the aggregated key share for a particular height

func (Keeper) AggregatedKeyShareAll

AggregatedKeyShareAll returns the paginated list of all aggregated keyshares

func (*Keeper) AuthenticateCapability added in v0.7.0

func (k *Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool

AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function

func (*Keeper) BindPort added in v0.7.0

func (k *Keeper) BindPort(ctx sdk.Context, portID string) error

BindPort defines a wrapper function for the port Keeper's function in order to expose it to module's InitGenesis function

func (*Keeper) ChanCloseInit added in v0.7.0

func (k *Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string) error

ChanCloseInit defines a wrapper function for the channel Keeper's function.

func (*Keeper) ClaimCapability added in v0.7.0

func (k *Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error

ClaimCapability allows the IBC app module to claim a capability that core IBC passes to it

func (Keeper) Commitments

Commitments returns the list of all keyshares submitted

func (Keeper) DecreaseAuthorizedCount

func (k Keeper) DecreaseAuthorizedCount(
	ctx context.Context,
	creator string,
)

func (Keeper) DeleteActiveCommitments

func (k Keeper) DeleteActiveCommitments(ctx context.Context)

DeleteActiveCommitments deletes the active public key in the store

func (Keeper) DeleteActivePubKey

func (k Keeper) DeleteActivePubKey(ctx context.Context)

DeleteActivePubKey deletes the active public key in the store

func (Keeper) DeleteQueuedCommitments

func (k Keeper) DeleteQueuedCommitments(ctx context.Context)

DeleteQueuedCommitments deletes the queued public key in the store

func (Keeper) DeleteQueuedPubKey

func (k Keeper) DeleteQueuedPubKey(ctx context.Context)

DeleteQueuedPubKey deletes the queued public key in the store

func (Keeper) GetActiveCommitments

func (k Keeper) GetActiveCommitments(
	ctx context.Context,
) (val types.Commitments, found bool)

GetActiveCommitments returns the Active public key

func (Keeper) GetActivePubKey

func (k Keeper) GetActivePubKey(
	ctx context.Context,
) (val types.ActivePubKey, found bool)

GetActivePubKey returns the Active public key

func (Keeper) GetAggregatedKeyShare

func (k Keeper) GetAggregatedKeyShare(
	ctx sdk.Context,
	height uint64,

) (val types.AggregatedKeyShare, found bool)

GetAggregatedKeyShare returns a aggregatedKeyShare from its index

func (Keeper) GetAggregatedKeyShareLength

func (k Keeper) GetAggregatedKeyShareLength(
	ctx sdk.Context,
) uint64

GetAggregatedKeyShareLength returns the length of aggregatedKeyShare

func (Keeper) GetAllAggregatedKeyShare

func (k Keeper) GetAllAggregatedKeyShare(ctx sdk.Context) (list []types.AggregatedKeyShare)

GetAllAggregatedKeyShare returns all aggregatedKeyShare

func (Keeper) GetAllAuthorizedAddress

func (k Keeper) GetAllAuthorizedAddress(ctx context.Context) (list []types.AuthorizedAddress)

GetAllAuthorizedAddress returns all authorizedAddress

func (Keeper) GetAllGeneralKeyShare

func (k Keeper) GetAllGeneralKeyShare(ctx context.Context) (list []types.GeneralKeyShare)

GetAllGeneralKeyShare returns all generalKeyShare

func (Keeper) GetAllKeyShare

func (k Keeper) GetAllKeyShare(ctx context.Context) (list []types.KeyShare)

GetAllKeyShare returns all keyShare

func (Keeper) GetAllKeyShareRequests

func (k Keeper) GetAllKeyShareRequests(ctx context.Context) (list []types.KeyShareRequest)

GetAllKeyShareRequests returns all keyShare requests

func (Keeper) GetAllPrivateKeyShare added in v0.9.0

func (k Keeper) GetAllPrivateKeyShare(ctx context.Context) (list []types.ValidatorEncryptedKeyShare)

GetAllPrivateKeyShare returns all private KeyShares

func (Keeper) GetAllPrivateKeyShareRequests added in v0.9.0

func (k Keeper) GetAllPrivateKeyShareRequests(ctx context.Context) (list []types.PrivateKeyshareRequest)

GetAllPrivateKeyShareRequests returns all private keyShare requests

func (Keeper) GetAllValidatorSet

func (k Keeper) GetAllValidatorSet(ctx context.Context) (list []types.ValidatorSet)

GetAllValidatorSet returns all validatorSet

func (Keeper) GetAuthority added in v0.7.0

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetAuthorizedAddress

func (k Keeper) GetAuthorizedAddress(
	ctx context.Context,
	target string,

) (val types.AuthorizedAddress, found bool)

GetAuthorizedAddress returns a authorizedAddress from its index

func (Keeper) GetAuthorizedCount

func (k Keeper) GetAuthorizedCount(
	ctx context.Context,
	creator string,
) uint64

func (Keeper) GetGeneralKeyShare

func (k Keeper) GetGeneralKeyShare(
	ctx context.Context,
	validator string,
	idType string,
	idValue string,
) (val types.GeneralKeyShare, found bool)

GetGeneralKeyShare returns a generalKeyShare from its index

func (Keeper) GetKeyShare

func (k Keeper) GetKeyShare(
	ctx context.Context,
	validator string,
	blockHeight uint64,

) (val types.KeyShare, found bool)

GetKeyShare returns a keyShare from its index

func (Keeper) GetKeyShareRequest

func (k Keeper) GetKeyShareRequest(
	ctx context.Context,
	identity string,

) (val types.KeyShareRequest, found bool)

GetKeyShareRequest returns a keyShare request from its index

func (Keeper) GetLastSubmittedHeight

func (k Keeper) GetLastSubmittedHeight(ctx context.Context, validator string) uint64

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (*Keeper) GetPort added in v0.7.0

func (k *Keeper) GetPort(ctx sdk.Context) string

GetPort returns the portID for the IBC app module. Used in ExportGenesis

func (Keeper) GetPrivateKeyShare added in v0.9.0

func (k Keeper) GetPrivateKeyShare(
	ctx context.Context,
	validator string,
	identity string,
	requester string,
) (val types.ValidatorEncryptedKeyShare, found bool)

GetPrivateKeyShare returns a private KeyShare from its index

func (Keeper) GetPrivateKeyShareRequest added in v0.9.0

func (k Keeper) GetPrivateKeyShareRequest(
	ctx context.Context,
	identity string,
) (val types.PrivateKeyshareRequest, found bool)

GetPrivateKeyShareRequest returns a private keyShare request from its index

func (Keeper) GetQueuedCommitments

func (k Keeper) GetQueuedCommitments(
	ctx context.Context,
) (val types.Commitments, found bool)

GetQueuedCommitments returns the Queued public key

func (Keeper) GetQueuedPubKey

func (k Keeper) GetQueuedPubKey(
	ctx context.Context,
) (val types.QueuedPubKey, found bool)

GetQueuedPubKey returns the Queued public key

func (Keeper) GetRequestCount

func (k Keeper) GetRequestCount(ctx sdk.Context) string

GetRequestCount returns the request count

func (Keeper) GetValidatorSet

func (k Keeper) GetValidatorSet(
	ctx context.Context,
	index string,

) (val types.ValidatorSet, found bool)

GetValidatorSet returns a validatorSet from its index

func (Keeper) IncreaseAuthorizedCount

func (k Keeper) IncreaseAuthorizedCount(
	ctx context.Context,
	creator string,
)

func (Keeper) KeyExpiry

func (k Keeper) KeyExpiry(ctx sdk.Context) uint64

KeyExpiry returns the KeyExpiry param

func (Keeper) KeyShare

KeyShare returns a single keyshare submitted by a particular validator for a particular block height

func (Keeper) KeyShareAll

KeyShareAll returns the list of all keyshares submitted

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) MaxIdledBlock

func (k Keeper) MaxIdledBlock(ctx sdk.Context) (res uint64)

MaxIdledBlock returns the MaxIdledBlock param

func (Keeper) MinimumBonded

func (k Keeper) MinimumBonded(ctx sdk.Context) (res uint64)

MinimumBonded returns the MinimumBonded param

func (Keeper) OnAcknowledgementAggrKeyshareDataPacket

func (k Keeper) OnAcknowledgementAggrKeyshareDataPacket(ctx sdk.Context, packet channeltypes.Packet, data types.AggrKeyshareDataPacketData, ack channeltypes.Acknowledgement) error

OnAcknowledgementAggrKeyshareDataPacket responds to the the success or failure of a packet acknowledgement written on the receiving chain.

func (Keeper) OnAcknowledgementEncryptedKeyshareDataPacket added in v0.9.0

func (k Keeper) OnAcknowledgementEncryptedKeyshareDataPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data types.EncryptedKeysharesPacketData,
	ack channeltypes.Acknowledgement,
) error

OnAcknowledgementEncryptedKeyshareDataPacket responds to the the success or failure of a packet acknowledgement written on the receiving chain.

func (Keeper) OnRecvCurrentKeysPacket added in v0.6.0

func (k Keeper) OnRecvCurrentKeysPacket(ctx sdk.Context, packet channeltypes.Packet, data types.CurrentKeysPacketData) (packetAck types.CurrentKeysPacketAck, err error)

OnRecvCurrentKeysPacket processes packet reception

func (Keeper) OnRecvGetAggrKeysharePacket

func (k Keeper) OnRecvGetAggrKeysharePacket(ctx sdk.Context, packet channeltypes.Packet, data types.GetAggrKeysharePacketData) (packetAck types.GetAggrKeysharePacketAck, err error)

OnRecvGetAggrKeysharePacket processes packet reception

func (Keeper) OnRecvGetPrivateKeysharePacket added in v0.9.0

func (k Keeper) OnRecvGetPrivateKeysharePacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data types.GetPrivateKeysharePacketData,
) (packetAck types.GetPrivateKeysharePacketAck, err error)

OnRecvGetPrivateKeysharePacket processes packet reception

func (Keeper) OnRecvRequestAggrKeysharePacket

func (k Keeper) OnRecvRequestAggrKeysharePacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data types.RequestAggrKeysharePacketData,
) (packetAck types.RequestAggrKeysharePacketAck, err error)

OnRecvRequestAggrKeysharePacket processes packet reception

func (Keeper) OnRecvRequestPrivateKeysharePacket added in v0.9.0

func (k Keeper) OnRecvRequestPrivateKeysharePacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data types.RequestPrivateKeysharePacketData,
) (packetAck types.RequestPrivateKeysharePacketAck, err error)

OnRecvRequestPrivateKeysharePacket processes packet reception

func (Keeper) OnTimeoutAggrKeyshareDataPacket

func (k Keeper) OnTimeoutAggrKeyshareDataPacket(ctx sdk.Context, packet channeltypes.Packet, data types.AggrKeyshareDataPacketData) error

OnTimeoutAggrKeyshareDataPacket responds to the case where a packet has not been transmitted because of a timeout

func (Keeper) OnTimeoutEncryptedKeyshareDataPacket added in v0.9.0

func (k Keeper) OnTimeoutEncryptedKeyshareDataPacket(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data types.EncryptedKeysharesPacketData,
) error

OnTimeoutEncryptedKeyshareDataPacket responds to the case where a packet has not been transmitted because of a timeout

func (Keeper) OnTimeoutGetAggrKeysharePacket

func (k Keeper) OnTimeoutGetAggrKeysharePacket(ctx sdk.Context, packet channeltypes.Packet, data types.GetAggrKeysharePacketData) error

OnTimeoutGetAggrKeysharePacket responds to the case where a packet has not been transmitted because of a timeout

func (Keeper) OnTimeoutGetPrivateKeysharePacket added in v0.9.0

func (k Keeper) OnTimeoutGetPrivateKeysharePacket(ctx sdk.Context, packet channeltypes.Packet, data types.GetPrivateKeysharePacketData) error

OnTimeoutGetPrivateKeysharePacket responds to the case where a packet has not been transmitted because of a timeout

func (Keeper) OnTimeoutRequestAggrKeysharePacket

func (k Keeper) OnTimeoutRequestAggrKeysharePacket(ctx sdk.Context, packet channeltypes.Packet, data types.RequestAggrKeysharePacketData) error

OnTimeoutRequestAggrKeysharePacket responds to the case where a packet has not been transmitted because of a timeout

func (Keeper) OnTimeoutRequestPrivateKeysharePacket added in v0.9.0

func (k Keeper) OnTimeoutRequestPrivateKeysharePacket(ctx sdk.Context, packet channeltypes.Packet, data types.RequestPrivateKeysharePacketData) error

OnTimeoutRequestAggrKeysharePacket responds to the case where a packet has not been transmitted because of a timeout

func (Keeper) Params

func (Keeper) ProcessGovRequestQueue added in v0.6.0

func (k Keeper) ProcessGovRequestQueue(ctx sdk.Context) error

func (Keeper) ProcessGovSignalQueue added in v0.6.0

func (k Keeper) ProcessGovSignalQueue(ctx sdk.Context) error

func (Keeper) ProcessPepRequestQueue added in v0.6.0

func (k Keeper) ProcessPepRequestQueue(ctx sdk.Context) error

func (Keeper) ProcessPepSignalQueue added in v0.6.0

func (k Keeper) ProcessPepSignalQueue(ctx sdk.Context) error

func (Keeper) ProcessPrivateRequestQueue added in v0.9.0

func (k Keeper) ProcessPrivateRequestQueue(ctx sdk.Context) error

func (Keeper) ProcessPrivateSignalQueue added in v0.9.0

func (k Keeper) ProcessPrivateSignalQueue(ctx sdk.Context) error

func (Keeper) PubKey

PubKey returns the lates public keys

func (Keeper) RemoveAggregatedKeyShare

func (k Keeper) RemoveAggregatedKeyShare(
	ctx sdk.Context,
	height uint64,

)

RemoveAggregatedKeyShare removes a aggregatedKeyShare from the store

func (Keeper) RemoveAuthorizedAddress

func (k Keeper) RemoveAuthorizedAddress(
	ctx context.Context,
	target string,

)

RemoveAuthorizedAddress removes a authorizedAddress from the store

func (Keeper) RemoveGeneralKeyShare

func (k Keeper) RemoveGeneralKeyShare(
	ctx context.Context,
	validator string,
	idType string,
	idValue string,

)

RemoveGeneralKeyShare removes a generalKeyShare from the store

func (Keeper) RemoveKeyShare

func (k Keeper) RemoveKeyShare(
	ctx context.Context,
	validator string,
	blockHeight uint64,

)

RemoveKeyShare removes a keyShare from the store

func (Keeper) RemoveKeyShareRequest

func (k Keeper) RemoveKeyShareRequest(
	ctx context.Context,
	identity string,

)

RemoveKeyShareRequest removes a keyShare request from the store

func (Keeper) RemovePrivateKeyShare added in v0.9.0

func (k Keeper) RemovePrivateKeyShare(
	ctx context.Context,
	validator string,
	identiy string,
	requester string,
)

RemovePrivateKeyShare removes an private KeyShare from the store

func (Keeper) RemovePrivateKeyShareRequest added in v0.9.0

func (k Keeper) RemovePrivateKeyShareRequest(
	ctx context.Context,
	identity string,
)

RemovePrivateKeyShareRequest removes a private keyShare request from the store

func (Keeper) RemoveValidatorSet

func (k Keeper) RemoveValidatorSet(
	ctx context.Context,
	index string,

)

RemoveValidatorSet removes a validatorSet from the store

func (*Keeper) ScopedKeeper added in v0.7.0

func (k *Keeper) ScopedKeeper() exported.ScopedKeeper

ScopedKeeper returns the ScopedKeeper

func (Keeper) SetActiveCommitments

func (k Keeper) SetActiveCommitments(ctx context.Context, commits types.Commitments)

SetActiveCommitments set a specific public key to active in the store

func (Keeper) SetActivePubKey

func (k Keeper) SetActivePubKey(ctx context.Context, activePubKey types.ActivePubKey)

SetActivePubKey set a specific public key to active in the store

func (Keeper) SetAggregatedKeyShare

func (k Keeper) SetAggregatedKeyShare(ctx sdk.Context, aggregatedKeyShare types.AggregatedKeyShare)

SetAggregatedKeyShare set a specific aggregatedKeyShare in the store from its index

func (Keeper) SetAggregatedKeyShareLength

func (k Keeper) SetAggregatedKeyShareLength(ctx sdk.Context, length uint64)

SetAggregatedKeyShareLength set a specific length to aggregatedKeyShareLength

func (Keeper) SetAuthorizedAddress

func (k Keeper) SetAuthorizedAddress(ctx context.Context, authorizedAddress types.AuthorizedAddress)

SetAuthorizedAddress set a specific authorizedAddress in the store from its index

func (Keeper) SetGeneralKeyShare

func (k Keeper) SetGeneralKeyShare(ctx context.Context, generalKeyShare types.GeneralKeyShare)

SetGeneralKeyShare set a specific generalKeyShare in the store from its index

func (Keeper) SetKeyShare

func (k Keeper) SetKeyShare(ctx context.Context, keyShare types.KeyShare)

SetKeyShare set a specific keyShare in the store from its index

func (Keeper) SetKeyShareRequest

func (k Keeper) SetKeyShareRequest(ctx context.Context, KeyShareRequest types.KeyShareRequest)

SetKeyShareRequest set a specific keyShare request in the store by its index

func (Keeper) SetLastSubmittedHeight

func (k Keeper) SetLastSubmittedHeight(ctx context.Context, validator, height string)

func (Keeper) SetParams

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

SetParams set the params

func (*Keeper) SetPort added in v0.7.0

func (k *Keeper) SetPort(ctx sdk.Context, portID string)

SetPort sets the portID for the IBC app module. Used in InitGenesis

func (Keeper) SetPrivateKeyShare added in v0.9.0

func (k Keeper) SetPrivateKeyShare(ctx context.Context, encKeyShare types.ValidatorEncryptedKeyShare)

SetPrivateKeyShare set a specific private KeyShare in the store from its index

func (Keeper) SetPrivateKeyShareRequest added in v0.9.0

func (k Keeper) SetPrivateKeyShareRequest(ctx context.Context, KeyShareRequest types.PrivateKeyshareRequest)

SetPrivateKeyShareRequest set a specific private keyShare request in the store by its index

func (Keeper) SetQueuedCommitments

func (k Keeper) SetQueuedCommitments(ctx context.Context, commits types.Commitments)

SetQueuedCommitments set a specific public key in the store

func (Keeper) SetQueuedPubKey

func (k Keeper) SetQueuedPubKey(ctx context.Context, queuedPubKey types.QueuedPubKey)

SetQueuedPubKey set a specific public key in the store

func (Keeper) SetRequestCount

func (k Keeper) SetRequestCount(ctx sdk.Context, requestNumber uint64)

SetRequestCount sets RequestCount

func (Keeper) SetValidatorSet

func (k Keeper) SetValidatorSet(ctx context.Context, validatorSet types.ValidatorSet)

SetValidatorSet set a specific validatorSet in the store from its index

func (*Keeper) ShouldBound added in v0.7.0

func (k *Keeper) ShouldBound(ctx sdk.Context, portID string) bool

ShouldBound checks if the IBC app module can be bound to the desired port

func (Keeper) SlashFractionNoKeyshare

func (k Keeper) SlashFractionNoKeyshare(ctx sdk.Context) (res math.LegacyDec)

SlashFractionNoKeyshare returns the SlashFractionNoKeyshare param

func (Keeper) SlashFractionWrongKeyshare

func (k Keeper) SlashFractionWrongKeyshare(ctx sdk.Context) (res math.LegacyDec)

SlashFractionWrongKeyshare returns the SlashFractionWrongKeyshare param

func (Keeper) SlashingKeeper added in v0.7.0

func (k Keeper) SlashingKeeper() types.SlashingKeeper

func (Keeper) TransmitAggrKeyshareDataPacket

func (k Keeper) TransmitAggrKeyshareDataPacket(
	ctx sdk.Context,
	packetData types.AggrKeyshareDataPacketData,
	sourcePort,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
) (uint64, error)

TransmitAggrKeyshareDataPacket transmits the packet over IBC with the specified source port and source channel

func (Keeper) TransmitEncryptedKeyshareDataPacket added in v0.9.0

func (k Keeper) TransmitEncryptedKeyshareDataPacket(
	ctx sdk.Context,
	packetData types.EncryptedKeysharesPacketData,
	sourcePort,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
) (uint64, error)

TransmitEncryptedKeyshareDataPacket transmits the packet over IBC with the specified source port and source channel

func (Keeper) TransmitRequestAggrKeysharePacket

func (k Keeper) TransmitRequestAggrKeysharePacket(
	ctx sdk.Context,
	packetData types.RequestAggrKeysharePacketData,
	sourcePort,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
) (uint64, error)

TransmitRequestAggrKeysharePacket transmits the packet over IBC with the specified source port and source channel

func (Keeper) TrustedAddresses

func (k Keeper) TrustedAddresses(ctx sdk.Context) (res []string)

TrustedAddresses returns the TrustedAddresses param

func (Keeper) ValidatorSetAll

ValidatorSetAll returns the complete list of registered validators

func (Keeper) VerifiableRandomness added in v0.7.0

type Migrator added in v0.7.1

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v0.7.1

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v0.7.1

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from version 1 to 2.

Jump to

Keyboard shortcuts

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