github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/builder/consensus/config.go (about)

     1  package consensus
     2  
     3  import (
     4  	"github.com/onflow/flow-go/state/protocol"
     5  )
     6  
     7  type Config struct {
     8  	blockTimer protocol.BlockTimer
     9  	// the max number of seals to be included in a block proposal
    10  	maxSealCount      uint
    11  	maxGuaranteeCount uint
    12  	maxReceiptCount   uint
    13  	expiry            uint
    14  }
    15  
    16  func WithBlockTimer(timer protocol.BlockTimer) func(*Config) {
    17  	return func(cfg *Config) {
    18  		cfg.blockTimer = timer
    19  	}
    20  }
    21  
    22  func WithMaxSealCount(maxSealCount uint) func(*Config) {
    23  	return func(cfg *Config) {
    24  		cfg.maxSealCount = maxSealCount
    25  	}
    26  }
    27  
    28  func WithMaxGuaranteeCount(maxGuaranteeCount uint) func(*Config) {
    29  	return func(cfg *Config) {
    30  		cfg.maxGuaranteeCount = maxGuaranteeCount
    31  	}
    32  }
    33  
    34  func WithMaxReceiptCount(maxReceiptCount uint) func(*Config) {
    35  	return func(cfg *Config) {
    36  		cfg.maxReceiptCount = maxReceiptCount
    37  	}
    38  }