[#1748] neofs-adm: Remove addRecord from nnsRegisterDomainScript

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-09-02 10:59:09 +03:00 committed by fyrchik
parent eb5e1121c5
commit 9290a7e1fe
3 changed files with 37 additions and 28 deletions

View file

@ -26,6 +26,7 @@ import (
"github.com/nspcc-dev/neo-go/pkg/vm/emit"
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
"github.com/nspcc-dev/neo-go/pkg/vm/vmstate"
"github.com/nspcc-dev/neofs-contract/nns"
"github.com/nspcc-dev/neofs-node/pkg/innerring"
morphClient "github.com/nspcc-dev/neofs-node/pkg/morph/client"
"github.com/spf13/viper"
@ -263,13 +264,17 @@ func (c *initializeContext) updateContracts() error {
if method == deployMethodName {
// same actions are done in initializeContext.setNNS, can be unified
domain := ctrName + ".neofs"
script, err := c.nnsRegisterDomainScript(nnsHash, cs.Hash, domain, true)
script, ok, err := c.nnsRegisterDomainScript(nnsHash, cs.Hash, domain, true)
if err != nil {
return err
}
if script != nil {
totalGasCost += defaultRegisterSysfee + native.GASFactor
w.WriteBytes(script)
if !ok {
if script != nil {
totalGasCost += defaultRegisterSysfee + native.GASFactor
w.WriteBytes(script)
}
emit.AppCall(w.BinWriter, nnsHash, "addRecord", callflag.All,
domain, int64(nns.TXT), cs.Hash.StringLE())
}
c.Command.Printf("NNS: Set %s -> %s\n", domain, cs.Hash.StringLE())
}