Documentation ¶
Index ¶
- func GetCurrentPriceKey() []byte
- func GetFedPriceKey(u linotypes.AccountKey) []byte
- func GetFeedHistoryKey() []byte
- func GetLastValidatorsKey() []byte
- func GetPriceHistoryKey() []byte
- func NewPriceDumper(store PriceStorage) *testutils.Dumper
- type FedPrice
- type FedRecord
- type FeedHistory
- type PriceStorage
- func (ps PriceStorage) GetCurrentPrice(ctx sdk.Context) (*TimePrice, sdk.Error)
- func (ps PriceStorage) GetFedPrice(ctx sdk.Context, val linotypes.AccountKey) (*FedPrice, sdk.Error)
- func (ps PriceStorage) GetFeedHistory(ctx sdk.Context) []FeedHistory
- func (ps PriceStorage) GetLastValidators(ctx sdk.Context) []linotypes.AccountKey
- func (ps PriceStorage) GetPriceHistory(ctx sdk.Context) []TimePrice
- func (ps PriceStorage) SetCurrentPrice(ctx sdk.Context, price *TimePrice)
- func (ps PriceStorage) SetFedPrice(ctx sdk.Context, price *FedPrice)
- func (ps PriceStorage) SetFeedHistory(ctx sdk.Context, history []FeedHistory)
- func (ps PriceStorage) SetLastValidators(ctx sdk.Context, last []linotypes.AccountKey)
- func (ps PriceStorage) SetPriceHistory(ctx sdk.Context, prices []TimePrice)
- type TimePrice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFedPriceKey ¶
func GetFedPriceKey(u linotypes.AccountKey) []byte
GetFedPriceKey - price key.
func GetFeedHistoryKey ¶
func GetFeedHistoryKey() []byte
GetLastValidatorsKey - get last validators.
func GetLastValidatorsKey ¶
func GetLastValidatorsKey() []byte
GetLastValidatorsKey - get last validators.
func NewPriceDumper ¶
func NewPriceDumper(store PriceStorage) *testutils.Dumper
Types ¶
type FedPrice ¶
type FedPrice struct { Validator linotypes.AccountKey `json:"validator"` Price linotypes.MiniDollar `json:"price"` UpdateAt int64 `json:"update_at"` }
FedPrice is record of price fed by validators.
type FedRecord ¶
type FedRecord struct { Validator linotypes.AccountKey `json:"validator"` Price linotypes.MiniDollar `json:"price"` Power linotypes.Coin `json:"power"` UpdateAt int64 `json:"update_at"` }
FedRecord - power and price.
type FeedHistory ¶
type FeedHistory struct { Price linotypes.MiniDollar `json:"price"` Feeded []FedRecord `json:"feeded"` UpdateAt int64 `json:"update_at"` }
FeedHistory the history of price feed of one price update. Used by querier for now and governance in future.
type PriceStorage ¶
type PriceStorage struct {
// contains filtered or unexported fields
}
PriceStorage - price storage
func NewPriceStorage ¶
func NewPriceStorage(key sdk.StoreKey) PriceStorage
NewPriceStorage - returns a new PriceStorage, binary encoded.
func (PriceStorage) GetCurrentPrice ¶
GetCurrentPrice - return current price
func (PriceStorage) GetFedPrice ¶
func (ps PriceStorage) GetFedPrice(ctx sdk.Context, val linotypes.AccountKey) (*FedPrice, sdk.Error)
GetFedPrice - get fed price of validator from KVStore
func (PriceStorage) GetFeedHistory ¶
func (ps PriceStorage) GetFeedHistory(ctx sdk.Context) []FeedHistory
func (PriceStorage) GetLastValidators ¶
func (ps PriceStorage) GetLastValidators(ctx sdk.Context) []linotypes.AccountKey
func (PriceStorage) GetPriceHistory ¶
func (ps PriceStorage) GetPriceHistory(ctx sdk.Context) []TimePrice
GetPriceHistory - return price history.
func (PriceStorage) SetCurrentPrice ¶
func (ps PriceStorage) SetCurrentPrice(ctx sdk.Context, price *TimePrice)
func (PriceStorage) SetFedPrice ¶
func (ps PriceStorage) SetFedPrice(ctx sdk.Context, price *FedPrice)
SetFedPrice - set fed price to KVStore
func (PriceStorage) SetFeedHistory ¶
func (ps PriceStorage) SetFeedHistory(ctx sdk.Context, history []FeedHistory)
func (PriceStorage) SetLastValidators ¶
func (ps PriceStorage) SetLastValidators(ctx sdk.Context, last []linotypes.AccountKey)
func (PriceStorage) SetPriceHistory ¶
func (ps PriceStorage) SetPriceHistory(ctx sdk.Context, prices []TimePrice)
SetPriceHistory - set price history.
type TimePrice ¶
type TimePrice struct { Price linotypes.MiniDollar `json:"price"` UpdateAt int64 `json:"update_at"` }
TimePrice is time + price
Click to show internal directories.
Click to hide internal directories.