diff --git a/CHANGELOG.md b/CHANGELOG.md index 5495e8480bf0..4330ce40d69c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ longer panics if the store to load contains substores that we didn't explicitly * Update `handleQueryStore` to resemble `handleQueryCustom` * (cli) [\#4763](https://github.com/cosmos/cosmos-sdk/issues/4763) Fix flag `--min-self-delegation` for staking `EditValidator` * (keys) Fix ledger custom coin type support bug +* (simulation) [\#4912](https://github.com/cosmos/cosmos-sdk/issues/4912) Fix SimApp ModuleAccountAddrs to properly return black listed addresses for bank keeper initialization ## [v0.36.0] - 2019-08-13 diff --git a/simapp/app.go b/simapp/app.go index b356cbef5b01..7037922a24cf 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -253,7 +253,7 @@ func (app *SimApp) LoadHeight(height int64) error { func (app *SimApp) ModuleAccountAddrs() map[string]bool { modAccAddrs := make(map[string]bool) for acc := range maccPerms { - modAccAddrs[app.SupplyKeeper.GetModuleAddress(acc).String()] = true + modAccAddrs[supply.NewModuleAddress(acc).String()] = true } return modAccAddrs diff --git a/simapp/app_test.go b/simapp/app_test.go index 6e5635eadb67..4cddce7b6786 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -36,6 +36,16 @@ func TestSimAppExport(t *testing.T) { require.NoError(t, err, "ExportAppStateAndValidators should not have an error") } +// ensure that black listed addresses are properly set in bank keeper +func TestBlackListedAddrs(t *testing.T) { + db := dbm.NewMemDB() + app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, 0) + + for acc := range maccPerms { + require.True(t, app.BankKeeper.BlacklistedAddr(app.SupplyKeeper.GetModuleAddress(acc))) + } +} + func TestGetMaccPerms(t *testing.T) { dup := GetMaccPerms() require.Equal(t, maccPerms, dup, "duplicated module account permissions differed from actual module account permissions")