keeper

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 21 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 MsgServer interface for the provided Keeper.

Types

type HandledHooks

type HandledHooks interface {
	ltypes.BTCLightClientHooks
	etypes.EpochingHooks
}

Helper interface to be sure Hooks implement both epoching and light client hooks

type Hooks

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

func (Hooks) AfterBTCHeaderInserted

func (h Hooks) AfterBTCHeaderInserted(ctx sdk.Context, headerInfo *ltypes.BTCHeaderInfo)

func (Hooks) AfterBTCRollBack

func (h Hooks) AfterBTCRollBack(ctx sdk.Context, headerInfo *ltypes.BTCHeaderInfo)

func (Hooks) AfterBTCRollForward

func (h Hooks) AfterBTCRollForward(ctx sdk.Context, headerInfo *ltypes.BTCHeaderInfo)

func (Hooks) AfterEpochBegins

func (h Hooks) AfterEpochBegins(ctx sdk.Context, epoch uint64)

func (Hooks) AfterEpochEnds

func (h Hooks) AfterEpochEnds(ctx sdk.Context, epoch uint64)

func (Hooks) BeforeSlashThreshold

func (h Hooks) BeforeSlashThreshold(ctx sdk.Context, valSet etypes.ValidatorSet)

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	tstoreKey,
	memKey storetypes.StoreKey,
	bk types.BTCLightClientKeeper,
	ck types.CheckpointingKeeper,
	powLimit *big.Int,
	authority string,
) Keeper

func (Keeper) BtcLightClientUpdated added in v0.6.0

func (k Keeper) BtcLightClientUpdated(ctx sdk.Context) bool

BtcLightClientUpdated checks if btc light client was updated during block execution

func (Keeper) GetBestSubmission

func (k Keeper) GetBestSubmission(ctx sdk.Context, epochNumber uint64) (types.BtcStatus, *types.SubmissionKey, error)

GetBestSubmission gets the status and the best submission of a given finalized epoch

func (Keeper) GetBlockHeight

func (k Keeper) GetBlockHeight(ctx sdk.Context, b *bbn.BTCHeaderHashBytes) (uint64, error)

func (Keeper) GetEpochBestSubmissionBtcInfo added in v0.6.0

func (k Keeper) GetEpochBestSubmissionBtcInfo(ctx sdk.Context, ed *types.EpochData) *types.SubmissionBtcInfo

func (Keeper) GetEpochData

func (k Keeper) GetEpochData(ctx sdk.Context, e uint64) *types.EpochData

GetEpochData returns epoch data for given epoch, if there is not epoch data yet returns nil

func (Keeper) GetExpectedTag

func (k Keeper) GetExpectedTag(ctx sdk.Context) txformat.BabylonTag

GetExpectedTag retrerieves checkpoint tag from params and decodes it from hex string to bytes. NOTE: keeper could probably cache decoded tag, but it is rather improbable this function will ever be a bottleneck so it is not worth it.

func (Keeper) GetParams

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

GetParams returns the current x/btccheckpoint module parameters.

func (Keeper) GetPowLimit

func (k Keeper) GetPowLimit() *big.Int

func (Keeper) GetSubmissionBtcInfo

func (k Keeper) GetSubmissionBtcInfo(ctx sdk.Context, sk types.SubmissionKey) (*types.SubmissionBtcInfo, error)

func (Keeper) GetSubmissionData

func (k Keeper) GetSubmissionData(ctx sdk.Context, sk types.SubmissionKey) *types.SubmissionData

GetSubmissionData returns submission data for a given key or nil if there is no data under the given key

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

func (Keeper) Logger

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

func (Keeper) OnTipChange

func (k Keeper) OnTipChange(ctx sdk.Context)

Callback to be called when btc light client tip changes

func (Keeper) Params

func (Keeper) SetParams

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

SetParams sets the x/btccheckpoint module parameters.

func (Keeper) SubmissionExists

func (k Keeper) SubmissionExists(ctx sdk.Context, sk types.SubmissionKey) bool

Jump to

Keyboard shortcuts

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