diff --git a/cmd/neofs-ir/defaults.go b/cmd/neofs-ir/defaults.go index 58079e44..cb5f05f5 100644 --- a/cmd/neofs-ir/defaults.go +++ b/cmd/neofs-ir/defaults.go @@ -117,4 +117,8 @@ func defaultConfiguration(cfg *viper.Viper) { cfg.SetDefault("indexer.cache_timeout", 15*time.Second) cfg.SetDefault("locode.db.path", "") + + // extra fee values for working mode without notary contract + cfg.SetDefault("fee.main_chain", 5000_0000) // 0.5 Fixed8 + cfg.SetDefault("fee.side_chain", 2_0000_0000) // 2.0 Fixed8 } diff --git a/pkg/innerring/config/fee.go b/pkg/innerring/config/fee.go new file mode 100644 index 00000000..f448f1ba --- /dev/null +++ b/pkg/innerring/config/fee.go @@ -0,0 +1,27 @@ +package config + +import ( + "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" + "github.com/spf13/viper" +) + +// FeeConfig is an instance that returns extra fee values for contract +// invocations without notary support. +type FeeConfig struct { + mainchain, sidechain fixedn.Fixed8 +} + +func NewFeeConfig(v *viper.Viper) *FeeConfig { + return &FeeConfig{ + mainchain: fixedn.Fixed8(v.GetInt64("fee.main_chain")), + sidechain: fixedn.Fixed8(v.GetInt64("fee.side_chain")), + } +} + +func (f FeeConfig) MainChainFee() fixedn.Fixed8 { + return f.mainchain +} + +func (f FeeConfig) SideChainFee() fixedn.Fixed8 { + return f.sidechain +}