keeper

package
v0.0.0-...-def7031 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IterateExchangeRateVote

type IterateExchangeRateVote = func(voterAddr sdk.ValAddress,
	aggregateVote types.AggregateExchangeRateVote) (stop bool)

type IterateFeederDelegationHandler

type IterateFeederDelegationHandler = func(delegator sdk.ValAddress, delegate sdk.AccAddress) (stop bool)

type Keeper

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

Keeper of the oracle store

func NewKeeper

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

NewKeeper constructs a new keeper for oracle

func (Keeper) ClearTobinTaxes

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

ClearTobinTaxes clears tobin taxes.

func (Keeper) DeleteAggregateExchangeRatePrevote

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

DeleteAggregateExchangeRatePrevote deletes an oracle prevote from the store

func (Keeper) DeleteAggregateExchangeRateVote

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

DeleteAggregateExchangeRateVote deletes an oracle prevote from the store

func (Keeper) DeleteExchangeRate

func (k Keeper) DeleteExchangeRate(ctx sdk.Context, denom string)

DeleteExchangeRate deletes the consensus exchange rate of USD denominated in the denom asset 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) GetAggregateExchangeRatePrevote

func (k Keeper) GetAggregateExchangeRatePrevote(ctx sdk.Context,
	voter sdk.ValAddress) (types.AggregateExchangeRatePrevote, error)

GetAggregateExchangeRatePrevote retrieves an oracle prevote from the store

func (Keeper) GetAggregateExchangeRateVote

func (k Keeper) GetAggregateExchangeRateVote(ctx sdk.Context,
	voter sdk.ValAddress) (types.AggregateExchangeRateVote,
	error)

GetAggregateExchangeRateVote retrieves an oracle prevote from the store

func (Keeper) GetExchangeRate

func (k Keeper) GetExchangeRate(ctx sdk.Context, denom string) (sdk.Dec, error)

GetExchangeRate gets the consensus exchange rate of USD denominated in the denom asset 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) uint64

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

func (Keeper) GetTobinTax

func (k Keeper) GetTobinTax(ctx sdk.Context, denom string) (sdk.Dec, error)

GetTobinTax return tobin tax for the denom

func (Keeper) IterateAggregateExchangeRatePrevotes

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

IterateAggregateExchangeRatePrevotes iterates rate over prevotes in the store

func (Keeper) IterateAggregateExchangeRateVotes

func (k Keeper) IterateAggregateExchangeRateVotes(ctx sdk.Context,
	handler IterateExchangeRateVote)

IterateAggregateExchangeRateVotes iterates rate over prevotes in the store

func (Keeper) IterateExchangeRates

func (k Keeper) IterateExchangeRates(ctx sdk.Context, handler func(denom string, exchangeRate sdk.Dec) (stop bool))

IterateExchangeRates iterates over USD rates in the store.

func (Keeper) IterateFeederDelegations

func (k Keeper) IterateFeederDelegations(
	ctx sdk.Context,
	handler IterateFeederDelegationHandler,
)

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 uint64) (stop bool))

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

func (Keeper) IterateTobinTaxes

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) Logger

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

Logger returns a module-specific logger.

func (Keeper) SetAggregateExchangeRatePrevote

func (k Keeper) SetAggregateExchangeRatePrevote(ctx sdk.Context,
	voter sdk.ValAddress,
	prevote types.AggregateExchangeRatePrevote)

SetAggregateExchangeRatePrevote set an oracle aggregate prevote to the store

func (Keeper) SetAggregateExchangeRateVote

func (k Keeper) SetAggregateExchangeRateVote(ctx sdk.Context,
	voter sdk.ValAddress,
	vote types.AggregateExchangeRateVote)

SetAggregateExchangeRateVote adds an oracle aggregate prevote to the store

func (Keeper) SetExchangeRate

func (k Keeper) SetExchangeRate(ctx sdk.Context, denom string, exchangeRate sdk.Dec)

SetExchangeRate sets the consensus exchange rate of USD denominated in the denom asset 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 uint64)

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

func (Keeper) SetTobinTax

func (k Keeper) SetTobinTax(ctx sdk.Context, denom string, tobinTax sdk.Dec)

SetTobinTax updates tobin tax for the denom

func (Keeper) ValidateFeeder

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

ValidateFeeder returns the given feeder is allowed to feed the message or not.

Directories

Path Synopsis
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

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