github.com/palisadeinc/bor@v0.0.0-20230615125219-ab7196213d15/consensus/bor/valset/error.go (about)

     1  package valset
     2  
     3  import "fmt"
     4  
     5  // TotalVotingPowerExceededError is returned when the maximum allowed total voting power is exceeded
     6  type TotalVotingPowerExceededError struct {
     7  	Sum        int64
     8  	Validators []*Validator
     9  }
    10  
    11  func (e *TotalVotingPowerExceededError) Error() string {
    12  	return fmt.Sprintf(
    13  		"Total voting power should be guarded to not exceed %v; got: %v; for validator set: %v",
    14  		MaxTotalVotingPower,
    15  		e.Sum,
    16  		e.Validators,
    17  	)
    18  }
    19  
    20  type InvalidStartEndBlockError struct {
    21  	Start         uint64
    22  	End           uint64
    23  	CurrentHeader uint64
    24  }
    25  
    26  func (e *InvalidStartEndBlockError) Error() string {
    27  	return fmt.Sprintf(
    28  		"Invalid parameters start: %d and end block: %d params",
    29  		e.Start,
    30  		e.End,
    31  	)
    32  }