From f1c37725cc9f2323b95ff4f070c12917119a76bd Mon Sep 17 00:00:00 2001 From: Nick DeLuca Date: Fri, 21 Oct 2022 13:02:32 -0700 Subject: [PATCH] kavadist - ensure that fund module account exists on init genesis (#1361) Co-authored-by: rhuairahrighairigh Co-authored-by: drklee3 Co-authored-by: Kevin Davis --- x/kavadist/genesis.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/kavadist/genesis.go b/x/kavadist/genesis.go index 9efbd441..78079bef 100644 --- a/x/kavadist/genesis.go +++ b/x/kavadist/genesis.go @@ -27,6 +27,12 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, accountKeeper types.AccountKe if moduleAcc == nil { 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