Skip to content

Commit 3eebd46

Browse files
committed
chore: check if account is already module account
1 parent 201043f commit 3eebd46

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

upgrade/upgrade.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ func updateOrbiterModuleAccounts(ctx sdk.Context, logger log.Logger, accountKeep
7171

7272
addr, perms := accountKeeper.GetModuleAddressAndPermissions(name)
7373
if addr == nil {
74-
return nil
74+
return fmt.Errorf("failed to get module address and permissions for %s", name)
7575
}
76+
7677
acc := accountKeeper.GetAccount(ctx, addr)
7778
baseAcc, ok := (acc).(*authtypes.BaseAccount)
7879
if !ok {
80+
_, ok := (acc).(*authtypes.ModuleAccount)
81+
if ok {
82+
continue
83+
}
7984
return fmt.Errorf("error creating the base account for %s", name)
8085
}
8186

0 commit comments

Comments
 (0)