diff --git a/x/distribution/CHANGELOG.md b/x/distribution/CHANGELOG.md index 0a341876bc94..ae69c4d3d800 100644 --- a/x/distribution/CHANGELOG.md +++ b/x/distribution/CHANGELOG.md @@ -31,6 +31,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#22832](https://github.com/cosmos/cosmos-sdk/pull/22832) Ensure the distribution module has at least as many tokens as outstanding rewards at genesis import * [#20790](https://github.com/cosmos/cosmos-sdk/pull/20790) `x/distribution` does not depend on `x/protocolpool` anymore, now `x/distribution` only does token transfers and `x/protocolpool` does the rest. ### API Breaking Changes diff --git a/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index 4743c45d6571..42130ee83d94 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#22832](https://github.com/cosmos/cosmos-sdk/pull/22832) Ensure the governance module has at least as many tokens as are deposited at genesis import. * [#20521](https://github.com/cosmos/cosmos-sdk/pull/20521) Legacy proposals can now access the `appmodule.Environment` present in the `context.Context` of the handler. This is useful when migrating to server/v2 and removing the sdk context dependency. * [#19741](https://github.com/cosmos/cosmos-sdk/pull/19741) Add `ExpeditedQuorum` parameter specifying a minimum quorum for expedited proposals, that can differ from the regular quorum. * [#19352](https://github.com/cosmos/cosmos-sdk/pull/19352) `TallyResult` include vote options counts. Those counts replicates the now deprecated (but not removed) yes, no, abstain and veto count fields. diff --git a/x/gov/genesis.go b/x/gov/genesis.go index dd9e42b18017..6c2a23be7343 100644 --- a/x/gov/genesis.go +++ b/x/gov/genesis.go @@ -79,9 +79,9 @@ func InitGenesis(ctx context.Context, ak types.AccountKeeper, bk types.BankKeepe ak.SetModuleAccount(ctx, moduleAcc) } - // check if total deposits equals balance, if it doesn't return an error - if !balance.Equal(totalDeposits) { - return fmt.Errorf("expected module account was %s but we got %s", balance.String(), totalDeposits.String()) + // check if the module account can cover the total deposits + if !balance.IsAllGTE(totalDeposits) { + panic(fmt.Sprintf("expected module to hold at least %s, but it holds %s", totalDeposits, balance)) } return nil }