fix: populate collateral denoms once (#551)

This commit is contained in:
Kevin Davis 2020-06-05 08:41:13 -04:00 committed by GitHub
parent f97580c773
commit 5723001390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
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