From f836e7c1dca00a089b566c1095ebd6f97b73a513 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 7 Oct 2021 16:32:11 +0300 Subject: [PATCH] [#888] neofs-adm: use constant for update methods Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/morph/initialize_deploy.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go b/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go index ebb48c45d..8579455ac 100644 --- a/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go +++ b/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go @@ -74,12 +74,12 @@ func (c *initializeContext) deployNNS(method string) error { return err } - if _, err := c.Client.GetContractStateByHash(cs.Hash); err == nil && method != "update" { + if _, err := c.Client.GetContractStateByHash(cs.Hash); err == nil && method != updateMethodName { return nil } params := getContractDeployParameters(cs.RawNEF, cs.RawManifest, nil) - if method == "update" { + if method == updateMethodName { params = params[:len(params)-1] // update has only NEF and manifest args } @@ -89,7 +89,7 @@ func (c *initializeContext) deployNNS(method string) error { } mgmtHash := c.nativeHash(nativenames.Management) - if method == "update" { + if method == updateMethodName { nnsCs, err := c.Client.GetContractStateByID(1) if err != nil { return fmt.Errorf("can't resolve NNS hash for contract update: %w", err)