[#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 <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-11-29 13:50:49 +03:00 committed by LeL
parent 2f2ca2e0bd
commit 9622c9c858

View file

@ -215,7 +215,7 @@ func (c *initializeContext) deployContracts(method string) error {
} }
for _, ctrName := range contractList { for _, ctrName := range contractList {
cs := c.Contracts[ctrName] cs := c.getContract(ctrName)
ctrHash := cs.Hash ctrHash := cs.Hash
@ -260,6 +260,15 @@ func (c *initializeContext) deployContracts(method string) error {
if err := c.sendCommitteeTx(res.Script, res.GasConsumed); err != nil { if err := c.sendCommitteeTx(res.Script, res.GasConsumed); err != nil {
return err 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() return c.awaitTx()