mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
33 lines
505 B
Go
33 lines
505 B
Go
package choices
|
|
|
|
// Status represents the status of a block
|
|
type Status uint8
|
|
|
|
const (
|
|
Unknown Status = iota
|
|
Processing
|
|
Rejected
|
|
Accepted
|
|
)
|
|
|
|
// String returns string representation
|
|
func (s Status) String() string {
|
|
switch s {
|
|
case Unknown:
|
|
return "Unknown"
|
|
case Processing:
|
|
return "Processing"
|
|
case Rejected:
|
|
return "Rejected"
|
|
case Accepted:
|
|
return "Accepted"
|
|
default:
|
|
return "Invalid"
|
|
}
|
|
}
|
|
|
|
// Decidable represents a block that can be decided
|
|
type Decidable struct {
|
|
Status Status
|
|
}
|