Skip to content

Commit

Permalink
Merge PR #4913: Fix Module Account Blacklisting in SimApp
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner authored and alexanderbez committed Aug 16, 2019
1 parent 5aa93e6 commit a6f265c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Move height with proof check from `CLIContext` to `BaseApp` as the height
can automatically be injected there.
* Update `handleQueryStore` to resemble `handleQueryCustom`
* (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

Expand Down
2 changes: 1 addition & 1 deletion simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,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
Expand Down
10 changes: 10 additions & 0 deletions simapp/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ func TestSimAppExport(t *testing.T) {
_, _, err = app2.ExportAppStateAndValidators(false, []string{})
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)))
}
}

0 comments on commit a6f265c

Please sign in to comment.