[#888] neofs-adm: update container contract deploy parameters

It supports NNS domain and zone now.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-09-30 17:42:16 +03:00 committed by Alex Vanin
parent 8ddd0aab55
commit 6571f9214f

View file

@ -313,10 +313,18 @@ func (c *initializeContext) getContractDeployData(ctrName string, keysParam []sm
newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash), newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash),
newContractParameter(smartcontract.Hash160Type, c.Contracts[containerContract].Hash)) newContractParameter(smartcontract.Hash160Type, c.Contracts[containerContract].Hash))
case containerContract: 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, items = append(items,
newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash), newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash),
newContractParameter(smartcontract.Hash160Type, c.Contracts[balanceContract].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: case neofsIDContract:
items = append(items, items = append(items,
newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash), newContractParameter(smartcontract.Hash160Type, c.Contracts[netmapContract].Hash),