1f3bb33db8
When notary disabled, inner ring should be able to configure extra fee for vote collections inside the contracts. Previously these values were hardcoded, however we might want to change them depending on a environment. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
27 lines
612 B
Go
27 lines
612 B
Go
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
|
|
}
|