From f1202a5738fbf1cb5b4f021b001cee06675d1630 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 18 Oct 2021 15:14:32 +0300 Subject: [PATCH] [#927] neofs-adm: fix dump-config command ``` Error: can't to initialize context: can't read alphabet wallets dir: open : no such file or directory ``` It needs neither contracts nor wallets, just N3 client. Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/morph/dump.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/neofs-adm/internal/modules/morph/dump.go b/cmd/neofs-adm/internal/modules/morph/dump.go index 2bb204c235..a132ac852e 100644 --- a/cmd/neofs-adm/internal/modules/morph/dump.go +++ b/cmd/neofs-adm/internal/modules/morph/dump.go @@ -102,22 +102,22 @@ func dumpContractHashes(cmd *cobra.Command, _ []string) error { } func dumpNetworkConfig(cmd *cobra.Command, _ []string) error { - wCtx, err := newInitializeContext(cmd, viper.GetViper()) + c, err := getN3Client(viper.GetViper()) if err != nil { - return fmt.Errorf("can't to initialize context: %w", err) + return fmt.Errorf("can't create N3 client: %w", err) } - cs, err := wCtx.Client.GetContractStateByID(1) + cs, err := c.GetContractStateByID(1) if err != nil { return fmt.Errorf("can't get NNS contract info: %w", err) } - nmHash, err := nnsResolveHash(wCtx.Client, cs.Hash, netmapContract+".neofs") + nmHash, err := nnsResolveHash(c, cs.Hash, netmapContract+".neofs") if err != nil { return fmt.Errorf("can't get netmap contract hash: %w", err) } - res, err := wCtx.Client.InvokeFunction(nmHash, "listConfig", + res, err := c.InvokeFunction(nmHash, "listConfig", []smartcontract.Parameter{}, []transaction.Signer{{}}) if err != nil || res.State != vm.HaltState.String() || len(res.Stack) == 0 { return errors.New("can't fetch list of network config keys from the netmap contract")