[#705] pkg/morph/netmap: Fix updateInnerRing method

Add initialization of `updateInnerRing` method name
in config on startup.
Rename var `setInnerRing` => `updateInnerRing`.
Rename method `SetInnerRing` => `UpdateInnerRing`

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-07-21 12:24:14 +03:00 committed by Alex Vanin
parent 863633e6a5
commit 8ea5744326
4 changed files with 10 additions and 9 deletions

View file

@ -67,7 +67,7 @@ func (gp *Processor) processAlphabetSync() {
sort.Sort(newInnerRing)
if gp.notaryDisabled {
err = gp.netmapClient.SetInnerRing(newInnerRing)
err = gp.netmapClient.UpdateInnerRing(newInnerRing)
} else {
err = gp.morphClient.UpdateNeoFSAlphabetList(newInnerRing)
}

View file

@ -40,7 +40,7 @@ type cfg struct {
epochSnapshotMethod, // get network map snapshot by epoch method name
updateStateMethod, // update state method name for invocation
epochMethod, // get epoch number method name
setInnerRing, // set inner ring method name
updateInnerRing, // update innerring method name
setConfigMethod, // set config method name
configMethod string // get config value method name
}
@ -54,7 +54,7 @@ const (
defaultNetMapMethod = "netmap" // default get network map method name
defaultNewEpochMethod = "newEpoch" // default new epoch method name
defaultSetConfigMethod = "setConfig" // default get config value method name
defaultSetInnerRingMethod = "updateInnerRing" // default set innerring method name
defaultUpdateInnerRingMethod = "updateInnerRing" // default update innerring method name
defaultSnapshotMethod = "snapshot" // default get network map snapshot method name
defaultUpdateStateMethod = "updateState" // default update state method name
@ -73,6 +73,7 @@ func defaultConfig() *cfg {
setConfigMethod: defaultSetConfigMethod,
snapshotMethod: defaultSnapshotMethod,
updateStateMethod: defaultUpdateStateMethod,
updateInnerRing: defaultUpdateInnerRingMethod,
epochSnapshotMethod: defaultEpochSnapshotMethod,
}
}

View file

@ -9,14 +9,14 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
)
// SetInnerRing updates inner ring members in netmap contract.
func (c *Client) SetInnerRing(keys keys.PublicKeys) error {
// UpdateInnerRing updates inner ring members in netmap contract.
func (c *Client) UpdateInnerRing(keys keys.PublicKeys) error {
args := make([][]byte, len(keys))
for i := range args {
args[i] = keys[i].Bytes()
}
return c.client.Invoke(c.setInnerRing, args)
return c.client.Invoke(c.updateInnerRing, args)
}
// InnerRingList returns public keys of inner ring members in

View file

@ -2,9 +2,9 @@ package wrapper
import "github.com/nspcc-dev/neo-go/pkg/crypto/keys"
// SetInnerRing updates inner ring keys.
func (w *Wrapper) SetInnerRing(keys keys.PublicKeys) error {
return w.client.SetInnerRing(keys)
// UpdateInnerRing updates inner ring keys.
func (w *Wrapper) UpdateInnerRing(keys keys.PublicKeys) error {
return w.client.UpdateInnerRing(keys)
}
// GetInnerRingList return current IR list.