From 6571f9214fa04fc369243d37e4cf8cd2a83fa639 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 30 Sep 2021 17:42:16 +0300 Subject: [PATCH] [#888] neofs-adm: update container contract deploy parameters It supports NNS domain and zone now. Signed-off-by: Evgenii Stratonikov --- .../internal/modules/morph/initialize_deploy.go | 10 +++++++++- 1 file changed, 9 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 9a7080c3f..ebb48c45d 100644 --- a/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go +++ b/cmd/neofs-adm/internal/modules/morph/initialize_deploy.go @@ -313,10 +313,18 @@ func (c *initializeContext) getContractDeployData(ctrName string, keysParam []sm newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash), newContractParameter(smartcontract.Hash160Type, c.Contracts[containerContract].Hash)) case containerContract: + // In case if NNS is updated multiple times, we can't calculate + // it's actual hash based on local data, thus query chain. + nnsCs, err := c.Client.GetContractStateByID(1) + if err != nil { + panic("NNS is not yet deployed") + } items = append(items, newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash), newContractParameter(smartcontract.Hash160Type, c.Contracts[balanceContract].Hash), - newContractParameter(smartcontract.Hash160Type, c.Contracts[neofsIDContract].Hash)) + newContractParameter(smartcontract.Hash160Type, c.Contracts[neofsIDContract].Hash), + newContractParameter(smartcontract.Hash160Type, nnsCs.Hash), + newContractParameter(smartcontract.StringType, "container")) case neofsIDContract: items = append(items, newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash),