From bfabbb7968af970575c7b1adcb30ac084866b512 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 17 Aug 2022 19:09:27 +0300 Subject: [PATCH] renew neofs TLD Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/morph/update.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/neofs-adm/internal/modules/morph/update.go b/cmd/neofs-adm/internal/modules/morph/update.go index 8f128e7cc..0200fcb27 100644 --- a/cmd/neofs-adm/internal/modules/morph/update.go +++ b/cmd/neofs-adm/internal/modules/morph/update.go @@ -31,6 +31,11 @@ func hardcodeNNS(cmd *cobra.Command, _ []string) error { return fmt.Errorf("initialization error: %w", err) } + nnsCs, err := c.Client.GetContractStateByID(1) + if err != nil { + panic(err) + } + /* FIX for mainnet, set hardcoded hashes. */ hashes := map[string]string{ //"neofs.neofs": "2cafa46838e8b564468ebd868dcafdd99dce6221", @@ -50,11 +55,6 @@ func hardcodeNNS(cmd *cobra.Command, _ []string) error { /* "zhivete": */ getAlphabetNNSDomain(6): "5b17c579bf56884fd68af152432b3b5aee7aee76", } - nnsCs, err := c.Client.GetContractStateByID(1) - if err != nil { - panic(err) - } - w := io.NewBufBinWriter() for name, sh := range hashes { h, err := util.Uint160DecodeStringLE(sh) @@ -65,6 +65,8 @@ func hardcodeNNS(cmd *cobra.Command, _ []string) error { if err != nil || cs.Hash != h { return fmt.Errorf("contract %s should have hash %s, but: %w", name, sh, err) } + emit.AppCall(w.BinWriter, nnsCs.Hash, "renew", callflag.All, + name) emit.AppCall(w.BinWriter, nnsCs.Hash, "addRecord", callflag.All, name, int64(nns.TXT), h.StringLE()) c.Command.Printf("NNS: Set %s -> %s\n", name, h.StringLE())