From 7765ab3f025e076763807de6e42e4b41bbe08c9a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 24 Nov 2021 10:21:24 +0300 Subject: [PATCH] [#984] neofs-adm: replace `addRoot` with `register` for NNS Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/morph/initialize_nns.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/neofs-adm/internal/modules/morph/initialize_nns.go b/cmd/neofs-adm/internal/modules/morph/initialize_nns.go index 5d4bbc061..cce0752b1 100644 --- a/cmd/neofs-adm/internal/modules/morph/initialize_nns.go +++ b/cmd/neofs-adm/internal/modules/morph/initialize_nns.go @@ -24,14 +24,20 @@ const defaultNameServiceSysfee = 4000_0000 const defaultRegisterSysfee = 10_0000_0000 + defaultNameServiceDomainPrice func (c *initializeContext) setNNS() error { - nnsCs := c.getContract(nnsContract) + nnsCs, err := c.Client.GetContractStateByID(1) + if err != nil { + return err + } ok, err := c.nnsRootRegistered(nnsCs.Hash) if err != nil { return err } else if !ok { bw := io.NewBufBinWriter() - emit.AppCall(bw.BinWriter, nnsCs.Hash, "addRoot", callflag.All, "neofs") + emit.AppCall(bw.BinWriter, nnsCs.Hash, "register", callflag.All, + "neofs", c.CommitteeAcc.Contract.ScriptHash(), + "ops@nspcc.ru", int64(3600), int64(600), int64(604800), int64(3600)) + emit.Opcodes(bw.BinWriter, opcode.ASSERT) if err := c.sendCommitteeTx(bw.Bytes(), -1); err != nil { return fmt.Errorf("can't add domain root to NNS: %w", err) }