Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string
- func ParamChanges(r *rand.Rand) []simulation.ParamChange
- func RandomizedGenState(simState *module.SimulationState)
- func SimulateMsgUpdatePrices(ak auth.AccountKeeper, keeper keeper.Keeper, blocks int) simulation.Operation
- func WeightedOperations(appParams simulation.AppParams, cdc *codec.Codec, ak auth.AccountKeeper, ...) simulation.WeightedOperations
- type PriceGenerator
Constants ¶
View Source
const (
OpWeightMsgUpdatePrices = "op_weight_msg_update_prices"
)
Simulation operation weights constants
Variables ¶
View Source
var ( // BaseAssets is a list of collateral asset denoms BaseAssets = [3]string{"bnb", "xrp", "btc"} QuoteAsset = "usd" )
Functions ¶
func DecodeStore ¶
DecodeStore unmarshals the KVPair's Value to the corresponding pricefeed type
func ParamChanges ¶
func ParamChanges(r *rand.Rand) []simulation.ParamChange
ParamChanges defines the parameters that can be modified by param change proposals on the simulation
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState generates a random GenesisState for pricefeed
func SimulateMsgUpdatePrices ¶ added in v0.8.0
func SimulateMsgUpdatePrices(ak auth.AccountKeeper, keeper keeper.Keeper, blocks int) simulation.Operation
SimulateMsgUpdatePrices updates the prices of various assets by randomly varying them based on current price
func WeightedOperations ¶ added in v0.8.0
func WeightedOperations( appParams simulation.AppParams, cdc *codec.Codec, ak auth.AccountKeeper, k keeper.Keeper, ) simulation.WeightedOperations
WeightedOperations returns all the operations from the module with their respective weights
Types ¶
type PriceGenerator ¶ added in v0.11.0
type PriceGenerator struct {
// contains filtered or unexported fields
}
PriceGenerator allows deterministic price generation in simulations
func NewPriceGenerator ¶ added in v0.11.0
func NewPriceGenerator(startingPrice map[string]sdk.Dec) *PriceGenerator
NewPriceGenerator returns a new market price generator from starting values
func (*PriceGenerator) GetCurrentPrice ¶ added in v0.11.0
func (p *PriceGenerator) GetCurrentPrice(marketID string) sdk.Dec
GetCurrentPrice returns price for last blockHeight set by Step
Click to show internal directories.
Click to hide internal directories.