Skip to content

Commit

Permalink
fix(tests): fixed services sim genesis setup
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM authored and manu0466 committed Nov 14, 2024
1 parent 8e1235b commit 54bd043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/services/simulation/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const (
keyServicesParams = "services_params"
)

func getServices(r *rand.Rand) []types.Service {
func getServices(r *rand.Rand, simState *module.SimulationState) []types.Service {
count := r.Intn(10) + 1
var services []types.Service
for i := 0; i < count; i++ {
adminAccount := simulation.RandomAccounts(r, 1)[0]
adminAccount, _ := simulation.RandomAcc(r, simState.Accounts)
service := RandomService(r, uint32(i)+1, adminAccount.Address.String())
services = append(services, service)
}
Expand Down Expand Up @@ -50,7 +50,7 @@ func RandomizedGenState(simState *module.SimulationState) {
)

simState.AppParams.GetOrGenerate(keyServices, &services, simState.Rand, func(r *rand.Rand) {
services = getServices(r)
services = getServices(r, simState)
})

simState.AppParams.GetOrGenerate(keyServicesParams, &servicesParams, simState.Rand, func(r *rand.Rand) {
Expand Down

0 comments on commit 54bd043

Please sign in to comment.