Documentation ¶
Overview ¶
nolint:deadcode unused noalias
Index ¶
- Variables
- func NewQuerier(keeper Keeper) sdk.Querier
- func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
- type Keeper
- func (k Keeper) AddAggregateExchangeRatePrevote(ctx sdk.Context, aggregatePrevote types.AggregateExchangeRatePrevote)
- func (k Keeper) AddAggregateExchangeRateVote(ctx sdk.Context, aggregateVote types.AggregateExchangeRateVote)
- func (k Keeper) AddExchangeRatePrevote(ctx sdk.Context, prevote types.ExchangeRatePrevote)
- func (k Keeper) AddExchangeRateVote(ctx sdk.Context, vote types.ExchangeRateVote)
- func (k Keeper) ClearTobinTaxes(ctx sdk.Context)
- func (k Keeper) DeleteAggregateExchangeRatePrevote(ctx sdk.Context, aggregatePrevote types.AggregateExchangeRatePrevote)
- func (k Keeper) DeleteAggregateExchangeRateVote(ctx sdk.Context, aggregateVote types.AggregateExchangeRateVote)
- func (k Keeper) DeleteExchangeRatePrevote(ctx sdk.Context, prevote types.ExchangeRatePrevote)
- func (k Keeper) DeleteExchangeRateVote(ctx sdk.Context, vote types.ExchangeRateVote)
- func (k Keeper) DeleteLunaExchangeRate(ctx sdk.Context, denom string)
- func (k Keeper) DeleteMissCounter(ctx sdk.Context, operator sdk.ValAddress)
- func (k Keeper) GetAggregateExchangeRatePrevote(ctx sdk.Context, voter sdk.ValAddress) (aggregatePrevote types.AggregateExchangeRatePrevote, err error)
- func (k Keeper) GetAggregateExchangeRateVote(ctx sdk.Context, voter sdk.ValAddress) (aggregateVote types.AggregateExchangeRateVote, err error)
- func (k Keeper) GetExchangeRatePrevote(ctx sdk.Context, denom string, voter sdk.ValAddress) (prevote types.ExchangeRatePrevote, err error)
- func (k Keeper) GetLunaExchangeRate(ctx sdk.Context, denom string) (exchangeRate sdk.Dec, err error)
- func (k Keeper) GetMissCounter(ctx sdk.Context, operator sdk.ValAddress) (missCounter int64)
- func (k Keeper) GetOracleAccount(ctx sdk.Context) supplyexported.ModuleAccountI
- func (k Keeper) GetOracleDelegate(ctx sdk.Context, operator sdk.ValAddress) (delegate sdk.AccAddress)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRewardPool(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetTobinTax(ctx sdk.Context, denom string) (tobinTax sdk.Dec, err error)
- func (k Keeper) GetVoteTargets(ctx sdk.Context) (voteTargets []string)
- func (k Keeper) IsVoteTarget(ctx sdk.Context, denom string) bool
- func (k Keeper) IterateAggregateExchangeRatePrevotes(ctx sdk.Context, ...)
- func (k Keeper) IterateAggregateExchangeRateVotes(ctx sdk.Context, ...)
- func (k Keeper) IterateExchangeRatePrevotes(ctx sdk.Context, handler func(prevote types.ExchangeRatePrevote) (stop bool))
- func (k Keeper) IterateExchangeRateVotes(ctx sdk.Context, handler func(vote types.ExchangeRateVote) (stop bool))
- func (k Keeper) IterateLunaExchangeRates(ctx sdk.Context, handler func(denom string, exchangeRate sdk.Dec) (stop bool))
- func (k Keeper) IterateMissCounters(ctx sdk.Context, ...)
- func (k Keeper) IterateOracleDelegates(ctx sdk.Context, ...)
- func (k Keeper) IterateTobinTaxes(ctx sdk.Context, handler func(denom string, tobinTax sdk.Dec) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MinValidPerWindow(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) OrganizeBallotByDenom(ctx sdk.Context) (votes map[string]types.ExchangeRateBallot)
- func (k Keeper) RewardBallotWinners(ctx sdk.Context, ballotWinners map[string]types.Claim)
- func (k Keeper) RewardBand(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) RewardDistributionWindow(ctx sdk.Context) (res int64)
- func (k Keeper) SetLunaExchangeRate(ctx sdk.Context, denom string, exchangeRate sdk.Dec)
- func (k Keeper) SetLunaExchangeRateWithEvent(ctx sdk.Context, denom string, exchangeRate sdk.Dec)
- func (k Keeper) SetMissCounter(ctx sdk.Context, operator sdk.ValAddress, missCounter int64)
- func (k Keeper) SetOracleDelegate(ctx sdk.Context, operator sdk.ValAddress, delegatedFeeder sdk.AccAddress)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTobinTax(ctx sdk.Context, denom string, tobinTax sdk.Dec)
- func (k Keeper) SlashFraction(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SlashWindow(ctx sdk.Context) (res int64)
- func (k Keeper) VotePeriod(ctx sdk.Context) (res int64)
- func (k Keeper) VoteThreshold(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) Whitelist(ctx sdk.Context) (res types.DenomList)
- type TestInput
Constants ¶
This section is empty.
Variables ¶
var ( PubKeys = []crypto.PubKey{ secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), } Addrs = []sdk.AccAddress{ sdk.AccAddress(PubKeys[0].Address()), sdk.AccAddress(PubKeys[1].Address()), sdk.AccAddress(PubKeys[2].Address()), sdk.AccAddress(PubKeys[3].Address()), sdk.AccAddress(PubKeys[4].Address()), } ValAddrs = []sdk.ValAddress{ sdk.ValAddress(PubKeys[0].Address()), sdk.ValAddress(PubKeys[1].Address()), sdk.ValAddress(PubKeys[2].Address()), sdk.ValAddress(PubKeys[3].Address()), sdk.ValAddress(PubKeys[4].Address()), } InitTokens = sdk.TokensFromConsensusPower(200) InitCoins = sdk.NewCoins(sdk.NewCoin(core.MicroLunaDenom, InitTokens)) OracleDecPrecision = 8 )
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
func NewTestMsgCreateValidator ¶
func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
Types ¶
type Keeper ¶
type Keeper struct { StakingKeeper types.StakingKeeper // contains filtered or unexported fields }
Keeper of the oracle store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramspace params.Subspace, distrKeeper types.DistributionKeeper, stakingKeeper types.StakingKeeper, supplyKeeper types.SupplyKeeper, distrName string) Keeper
NewKeeper constructs a new keeper for oracle
func (Keeper) AddAggregateExchangeRatePrevote ¶ added in v0.4.0
func (k Keeper) AddAggregateExchangeRatePrevote(ctx sdk.Context, aggregatePrevote types.AggregateExchangeRatePrevote)
AddAggregateExchangeRatePrevote adds an oracle aggregate prevote to the store
func (Keeper) AddAggregateExchangeRateVote ¶ added in v0.4.0
func (k Keeper) AddAggregateExchangeRateVote(ctx sdk.Context, aggregateVote types.AggregateExchangeRateVote)
AddAggregateExchangeRateVote adds an oracle aggregate prevote to the store
func (Keeper) AddExchangeRatePrevote ¶
func (k Keeper) AddExchangeRatePrevote(ctx sdk.Context, prevote types.ExchangeRatePrevote)
AddExchangeRatePrevote adds an oracle prevote to the store
func (Keeper) AddExchangeRateVote ¶
func (k Keeper) AddExchangeRateVote(ctx sdk.Context, vote types.ExchangeRateVote)
AddExchangeRateVote adds an oracle vote to the store
func (Keeper) ClearTobinTaxes ¶ added in v0.4.0
ClearTobinTaxes clears tobin taxes
func (Keeper) DeleteAggregateExchangeRatePrevote ¶ added in v0.4.0
func (k Keeper) DeleteAggregateExchangeRatePrevote(ctx sdk.Context, aggregatePrevote types.AggregateExchangeRatePrevote)
DeleteAggregateExchangeRatePrevote deletes an oracle prevote from the store
func (Keeper) DeleteAggregateExchangeRateVote ¶ added in v0.4.0
func (k Keeper) DeleteAggregateExchangeRateVote(ctx sdk.Context, aggregateVote types.AggregateExchangeRateVote)
DeleteAggregateExchangeRateVote deletes an oracle prevote from the store
func (Keeper) DeleteExchangeRatePrevote ¶
func (k Keeper) DeleteExchangeRatePrevote(ctx sdk.Context, prevote types.ExchangeRatePrevote)
DeleteExchangeRatePrevote deletes an oracle prevote from the store
func (Keeper) DeleteExchangeRateVote ¶
func (k Keeper) DeleteExchangeRateVote(ctx sdk.Context, vote types.ExchangeRateVote)
DeleteExchangeRateVote deletes an oracle vote from the store
func (Keeper) DeleteLunaExchangeRate ¶
DeleteLunaExchangeRate deletes the consensus exchange rate of Luna denominated in the denom asset from the store.
func (Keeper) DeleteMissCounter ¶ added in v0.3.5
func (k Keeper) DeleteMissCounter(ctx sdk.Context, operator sdk.ValAddress)
DeleteMissCounter removes miss counter for the validator
func (Keeper) GetAggregateExchangeRatePrevote ¶ added in v0.4.0
func (k Keeper) GetAggregateExchangeRatePrevote(ctx sdk.Context, voter sdk.ValAddress) (aggregatePrevote types.AggregateExchangeRatePrevote, err error)
GetAggregateExchangeRatePrevote retrieves an oracle prevote from the store
func (Keeper) GetAggregateExchangeRateVote ¶ added in v0.4.0
func (k Keeper) GetAggregateExchangeRateVote(ctx sdk.Context, voter sdk.ValAddress) (aggregateVote types.AggregateExchangeRateVote, err error)
GetAggregateExchangeRateVote retrieves an oracle prevote from the store
func (Keeper) GetExchangeRatePrevote ¶
func (k Keeper) GetExchangeRatePrevote(ctx sdk.Context, denom string, voter sdk.ValAddress) (prevote types.ExchangeRatePrevote, err error)
GetExchangeRatePrevote retrieves an oracle prevote from the store
func (Keeper) GetLunaExchangeRate ¶
func (k Keeper) GetLunaExchangeRate(ctx sdk.Context, denom string) (exchangeRate sdk.Dec, err error)
GetLunaExchangeRate gets the consensus exchange rate of Luna denominated in the denom asset from the store.
func (Keeper) GetMissCounter ¶
GetMissCounter retrieves the # of vote periods missed in this oracle slash window
func (Keeper) GetOracleAccount ¶ added in v0.4.0
func (k Keeper) GetOracleAccount(ctx sdk.Context) supplyexported.ModuleAccountI
GetOracleAccount returns oracle ModuleAccount
func (Keeper) GetOracleDelegate ¶
func (k Keeper) GetOracleDelegate(ctx sdk.Context, operator sdk.ValAddress) (delegate sdk.AccAddress)
GetOracleDelegate gets the account address that the validator operator delegated oracle vote rights to
func (Keeper) GetRewardPool ¶
GetRewardPool retrieves the balance of the oracle module account
func (Keeper) GetTobinTax ¶ added in v0.4.0
GetTobinTax return tobin tax for the denom
func (Keeper) GetVoteTargets ¶ added in v0.4.0
GetVoteTargets returns the voting target list on current vote period
func (Keeper) IsVoteTarget ¶ added in v0.4.0
IsVoteTarget returns existence of a denom in the the voting target list
func (Keeper) IterateAggregateExchangeRatePrevotes ¶ added in v0.4.0
func (k Keeper) IterateAggregateExchangeRatePrevotes(ctx sdk.Context, handler func(aggregatePrevote types.AggregateExchangeRatePrevote) (stop bool))
IterateAggregateExchangeRatePrevotes iterates rate over prevotes in the store
func (Keeper) IterateAggregateExchangeRateVotes ¶ added in v0.4.0
func (k Keeper) IterateAggregateExchangeRateVotes(ctx sdk.Context, handler func(aggregateVote types.AggregateExchangeRateVote) (stop bool))
IterateAggregateExchangeRateVotes iterates rate over prevotes in the store
func (Keeper) IterateExchangeRatePrevotes ¶
func (k Keeper) IterateExchangeRatePrevotes(ctx sdk.Context, handler func(prevote types.ExchangeRatePrevote) (stop bool))
IterateExchangeRatePrevotes iterates rate over prevotes in the store
func (Keeper) IterateExchangeRateVotes ¶
func (k Keeper) IterateExchangeRateVotes(ctx sdk.Context, handler func(vote types.ExchangeRateVote) (stop bool))
IterateExchangeRateVotes iterates over votes in the store
func (Keeper) IterateLunaExchangeRates ¶
func (k Keeper) IterateLunaExchangeRates(ctx sdk.Context, handler func(denom string, exchangeRate sdk.Dec) (stop bool))
IterateLunaExchangeRates iterates over luna rates in the store
func (Keeper) IterateMissCounters ¶
func (k Keeper) IterateMissCounters(ctx sdk.Context, handler func(operator sdk.ValAddress, missCounter int64) (stop bool))
IterateMissCounters iterates over the miss counters and performs a callback function.
func (Keeper) IterateOracleDelegates ¶
func (k Keeper) IterateOracleDelegates(ctx sdk.Context, handler func(delegator sdk.ValAddress, delegate sdk.AccAddress) (stop bool))
IterateOracleDelegates iterates over the feed delegates and performs a callback function.
func (Keeper) IterateTobinTaxes ¶ added in v0.4.0
func (k Keeper) IterateTobinTaxes(ctx sdk.Context, handler func(denom string, tobinTax sdk.Dec) (stop bool))
IterateTobinTaxes iterates rate over tobin taxes in the store
func (Keeper) MinValidPerWindow ¶
MinValidPerWindow returns oracle slashing threshold
func (Keeper) OrganizeBallotByDenom ¶
OrganizeBallotByDenom collects all oracle votes for the period, categorized by the votes' denom parameter
func (Keeper) RewardBallotWinners ¶
RewardBallotWinners implements at the end of every VotePeriod, we give out portion of seigniorage reward(reward-weight) to the oracle voters that voted faithfully.
func (Keeper) RewardBand ¶
RewardBand returns the ratio of allowable exchange rate error that a validator can be rewared
func (Keeper) RewardDistributionWindow ¶
RewardDistributionWindow returns the number of vote periods during which seigiornage reward comes in and then is distributed.
func (Keeper) SetLunaExchangeRate ¶
SetLunaExchangeRate sets the consensus exchange rate of Luna denominated in the denom asset to the store.
func (Keeper) SetLunaExchangeRateWithEvent ¶ added in v0.4.0
SetLunaExchangeRateWithEvent sets the consensus exchange rate of Luna denominated in the denom asset to the store with ABCI event
func (Keeper) SetMissCounter ¶
SetMissCounter updates the # of vote periods missed in this oracle slash window
func (Keeper) SetOracleDelegate ¶
func (k Keeper) SetOracleDelegate(ctx sdk.Context, operator sdk.ValAddress, delegatedFeeder sdk.AccAddress)
SetOracleDelegate sets the account address that the validator operator delegated oracle vote rights to
func (Keeper) SetTobinTax ¶ added in v0.4.0
SetTobinTax updates tobin tax for the denom
func (Keeper) SlashFraction ¶
SlashFraction returns oracle voting penalty rate
func (Keeper) SlashWindow ¶
SlashWindow returns # of vote period for oracle slashing
func (Keeper) VotePeriod ¶
VotePeriod returns the number of blocks during which voting takes place.
func (Keeper) VoteThreshold ¶
VoteThreshold returns the minimum percentage of votes that must be received for a ballot to pass.