refactor(simapp): using maps.Clone to simplify codes (#19885)

Co-authored-by: weixie.c <weixie.c@kaitaitech.cn>
This commit is contained in:
cui 2024-03-28 11:35:10 +08:00 committed by GitHub
parent 6972e006be
commit f630cfb739
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"io"
"maps"
"os"
"path/filepath"
@ -764,12 +765,7 @@ func (app *SimApp) RegisterNodeService(clientCtx client.Context, cfg config.Conf
//
// NOTE: This is solely to be used for testing purposes.
func GetMaccPerms() map[string][]string {
dupMaccPerms := make(map[string][]string)
for k, v := range maccPerms {
dupMaccPerms[k] = v
}
return dupMaccPerms
return maps.Clone(maccPerms)
}
// BlockedAddresses returns all the app's blocked account addresses.