[#1959] neofs-adm: Fix `set-config` for >4 nodes

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
remotes/fyrchik/fix-error-counter
Evgenii Stratonikov 2022-10-24 15:07:39 +03:00 committed by fyrchik
parent c87c3d3721
commit 6c21e2cc28
4 changed files with 17 additions and 4 deletions

View File

@ -132,7 +132,7 @@ func setConfigCmd(cmd *cobra.Command, args []string) error {
}
}
err = wCtx.sendCommitteeTx(bw.Bytes(), true)
err = wCtx.sendConsensusTx(bw.Bytes())
if err != nil {
return err
}

View File

@ -34,7 +34,7 @@ func forceNewEpochCmd(cmd *cobra.Command, args []string) error {
return err
}
if err := wCtx.sendMultiTx(bw.Bytes(), true, true); err != nil {
if err := wCtx.sendConsensusTx(bw.Bytes()); err != nil {
return err
}

View File

@ -381,13 +381,20 @@ loop:
return retErr
}
// sendCommitteeTx creates transaction from script and sends it to RPC.
// sendCommitteeTx creates transaction from script, signs it by committee nodes and sends it to RPC.
// If tryGroup is false, global scope is used for the signer (useful when
// working with native contracts).
func (c *initializeContext) sendCommitteeTx(script []byte, tryGroup bool) error {
return c.sendMultiTx(script, tryGroup, false)
}
// sendConsensusTx creates transaction from script, signs it by alphabet nodes and sends it to RPC.
// Not that because this is used only after the contracts were initialized and deployed,
// we always try to have a group scope.
func (c *initializeContext) sendConsensusTx(script []byte) error {
return c.sendMultiTx(script, true, true)
}
func (c *initializeContext) sendMultiTx(script []byte, tryGroup bool, withConsensus bool) error {
var act *actor.Actor
var err error

View File

@ -82,5 +82,11 @@ func testInitialize(t *testing.T, committeeSize int) {
v.Set(epochDurationInitFlag, 1)
v.Set(maxObjectSizeInitFlag, 1024)
require.NoError(t, initializeSideChainCmd(initCmd, nil))
require.NoError(t, forceNewEpochCmd(forceNewEpoch, nil))
t.Run("force-new-epoch", func(t *testing.T) {
require.NoError(t, forceNewEpochCmd(forceNewEpoch, nil))
})
t.Run("set-config", func(t *testing.T) {
require.NoError(t, setConfigCmd(setConfig, []string{"MaintenanceModeAllowed=true"}))
})
}