[#100] adm: Use netmap constants from pkg
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-04-11 14:59:24 +03:00 committed by fyrchik
parent 0c6aeaaf18
commit 299b6a6938
4 changed files with 78 additions and 88 deletions

View file

@ -3,24 +3,25 @@ package morph
import (
"errors"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
"github.com/spf13/viper"
)
func getDefaultNetmapContractConfigMap() map[string]any {
m := make(map[string]any)
m[netmapEpochKey] = viper.GetInt64(epochDurationInitFlag)
m[netmapMaxObjectSizeKey] = viper.GetInt64(maxObjectSizeInitFlag)
m[netmapAuditFeeKey] = viper.GetInt64(auditFeeInitFlag)
m[netmapContainerFeeKey] = viper.GetInt64(containerFeeInitFlag)
m[netmapContainerAliasFeeKey] = viper.GetInt64(containerAliasFeeInitFlag)
m[netmapEigenTrustIterationsKey] = int64(defaultEigenTrustIterations)
m[netmapEigenTrustAlphaKey] = defaultEigenTrustAlpha
m[netmapBasicIncomeRateKey] = viper.GetInt64(incomeRateInitFlag)
m[netmapInnerRingCandidateFeeKey] = viper.GetInt64(candidateFeeInitFlag)
m[netmapWithdrawFeeKey] = viper.GetInt64(withdrawFeeInitFlag)
m[netmapHomomorphicHashDisabledKey] = viper.GetBool(homomorphicHashDisabledInitFlag)
m[netmapMaintenanceAllowedKey] = viper.GetBool(maintenanceModeAllowedInitFlag)
m[netmap.EpochDurationConfig] = viper.GetInt64(epochDurationInitFlag)
m[netmap.MaxObjectSizeConfig] = viper.GetInt64(maxObjectSizeInitFlag)
m[netmap.AuditFeeConfig] = viper.GetInt64(auditFeeInitFlag)
m[netmap.ContainerFeeConfig] = viper.GetInt64(containerFeeInitFlag)
m[netmap.ContainerAliasFeeConfig] = viper.GetInt64(containerAliasFeeInitFlag)
m[netmap.EtIterationsConfig] = int64(defaultEigenTrustIterations)
m[netmap.EtAlphaConfig] = defaultEigenTrustAlpha
m[netmap.BasicIncomeRateConfig] = viper.GetInt64(incomeRateInitFlag)
m[netmap.IrCandidateFeeConfig] = viper.GetInt64(candidateFeeInitFlag)
m[netmap.WithdrawFeeConfig] = viper.GetInt64(withdrawFeeInitFlag)
m[netmap.HomomorphicHashingDisabledKey] = viper.GetBool(homomorphicHashDisabledInitFlag)
m[netmap.MaintenanceModeAllowedConfig] = viper.GetBool(maintenanceModeAllowedInitFlag)
return m
}