/
params.go
49 lines (41 loc) · 1.19 KB
/
params.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package types
import (
"github.com/KYVENetwork/chain/util"
)
const (
// DefaultMinFundingAmount 1000 Kyve
DefaultMinFundingAmount = uint64(1_000_000_000)
// DefaultMinFundingAmountPerBundle 0.1 Kyve
DefaultMinFundingAmountPerBundle = uint64(100_000)
// DefaultMinFundingMultiple 20
DefaultMinFundingMultiple = uint64(20)
)
// NewParams creates a new Params instance
func NewParams(minFundingAmount uint64, minFundingAmountPerBundle uint64, minFundingMultiple uint64) Params {
return Params{
MinFundingAmount: minFundingAmount,
MinFundingAmountPerBundle: minFundingAmountPerBundle,
MinFundingMultiple: minFundingMultiple,
}
}
// DefaultParams returns a default set of parameters
func DefaultParams() Params {
return NewParams(
DefaultMinFundingAmount,
DefaultMinFundingAmountPerBundle,
DefaultMinFundingMultiple,
)
}
// Validate validates the set of params
func (p *Params) Validate() error {
if err := util.ValidateNumber(p.MinFundingAmount); err != nil {
return err
}
if err := util.ValidateNumber(p.MinFundingAmountPerBundle); err != nil {
return err
}
if err := util.ValidateNumber(p.MinFundingAmountPerBundle); err != nil {
return err
}
return nil
}