[#1515] adm: Print address in base58 format in morph ape get-admin

Signed-off-by: George Bartolomey <george@bh4.ru>
This commit is contained in:
George Bartolomey 2024-11-23 15:08:50 +03:00
parent 1ed7ab75fb
commit 4ea6cbbf61
Signed by: george.bartolomey
GPG key ID: 35BC54839D73BFAD

View file

@ -8,6 +8,7 @@ import (
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
apeCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common/ape"
apechain "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain"
"github.com/mr-tron/base58"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@ -200,7 +201,9 @@ func listRuleChains(cmd *cobra.Command, _ []string) {
func setAdmin(cmd *cobra.Command, _ []string) {
s, _ := cmd.Flags().GetString(addrAdminFlag)
addr, err := util.Uint160DecodeStringLE(s)
addrBytes, err := base58.Decode(s)
commonCmd.ExitOnErr(cmd, "can't decode admin addr base58: %w", err)
addr, err := util.Uint160DecodeBytesLE(addrBytes)
commonCmd.ExitOnErr(cmd, "can't decode admin addr: %w", err)
pci, ac := newPolicyContractInterface(cmd)
h, vub, err := pci.SetAdmin(addr)
@ -214,7 +217,7 @@ func getAdmin(cmd *cobra.Command, _ []string) {
pci, _ := newPolicyContractReaderInterface(cmd)
addr, err := pci.GetAdmin()
commonCmd.ExitOnErr(cmd, "unable to get admin: %w", err)
cmd.Println(addr.StringLE())
cmd.Println(base58.Encode(addr.BytesLE()))
}
func listTargets(cmd *cobra.Command, _ []string) {