refactor(simapp): use maps.Clone to simplify the code (#24077)

Signed-off-by: linghuying <1599935829@qq.com>
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
This commit is contained in:
linghuying 2025-03-21 23:36:39 +08:00 committed by GitHub
parent 454467d081
commit b7c35f2568
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"
@ -883,12 +884,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.