forked from onflow/flow-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
40 lines (33 loc) · 865 Bytes
/
config.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
// (c) 2019 Dapper Labs - ALL RIGHTS RESERVED
package consensus
import (
"github.com/onflow/flow-go/state/protocol"
)
type Config struct {
blockTimer protocol.BlockTimer
// the max number of seals to be included in a block proposal
maxSealCount uint
maxGuaranteeCount uint
maxReceiptCount uint
expiry uint
}
func WithBlockTimer(timer protocol.BlockTimer) func(*Config) {
return func(cfg *Config) {
cfg.blockTimer = timer
}
}
func WithMaxSealCount(maxSealCount uint) func(*Config) {
return func(cfg *Config) {
cfg.maxSealCount = maxSealCount
}
}
func WithMaxGuaranteeCount(maxGuaranteeCount uint) func(*Config) {
return func(cfg *Config) {
cfg.maxGuaranteeCount = maxGuaranteeCount
}
}
func WithMaxReceiptCount(maxReceiptCount uint) func(*Config) {
return func(cfg *Config) {
cfg.maxReceiptCount = maxReceiptCount
}
}