Merge PR #4913: Fix Module Account Blacklisting in SimApp
This commit is contained in:
committed by
Alexander Bezobchuk
parent
412462b7da
commit
bc170cba82
+1
-1
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user