Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CalculatorsGen = make(map[string]FeeCalculatorGenerator)
View Source
var FixedFeeCalculatorGen = func(params param.FeeParam) FeeCalculator { if defaultParam, ok := params.(*param.FixedFeeParams); ok { if defaultParam.Fee <= 0 || defaultParam.FeeFor == types.FeeFree { return FreeFeeCalculator() } else { return FixedFeeCalculator(defaultParam.Fee, defaultParam.FeeFor) } } else { panic("Generator receive unexpected param type") } }
View Source
var Pool pool = newPool()
block level pool
Functions ¶
func RegisterCalculator ¶
func RegisterCalculator(msgType string, feeCalc FeeCalculator)
func UnsetAllCalculators ¶
func UnsetAllCalculators()
Types ¶
type FeeCalculator ¶
func FixedFeeCalculator ¶
func FixedFeeCalculator(amount int64, feeType types.FeeDistributeType) FeeCalculator
func FreeFeeCalculator ¶
func FreeFeeCalculator() FeeCalculator
func GetCalculator ¶
func GetCalculator(msgType string) FeeCalculator
type FeeCalculatorGenerator ¶
type FeeCalculatorGenerator func(params param.FeeParam) FeeCalculator
func GetCalculatorGenerator ¶
func GetCalculatorGenerator(msgType string) FeeCalculatorGenerator
Click to show internal directories.
Click to hide internal directories.