github.com/koko1123/flow-go-1@v0.29.6/module/builder/consensus/config.go (about)

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