[#1167] adm/morph: Move literal to const

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2024-06-07 16:33:03 +03:00
parent 4331bd1143
commit a9b93676e0

View file

@ -137,6 +137,8 @@ func SetConfigCmd(cmd *cobra.Command, args []string) error {
return wCtx.AwaitTx()
}
const maxECSum = 256
func validateConfig(args map[string]any, forceFlag bool) error {
var sumEC int64
_, okData := args[netmap.MaxECDataCountConfig]
@ -172,9 +174,9 @@ func validateConfig(args map[string]any, forceFlag bool) error {
}
}
if sumEC > 256 && !forceFlag {
return fmt.Errorf("the sum of %s and %s must be <= 256, got %d",
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig, sumEC)
if sumEC > maxECSum && !forceFlag {
return fmt.Errorf("the sum of %s and %s must be <= %d, got %d",
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig, maxECSum, sumEC)
}
return nil
}