From 57230013908faf3492fa5e3d33e5f95c2f9389be Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Fri, 5 Jun 2020 08:41:13 -0400 Subject: [PATCH] fix: populate collateral denoms once (#551) --- x/incentive/simulation/genesis.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x/incentive/simulation/genesis.go b/x/incentive/simulation/genesis.go index 659ce358..4bda7d8d 100644 --- a/x/incentive/simulation/genesis.go +++ b/x/incentive/simulation/genesis.go @@ -26,9 +26,12 @@ func RandomizedGenState(simState *module.SimulationState) { // Get collateral asset denoms from existing CDP genesis state and pass to incentive params var cdpGenesis cdp.GenesisState simState.Cdc.MustUnmarshalJSON(simState.GenState[cdp.ModuleName], &cdpGenesis) - for _, collateral := range cdpGenesis.Params.CollateralParams { - CollateralDenoms = append(CollateralDenoms, collateral.Denom) + if len(CollateralDenoms) == 0 { + for _, collateral := range cdpGenesis.Params.CollateralParams { + CollateralDenoms = append(CollateralDenoms, collateral.Denom) + } } + params := genParams(simState.Rand) // Generate random reward and claim periods