adm: Fix dump-config output #1139

Closed
elebedeva wants to merge 1 commit from elebedeva:fix/ffs-adm-output into master
2 changed files with 10 additions and 1 deletions

View file

@ -61,7 +61,9 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig, case netmap.ContainerFeeConfig, netmap.ContainerAliasFeeConfig,
netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig, netmap.EpochDurationConfig, netmap.IrCandidateFeeConfig,
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig, netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig,
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig: netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig,
fyrchik marked this conversation as resolved
Review

The task was mostly about EC fields.
The others were intentionally deleted, as they are unused and thus are output in hex as the default format.

The task was mostly about EC fields. The others were intentionally deleted, as they are unused and thus are output in hex as the default format.
Review

Then there is no problem to fix, closing PR.

Then there is no problem to fix, closing PR.
netmap.EigenTrustIterationsConfig, netmap.BasicIncomeRateConfig,
netmap.AuditFeeConfig:
nbuf := make([]byte, 8) nbuf := make([]byte, 8)
copy(nbuf[:], v) copy(nbuf[:], v)
n := binary.LittleEndian.Uint64(nbuf) n := binary.LittleEndian.Uint64(nbuf)
@ -71,6 +73,9 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
return helper.InvalidConfigValueErr(k) return helper.InvalidConfigValueErr(k)
} }
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%t (bool)\n", k, v[0] == 1))) _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%t (bool)\n", k, v[0] == 1)))
case netmap.EigenTrustAlphaConfig:
res, _ := hex.DecodeString(hex.EncodeToString(v))
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (string)\n", k, res)))
default: default:
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (hex)\n", k, hex.EncodeToString(v)))) _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (hex)\n", k, hex.EncodeToString(v))))
} }

View file

@ -20,6 +20,10 @@ const (
WithdrawFeeConfig = "WithdrawFee" WithdrawFeeConfig = "WithdrawFee"
HomomorphicHashingDisabledKey = "HomomorphicHashingDisabled" HomomorphicHashingDisabledKey = "HomomorphicHashingDisabled"
MaintenanceModeAllowedConfig = "MaintenanceModeAllowed" MaintenanceModeAllowedConfig = "MaintenanceModeAllowed"
EigenTrustIterationsConfig = "EigenTrustIterations"
EigenTrustAlphaConfig = "EigenTrustAlpha"
BasicIncomeRateConfig = "BasicIncomeRate"
AuditFeeConfig = "AuditFee"
) )
// MaxObjectSize receives max object size configuration // MaxObjectSize receives max object size configuration