Skip to content

Commit

Permalink
Enable isolated perpetuals in sim tests. (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentwschau authored Mar 27, 2024
1 parent a100739 commit 045a112
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions protocol/x/perpetuals/simulation/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,14 @@ func RandomizedGenState(simState *module.SimulationState) {
for i := 0; i < numPerpetuals; i++ {
marketId := marketsForPerp[i]

marketType := types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS
// TODO: add isolated markets when order placements for isolated markets are supported
var marketType types.PerpetualMarketType
// RandIntBetween generates integers in the range [min, max), so need [0, 2) to generate integers that are
// 0 or 1.
if simtypes.RandIntBetween(r, 0, 2) == 0 {
marketType = types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_CROSS
} else {
marketType = types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_ISOLATED
}

perpetuals[i] = types.Perpetual{
Params: types.PerpetualParams{
Expand Down

0 comments on commit 045a112

Please sign in to comment.