Skip to content

Commit ca2ff56

Browse files
fix: assert that governance module has >= total deposits on startup
People will deposit tokens into gov for, for instance, ICAs, so we really can't expect it to exactly equal the deposits.
1 parent 7cb3727 commit ca2ff56

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

x/gov/genesis.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ func InitGenesis(ctx context.Context, ak types.AccountKeeper, bk types.BankKeepe
7979
ak.SetModuleAccount(ctx, moduleAcc)
8080
}
8181

82-
// check if total deposits equals balance, if it doesn't return an error
83-
if !balance.Equal(totalDeposits) {
84-
return fmt.Errorf("expected module account was %s but we got %s", balance.String(), totalDeposits.String())
82+
// check if the module account can cover the total deposits
83+
if !balance.IsAllGTE(totalDeposits) {
84+
panic(fmt.Sprintf("expected module to hold at least %s, but it holds %s", totalDeposits, balance))
8585
}
8686
return nil
8787
}

0 commit comments

Comments
 (0)