[#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:
parent
863633e6a5
commit
8ea5744326
4 changed files with 10 additions and 9 deletions
|
@ -67,7 +67,7 @@ func (gp *Processor) processAlphabetSync() {
|
||||||
sort.Sort(newInnerRing)
|
sort.Sort(newInnerRing)
|
||||||
|
|
||||||
if gp.notaryDisabled {
|
if gp.notaryDisabled {
|
||||||
err = gp.netmapClient.SetInnerRing(newInnerRing)
|
err = gp.netmapClient.UpdateInnerRing(newInnerRing)
|
||||||
} else {
|
} else {
|
||||||
err = gp.morphClient.UpdateNeoFSAlphabetList(newInnerRing)
|
err = gp.morphClient.UpdateNeoFSAlphabetList(newInnerRing)
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ type cfg struct {
|
||||||
epochSnapshotMethod, // get network map snapshot by epoch method name
|
epochSnapshotMethod, // get network map snapshot by epoch method name
|
||||||
updateStateMethod, // update state method name for invocation
|
updateStateMethod, // update state method name for invocation
|
||||||
epochMethod, // get epoch number method name
|
epochMethod, // get epoch number method name
|
||||||
setInnerRing, // set inner ring method name
|
updateInnerRing, // update innerring method name
|
||||||
setConfigMethod, // set config method name
|
setConfigMethod, // set config method name
|
||||||
configMethod string // get config value method name
|
configMethod string // get config value method name
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ const (
|
||||||
defaultNetMapMethod = "netmap" // default get network map method name
|
defaultNetMapMethod = "netmap" // default get network map method name
|
||||||
defaultNewEpochMethod = "newEpoch" // default new epoch method name
|
defaultNewEpochMethod = "newEpoch" // default new epoch method name
|
||||||
defaultSetConfigMethod = "setConfig" // default get config value 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
|
defaultSnapshotMethod = "snapshot" // default get network map snapshot method name
|
||||||
defaultUpdateStateMethod = "updateState" // default update state method name
|
defaultUpdateStateMethod = "updateState" // default update state method name
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ func defaultConfig() *cfg {
|
||||||
setConfigMethod: defaultSetConfigMethod,
|
setConfigMethod: defaultSetConfigMethod,
|
||||||
snapshotMethod: defaultSnapshotMethod,
|
snapshotMethod: defaultSnapshotMethod,
|
||||||
updateStateMethod: defaultUpdateStateMethod,
|
updateStateMethod: defaultUpdateStateMethod,
|
||||||
|
updateInnerRing: defaultUpdateInnerRingMethod,
|
||||||
epochSnapshotMethod: defaultEpochSnapshotMethod,
|
epochSnapshotMethod: defaultEpochSnapshotMethod,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,14 @@ import (
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetInnerRing updates inner ring members in netmap contract.
|
// UpdateInnerRing updates inner ring members in netmap contract.
|
||||||
func (c *Client) SetInnerRing(keys keys.PublicKeys) error {
|
func (c *Client) UpdateInnerRing(keys keys.PublicKeys) error {
|
||||||
args := make([][]byte, len(keys))
|
args := make([][]byte, len(keys))
|
||||||
for i := range args {
|
for i := range args {
|
||||||
args[i] = keys[i].Bytes()
|
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
|
// InnerRingList returns public keys of inner ring members in
|
||||||
|
|
|
@ -2,9 +2,9 @@ package wrapper
|
||||||
|
|
||||||
import "github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
import "github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||||
|
|
||||||
// SetInnerRing updates inner ring keys.
|
// UpdateInnerRing updates inner ring keys.
|
||||||
func (w *Wrapper) SetInnerRing(keys keys.PublicKeys) error {
|
func (w *Wrapper) UpdateInnerRing(keys keys.PublicKeys) error {
|
||||||
return w.client.SetInnerRing(keys)
|
return w.client.UpdateInnerRing(keys)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInnerRingList return current IR list.
|
// GetInnerRingList return current IR list.
|
||||||
|
|
Loading…
Reference in a new issue