keeper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: Apache-2.0 Imports: 14 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.

func NewQuerier

func NewQuerier(keeper Keeper) types.QueryServer

NewQuerier returns an implementation of the oracle QueryServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {
	StakingKeeper types.StakingKeeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, storeKey storetypes.StoreKey,
	paramspace paramstypes.Subspace, accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper, distrKeeper types.DistributionKeeper,
	stakingKeeper types.StakingKeeper, distrName string,
) *Keeper

func (Keeper) ClearBallots

func (k Keeper) ClearBallots(ctx sdk.Context, votePeriod uint64)

ClearBallots clears all tallied prevotes and votes from the store

func (Keeper) DeleteAddressFromWhitelist

func (k Keeper) DeleteAddressFromWhitelist(ctx sdk.Context, address string)

DeleteAddress deletes address form whitelist.

func (Keeper) DeleteAggregateValidatorPrevote

func (k Keeper) DeleteAggregateValidatorPrevote(ctx sdk.Context, voter sdk.ValAddress)

DeleteAggregateValidatorPrevote deletes an oracle prevote from the store

func (Keeper) DeleteAggregateValidatorVote

func (k Keeper) DeleteAggregateValidatorVote(ctx sdk.Context, voter sdk.ValAddress)

DeleteAggregateValdiatorVote deletes an oracle prevote from the store

func (Keeper) DeleteMissCounter

func (k Keeper) DeleteMissCounter(ctx sdk.Context, operator sdk.ValAddress)

DeleteMissCounter removes miss counter for the validator

func (Keeper) GetAddressWhitelist

func (k Keeper) GetAddressWhitelist(ctx sdk.Context, address string) (bool, error)

GetLunaExchangeRate gets the consensus exchange rate of Luna denominated in the denom asset from the store.

func (Keeper) GetAggregateValidatorPrevote

func (k Keeper) GetAggregateValidatorPrevote(ctx sdk.Context, voter sdk.ValAddress) (aggregatePrevote types.AggregateValidatorPrevote, err error)

GetAggregateValidatorPrevote retrieves an oraclevaldiator prevote from the store

func (Keeper) GetAggregateValidatorVote

func (k Keeper) GetAggregateValidatorVote(ctx sdk.Context, voter sdk.ValAddress) (aggregateVote types.AggregateValidatorVote, err error)

GetAggregateValidatorVote retrieves an validatororacle prevote from the store

func (Keeper) GetFeederDelegation

func (k Keeper) GetFeederDelegation(ctx sdk.Context, operator sdk.ValAddress) sdk.AccAddress

GetFeederDelegation gets the account address that the validator operator delegated oracle vote rights to

func (Keeper) GetMissCounter

func (k Keeper) GetMissCounter(ctx sdk.Context, operator sdk.ValAddress) sdk.Dec

GetMissCounter retrieves the # of vote periods missed in this oracle slash window

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) IterateAddressWhitelist

func (k Keeper) IterateAddressWhitelist(ctx sdk.Context) (validators []string)

IterateAddress iterates over validator address in the whitelist

func (Keeper) IterateAggregateValidatorPrevotes

func (k Keeper) IterateAggregateValidatorPrevotes(ctx sdk.Context, handler func(voterAddr sdk.ValAddress, aggregatePrevote types.AggregateValidatorPrevote) (stop bool))

IterateAggregateValidatorPrevotes iterates rate over prevotes in the store

func (Keeper) IterateAggregateValidatorVotes

func (k Keeper) IterateAggregateValidatorVotes(ctx sdk.Context, handler func(voterAddr sdk.ValAddress, aggregateVote types.AggregateValidatorVote) (stop bool))

IterateAggregateValidatorVotes iterates rate over prevotes in the store

func (Keeper) IterateFeederDelegations

func (k Keeper) IterateFeederDelegations(ctx sdk.Context,
	handler func(delegator sdk.ValAddress, delegate sdk.AccAddress) (stop bool))

IterateFeederDelegations iterates over the feed delegates and performs a callback function.

func (Keeper) IterateMissCounters

func (k Keeper) IterateMissCounters(ctx sdk.Context,
	handler func(operator sdk.ValAddress, missCounter sdk.Dec) (stop bool))

IterateMissCounters iterates over the miss counters and performs a callback function.

func (Keeper) Logger

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

func (Keeper) MinValidPerWindow

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

MinValidPerWindow returns oracle slashing threshold

func (Keeper) OrganizeBallotByAddress

func (k Keeper) OrganizeBallotByAddress(ctx sdk.Context, validatorClaimMap map[string]types.Claim) (votes map[string][]string, countVotes map[string]int)

OrganizeBallotByDenom collects all oracle votes for the period, categorized by the votes' denom parameter

func (Keeper) Params

func (Keeper) SetAddressWhitelist

func (k Keeper) SetAddressWhitelist(ctx sdk.Context, address string)

SetLunaExchangeRate sets the consensus exchange rate of Luna denominated in the denom asset to the store.

func (Keeper) SetAddressWhitelistWithEvent

func (k Keeper) SetAddressWhitelistWithEvent(ctx sdk.Context, address string)

SetLunaExchangeRateWithEvent sets the consensus exchange rate of Luna denominated in the denom asset to the store with ABCI event

func (Keeper) SetAggregateValidatorPrevote

func (k Keeper) SetAggregateValidatorPrevote(ctx sdk.Context, voter sdk.ValAddress, prevote types.AggregateValidatorPrevote)

SetAggregateValidatorPrevote set an oracle validator aggregate prevote to the store

func (Keeper) SetAggregateValidatorVote

func (k Keeper) SetAggregateValidatorVote(ctx sdk.Context, voter sdk.ValAddress, vote types.AggregateValidatorVote)

SetAggregateValidatorVote adds an oracle aggregate prevote to the store

func (Keeper) SetFeederDelegation

func (k Keeper) SetFeederDelegation(ctx sdk.Context, operator sdk.ValAddress, delegatedFeeder sdk.AccAddress)

SetFeederDelegation sets the account address that the validator operator delegated oracle vote rights to

func (Keeper) SetMissCounter

func (k Keeper) SetMissCounter(ctx sdk.Context, operator sdk.ValAddress, missCounter sdk.Dec)

SetMissCounter updates the # of vote periods missed in this oracle slash window

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SlashAndResetMissCounters

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

func (Keeper) SlashFraction

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

SlashFraction returns oracle voting penalty rate

func (Keeper) SlashWindow

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

SlashWindow returns # of vote period for oracle slashing

func (Keeper) ValidateFeeder

func (k Keeper) ValidateFeeder(ctx sdk.Context, feederAddr sdk.AccAddress, validatorAddr sdk.ValAddress) error

ValidateFeeder return the given feeder is allowed to feed the message or not

func (Keeper) VotePeriod

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

VotePeriod returns the number of blocks during which voting takes place.

func (Keeper) VoteThreshold

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

VoteThreshold returns the minimum percentage of votes that must be received for a ballot to pass.

Jump to

Keyboard shortcuts

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