diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go b/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go index 20e44a81a..ca3a9599f 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize_deploy.go @@ -563,22 +563,9 @@ func (c *initializeContext) getContractDeployData(ctrName string, keysParam []an case netmapContract: md := getDefaultNetmapContractConfigMap() if method == updateMethodName { - arr, err := c.getNetConfigFromNetmapContract() - if err != nil { + if err := c.mergeNetmapConfig(md); err != nil { return nil, err } - m, err := parseConfigFromNetmapContract(arr) - if err != nil { - return nil, err - } - for k, v := range m { - for _, key := range netmapConfigKeys { - if k == key { - md[k] = v - break - } - } - } } var configParam []any @@ -618,6 +605,26 @@ func (c *initializeContext) getNetConfigFromNetmapContract() ([]stackitem.Item, return arr, err } +func (c *initializeContext) mergeNetmapConfig(md map[string]any) error { + arr, err := c.getNetConfigFromNetmapContract() + if err != nil { + return err + } + m, err := parseConfigFromNetmapContract(arr) + if err != nil { + return err + } + for k, v := range m { + for _, key := range netmapConfigKeys { + if k == key { + md[k] = v + break + } + } + } + return nil +} + func (c *initializeContext) getAlphabetDeployItems(i, n int) []any { items := make([]any, 5) items[0] = c.Contracts[netmapContract].Hash