From 9622c9c8588cb7471e9929f873d22fff2c9c2523 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 29 Nov 2021 13:50:49 +0300 Subject: [PATCH] [#979] adm: Register NNS domain of the deployed contracts Make `deployContracts` method to call `nnsRegisterDomain` in order to register NNS domain for deployed contracts. Signed-off-by: Leonard Lyubich --- .../internal/modules/morph/initialize_deploy.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go b/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go index 0c9db3d32..2815e52d2 100644 --- a/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go +++ b/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go @@ -215,7 +215,7 @@ func (c *initializeContext) deployContracts(method string) error { } for _, ctrName := range contractList { - cs := c.Contracts[ctrName] + cs := c.getContract(ctrName) ctrHash := cs.Hash @@ -260,6 +260,15 @@ func (c *initializeContext) deployContracts(method string) error { if err := c.sendCommitteeTx(res.Script, res.GasConsumed); err != nil { return err } + + if method == updateMethodName && methodCur == deployMethodName { + // same actions are done in initializeContext.setNNS, can be unified + domain := ctrName + ".neofs" + if err := c.nnsRegisterDomain(nnsCs.Hash, cs.Hash, domain); err != nil { + return err + } + c.Command.Printf("NNS: Set %s -> %s\n", domain, cs.Hash.StringLE()) + } } return c.awaitTx()