Skip to content

Commit

Permalink
fix simulation test
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyaoy committed Sep 23, 2024
1 parent 0cece3f commit 6dcd8fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions protocol/x/prices/simulation/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package simulation
import (
"fmt"
"math/rand"
"strings"

"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
Expand Down Expand Up @@ -47,8 +48,10 @@ func genMarketExponent(r *rand.Rand, isReasonableGenesis bool) int {
// genMarketName return randomized market name.
func genMarketName(r *rand.Rand, existingMarketNames map[string]bool) string {
marketName := simtypes.RandStringOfLength(r, simtypes.RandIntBetween(r, 3, 6)) + "-USD"
marketName = strings.ToUpper(marketName)
for existingMarketNames[marketName] {
marketName = simtypes.RandStringOfLength(r, simtypes.RandIntBetween(r, 3, 6)) + "-USD"
marketName = strings.ToUpper(marketName)
}
return marketName
}
Expand Down

0 comments on commit 6dcd8fc

Please sign in to comment.