keeper

package
v2.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BailStakeDiv = 5 // 20% - Can't be 0!
	MajorityDiv  = 2 // 50% - Can't be 0!
)

Variables

View Source
var SlashStakePercent = sdk.NewDecWithPrec(5, 2) // 0.05

Functions

func DetectionIndex

func DetectionIndex(creatorAddr string, conflict *types.ResponseConflict, epochStart uint64) string

func FindVote

func FindVote(votes *[]types.Vote, address string) (int, bool)

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,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,

	bankKeeper types.BankKeeper,
	accountKeeper types.AccountKeeper,
	pairingKeeper types.PairingKeeper,
	epochstorageKeeper types.EpochstorageKeeper,
	specKeeper types.SpecKeeper,
	stakingKeeper types.StakingKeeper,
) *Keeper

func (Keeper) AllocateNewConflictVote

func (k Keeper) AllocateNewConflictVote(ctx sdk.Context, key string) bool

func (Keeper) BeginBlock

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

func (Keeper) CheckAndHandleAllVotes

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

func (Keeper) CleanUpVote

func (k Keeper) CleanUpVote(ctx sdk.Context, index string)

func (Keeper) GetAllConflictVote

func (k Keeper) GetAllConflictVote(ctx sdk.Context) (list []types.ConflictVote)

GetAllConflictVote returns all conflictVote

func (Keeper) GetConflictVote

func (k Keeper) GetConflictVote(
	ctx sdk.Context,
	index string,
) (val types.ConflictVote, found bool)

GetConflictVote returns a conflictVote from its index

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) HandleAndCloseVote

func (k Keeper) HandleAndCloseVote(ctx sdk.Context, conflictVote types.ConflictVote)

func (Keeper) IsEpochStart

func (k Keeper) IsEpochStart(ctx sdk.Context) (res bool)

we dont want to do the calculation here too, epochStorage keeper did it

func (Keeper) Logger

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

func (Keeper) LotteryVoters

func (k Keeper) LotteryVoters(goCtx context.Context, epoch uint64, chainID string, exemptions []string) []string

func (Keeper) MajorityPercent

func (k Keeper) MajorityPercent(ctx sdk.Context) (res sdk.Dec)

MajorityPercent returns the MajorityPercent param

func (Keeper) Params

func (Keeper) PushFixations

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

func (Keeper) RemoveConflictVote

func (k Keeper) RemoveConflictVote(
	ctx sdk.Context,
	index string,
)

RemoveConflictVote removes a conflictVote from the store

func (Keeper) Rewards

func (k Keeper) Rewards(ctx sdk.Context) (res types.Rewards)

func (Keeper) SetConflictVote

func (k Keeper) SetConflictVote(ctx sdk.Context, conflictVote types.ConflictVote)

SetConflictVote set a specific conflictVote in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) TransitionVoteToReveal

func (k Keeper) TransitionVoteToReveal(ctx sdk.Context, conflictVote types.ConflictVote)

func (Keeper) ValidateFinalizationConflict

func (k Keeper) ValidateFinalizationConflict(ctx sdk.Context, conflictData *types.FinalizationConflict, clientAddr sdk.AccAddress) error

func (Keeper) ValidateResponseConflict

func (k Keeper) ValidateResponseConflict(ctx sdk.Context, conflictData *types.ResponseConflict, clientAddr sdk.AccAddress) error

func (Keeper) ValidateSameProviderConflict

func (k Keeper) ValidateSameProviderConflict(ctx sdk.Context, conflictData *types.FinalizationConflict, clientAddr sdk.AccAddress) (providerAddr sdk.AccAddress, mismatchingBlockHeight int64, mismatchingBlockHashes map[string]string, err error)

func (Keeper) VotePeriod

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

func (Keeper) VoteStartSpan

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

type Migrator

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

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

func (Migrator) MigrateToV5

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

Jump to

Keyboard shortcuts

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