Documentation ¶
Index ¶
- Variables
- func NewHandler(keeper Keeper, govKeeper government.Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (keeper Keeper) AddAsset(ctx sdk.Context, assetName string)
- func (keeper Keeper) AddOracle(ctx sdk.Context, oracle sdk.AccAddress)
- func (keeper Keeper) AddRawPrice(ctx sdk.Context, oracle sdk.AccAddress, price types.Price) sdk.Error
- func (keeper Keeper) ComputeAndUpdateCurrentPrices(ctx sdk.Context) error
- func (keeper Keeper) GetAssets(ctx sdk.Context) (assets ctypes.Strings)
- func (keeper Keeper) GetCurrentPrice(ctx sdk.Context, asset string) (currentPrice types.Price, found bool)
- func (keeper Keeper) GetCurrentPrices(ctx sdk.Context) types.Prices
- func (keeper Keeper) GetOracles(ctx sdk.Context) (oracles ctypes.Addresses)
- func (keeper Keeper) GetRawPrices(ctx sdk.Context) types.RawPrices
- func (keeper Keeper) GetRawPricesForAsset(ctx sdk.Context, assetName string) types.RawPrices
- func (keeper Keeper) IsOracle(ctx sdk.Context, address sdk.Address) bool
- func (keeper Keeper) SetCurrentPrice(ctx sdk.Context, currentPrice types.Price)
Constants ¶
This section is empty.
Variables ¶
View Source
var TestPrice = types.Price{ AssetName: "test", Value: sdk.NewDec(10), Expiry: sdk.NewInt(5000), }
Test variables
Functions ¶
func NewHandler ¶ added in v1.3.2
func NewHandler(keeper Keeper, govKeeper government.Keeper) sdk.Handler
func NewQuerier ¶
Types ¶
type Keeper ¶
func SetupTestInput ¶
This function create an environment to test modules
func (Keeper) AddOracle ¶
func (keeper Keeper) AddOracle(ctx sdk.Context, oracle sdk.AccAddress)
AddOracle adds an Oracle to the store
func (Keeper) AddRawPrice ¶ added in v1.3.2
func (keeper Keeper) AddRawPrice(ctx sdk.Context, oracle sdk.AccAddress, price types.Price) sdk.Error
AddRawPrice sets the raw price for a given token after checking the validity of the signer. If the signer hasn't the rights to set the price, then function returns error.
func (Keeper) ComputeAndUpdateCurrentPrices ¶ added in v1.3.0
func (Keeper) GetCurrentPrice ¶
func (keeper Keeper) GetCurrentPrice(ctx sdk.Context, asset string) (currentPrice types.Price, found bool)
GetCurrentPrice retrieves the current price for the given asset
func (Keeper) GetCurrentPrices ¶
GetCurrentPrices retrieves all the current prices
func (Keeper) GetOracles ¶
GetOracles returns the list of all the currently present oracles
func (Keeper) GetRawPrices ¶
GetRawPrices returns the list of the whole raw prices currently stored
func (Keeper) GetRawPricesForAsset ¶ added in v1.3.2
GetRawPricesForAsset retrieves all the raw prices of the given asset
Click to show internal directories.
Click to hide internal directories.