forked from TrueCloudLab/frostfs-node
[#932] adm: Rename util
to helper
To avoid conflicts with `util` packages in other imports. Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
e2cee4cf09
commit
802192cfef
34 changed files with 144 additions and 144 deletions
|
@ -10,7 +10,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-contract/nns"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/commonflags"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/constants"
|
||||
morphUtil "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/util"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/helper"
|
||||
morphClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
|
||||
"github.com/nspcc-dev/neo-go/pkg/io"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpcclient/invoker"
|
||||
|
@ -36,7 +36,7 @@ type contractDumpInfo struct {
|
|||
}
|
||||
|
||||
func dumpContractHashes(cmd *cobra.Command, _ []string) error {
|
||||
c, err := morphUtil.GetN3Client(viper.GetViper())
|
||||
c, err := helper.GetN3Client(viper.GetViper())
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't create N3 client: %w", err)
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ func dumpContractHashes(cmd *cobra.Command, _ []string) error {
|
|||
|
||||
irSize := 0
|
||||
for ; irSize < lastGlagoliticLetter; irSize++ {
|
||||
ok, err := morphUtil.NNSIsAvailable(c, cs.Hash, morphUtil.GetAlphabetNNSDomain(irSize))
|
||||
ok, err := helper.NNSIsAvailable(c, cs.Hash, helper.GetAlphabetNNSDomain(irSize))
|
||||
if err != nil {
|
||||
return err
|
||||
} else if ok {
|
||||
|
@ -70,7 +70,7 @@ func dumpContractHashes(cmd *cobra.Command, _ []string) error {
|
|||
bw.Reset()
|
||||
for i := 0; i < irSize; i++ {
|
||||
emit.AppCall(bw.BinWriter, cs.Hash, "resolve", callflag.ReadOnly,
|
||||
morphUtil.GetAlphabetNNSDomain(i),
|
||||
helper.GetAlphabetNNSDomain(i),
|
||||
int64(nns.TXT))
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ func dumpContractHashes(cmd *cobra.Command, _ []string) error {
|
|||
|
||||
for i := 0; i < irSize; i++ {
|
||||
info := contractDumpInfo{name: fmt.Sprintf("alphabet %d", i)}
|
||||
if h, err := morphUtil.ParseNNSResolveResult(alphaRes.Stack[i]); err == nil {
|
||||
if h, err := helper.ParseNNSResolveResult(alphaRes.Stack[i]); err == nil {
|
||||
info.hash = h
|
||||
}
|
||||
infos = append(infos, info)
|
||||
|
@ -91,7 +91,7 @@ func dumpContractHashes(cmd *cobra.Command, _ []string) error {
|
|||
for _, ctrName := range constants.ContractList {
|
||||
bw.Reset()
|
||||
emit.AppCall(bw.BinWriter, cs.Hash, "resolve", callflag.ReadOnly,
|
||||
morphUtil.DomainOf(ctrName), int64(nns.TXT))
|
||||
helper.DomainOf(ctrName), int64(nns.TXT))
|
||||
|
||||
res, err := c.InvokeScript(bw.Bytes(), nil)
|
||||
if err != nil {
|
||||
|
@ -100,7 +100,7 @@ func dumpContractHashes(cmd *cobra.Command, _ []string) error {
|
|||
|
||||
info := contractDumpInfo{name: ctrName}
|
||||
if len(res.Stack) != 0 {
|
||||
if h, err := morphUtil.ParseNNSResolveResult(res.Stack[0]); err == nil {
|
||||
if h, err := helper.ParseNNSResolveResult(res.Stack[0]); err == nil {
|
||||
info.hash = h
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ func dumpContractHashes(cmd *cobra.Command, _ []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func dumpCustomZoneHashes(cmd *cobra.Command, nnsHash util.Uint160, zone string, c morphUtil.Client) error {
|
||||
func dumpCustomZoneHashes(cmd *cobra.Command, nnsHash util.Uint160, zone string, c helper.Client) error {
|
||||
const nnsMaxTokens = 100
|
||||
|
||||
inv := invoker.New(c, nil)
|
||||
|
@ -135,7 +135,7 @@ func dumpCustomZoneHashes(cmd *cobra.Command, nnsHash util.Uint160, zone string,
|
|||
return
|
||||
}
|
||||
|
||||
h, err := morphUtil.NNSResolveHash(inv, nnsHash, string(bs))
|
||||
h, err := helper.NNSResolveHash(inv, nnsHash, string(bs))
|
||||
if err != nil {
|
||||
cmd.PrintErrf("Could not resolve name %s: %v\n", string(bs), err)
|
||||
return
|
||||
|
@ -227,7 +227,7 @@ func printContractInfo(cmd *cobra.Command, infos []contractDumpInfo) {
|
|||
cmd.Print(buf.String())
|
||||
}
|
||||
|
||||
func fillContractVersion(cmd *cobra.Command, c morphUtil.Client, infos []contractDumpInfo) {
|
||||
func fillContractVersion(cmd *cobra.Command, c helper.Client, infos []contractDumpInfo) {
|
||||
bw := io.NewBufBinWriter()
|
||||
sub := io.NewBufBinWriter()
|
||||
for i := range infos {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue