From 6b3a9e6fcc2fad16e50e55cb74021f3de1db18d4 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 21 Sep 2021 15:18:06 +0300 Subject: [PATCH] [#834] neofs-adm: Update contract update if it exists Signed-off-by: Alex Vanin --- cmd/neofs-adm/internal/modules/morph/initialize_deploy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go b/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go index 5a0ef6f0..9e9ae65b 100644 --- a/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go +++ b/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go @@ -134,7 +134,7 @@ func (c *initializeContext) deployContracts(method string) error { // alphabet contracts should be deployed by individual nodes to get different hashes. for i, acc := range c.Accounts { ctrHash := state.CreateContractHash(acc.Contract.ScriptHash(), alphaCs.NEF.Checksum, alphaCs.Manifest.Name) - if _, err := c.Client.GetContractStateByHash(ctrHash); err == nil { + if _, err := c.Client.GetContractStateByHash(ctrHash); err == nil && method != "migrate" { c.Command.Printf("Alphabet contract #%d is already deployed.\n", i) continue } @@ -179,7 +179,7 @@ func (c *initializeContext) deployContracts(method string) error { for _, ctrName := range contractList { cs := c.Contracts[ctrName] - if _, err := c.Client.GetContractStateByHash(cs.Hash); err == nil { + if _, err := c.Client.GetContractStateByHash(cs.Hash); err == nil && method != "migrate" { c.Command.Printf("%s contract is already deployed.\n", ctrName) continue }