forked from TrueCloudLab/frostfs-node
[#873] node: Delete useless notary deposit Amount
, Duration
envs
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
8374c3d2f5
commit
2f2258733b
5 changed files with 0 additions and 51 deletions
|
@ -4,7 +4,6 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
|
||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
|
||||
)
|
||||
|
||||
|
@ -66,39 +65,3 @@ func DialTimeout(c *config.Config) time.Duration {
|
|||
func DisableCache(c *config.Config) bool {
|
||||
return config.BoolSafe(c.Sub(subsection), "disable_cache")
|
||||
}
|
||||
|
||||
// NotaryConfig is a wrapper over the config section
|
||||
// which provides access to notary configurations
|
||||
// of the side chain.
|
||||
type NotaryConfig struct {
|
||||
cfg *config.Config
|
||||
}
|
||||
|
||||
// Notary returns structure that provides access to "notary"
|
||||
// subsection of "morph" section.
|
||||
func Notary(c *config.Config) *NotaryConfig {
|
||||
return &NotaryConfig{
|
||||
cfg: c.Sub(subsection).Sub(notarySubsection),
|
||||
}
|
||||
}
|
||||
|
||||
// Amount returns value of "deposit_amount" config parameter.
|
||||
//
|
||||
// Returns NotaryDepositAmountDefault if value is not positive amount.
|
||||
func (n NotaryConfig) Amount() fixedn.Fixed8 {
|
||||
v := config.UintSafe(n.cfg, "deposit_amount")
|
||||
if v > 0 {
|
||||
return fixedn.Fixed8(v)
|
||||
}
|
||||
|
||||
return fixedn.Fixed8(NotaryDepositAmountDefault)
|
||||
}
|
||||
|
||||
func (n NotaryConfig) Duration() uint32 {
|
||||
v := config.Uint32Safe(n.cfg, "deposit_duration")
|
||||
if v > 0 {
|
||||
return v
|
||||
}
|
||||
|
||||
return NotaryDepositDurationDefault
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue