keeper

package
v0.2.1-prealpha Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrConsensusQueueNotImplemented   = whoops.Errorf("consensus queue not implemented for queueTypeName %s")
	ErrUnableToFindPubKeyForValidator = whoops.Errorf("unable to find public key for validator: %s")
	ErrSignatureVerificationFailed    = whoops.Errorf("signature verification failed (msgId: %d, valAddr: %s, pubKey: %s)")
	ErrInvalidLimitValue              = whoops.Errorf("invalid N value: %d")
)

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Attestator

type Attestator struct {
	ConsensusKeeper *Keeper
	// contains filtered or unexported fields
}

func NewAttestator

func NewAttestator() *Attestator

func (*Attestator) RegisterAttestator

func (a *Attestator) RegisterAttestator(att types.Attestator)

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps paramtypes.Subspace,
	valsetKeeper types.ValsetKeeper,
	attestator *Attestator,
) *Keeper

func (Keeper) AddConcencusQueueType

func (k Keeper) AddConcencusQueueType(batch bool, opts ...consensus.OptFnc)

func (Keeper) AddMessageSignature

func (k Keeper) AddMessageSignature(
	ctx sdk.Context,
	valAddr sdk.ValAddress,
	msgs []*types.MsgAddMessagesSignatures_MsgSignedMessage,
) error

AddMessageSignature adds signatures to the messages.

func (Keeper) CheckAndProcessAttestedMessages

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

CheckAndProcessAttestedMessages is supposed to be used within the EndBlocker. It will get messages for the attestators that have reached a consensus and process them.

func (Keeper) GetMessagesForSigning

func (k Keeper) GetMessagesForSigning(ctx sdk.Context, queueTypeName string, val sdk.ValAddress) (msgs []types.QueuedSignedMessageI, err error)

GetMessagesForSigning returns messages for a single validator that needs to be signed.

func (Keeper) GetMessagesFromQueue

func (k Keeper) GetMessagesFromQueue(ctx sdk.Context, queueTypeName string, n int) (msgs []types.QueuedSignedMessageI, err error)

GetMessagesFromQueue gets N messages from the queue.

func (Keeper) GetMessagesThatHaveReachedConsensus

func (k Keeper) GetMessagesThatHaveReachedConsensus(ctx sdk.Context, queueTypeName string) ([]types.QueuedSignedMessageI, error)

GetMessagesThatHaveReachedConsensus returns messages from a given queueTypeName that have reached consensus based on the latest snapshot available.

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) PutMessageForSigning

func (k Keeper) PutMessageForSigning(ctx sdk.Context, queueTypeName string, msg consensus.ConsensusMsg) error

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) Store

func (k Keeper) Store(ctx sdk.Context) sdk.KVStore

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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