forked from TrueCloudLab/frostfs-node
[#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:
parent
2f2ca2e0bd
commit
9622c9c858
1 changed files with 10 additions and 1 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue