kavadist - ensure that fund module account exists on init genesis (#1361)

Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
Co-authored-by: drklee3 <derrick@dlee.dev>
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
This commit is contained in:
Nick DeLuca 2022-10-21 13:02:32 -07:00 committed by GitHub
parent df5861e7ab
commit f1c37725cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,12 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, accountKeeper types.AccountKe
if moduleAcc == nil { if moduleAcc == nil {
panic(fmt.Sprintf("%s module account has not been set", types.KavaDistMacc)) panic(fmt.Sprintf("%s module account has not been set", types.KavaDistMacc))
} }
// check if the fund account exists
fundModuleAcc := accountKeeper.GetModuleAccount(ctx, types.FundModuleAccount)
if fundModuleAcc == nil {
panic(fmt.Sprintf("%s module account has not been set", types.FundModuleAccount))
}
} }
// ExportGenesis export genesis state for cdp module // ExportGenesis export genesis state for cdp module