mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
fix: break import cycle by defining State locally in interfaces
Remove dependency on github.com/luxfi/vm to break the cycle: - consensus/engine/interfaces -> vm -> consensus/engine/chain/block - Define State type and constants directly in interfaces package
This commit is contained in:
@@ -7,23 +7,21 @@ package interfaces
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/luxfi/vm"
|
||||
)
|
||||
|
||||
// State is an alias to vm.State
|
||||
type State = vm.State
|
||||
// State represents the operational state of a VM or consensus engine.
|
||||
type State uint8
|
||||
|
||||
// Re-export State constants from vm package
|
||||
// State constants for VM lifecycle
|
||||
const (
|
||||
Unknown = vm.Unknown
|
||||
Starting = vm.Starting
|
||||
Syncing = vm.Syncing
|
||||
Bootstrapping = vm.Bootstrapping
|
||||
Ready = vm.Ready
|
||||
Degraded = vm.Degraded
|
||||
Stopping = vm.Stopping
|
||||
Stopped = vm.Stopped
|
||||
Unknown State = iota // Unknown state
|
||||
Starting // VM is starting up
|
||||
Syncing // VM is syncing state
|
||||
Bootstrapping // VM is bootstrapping
|
||||
Ready // VM is ready for normal operation
|
||||
Degraded // VM is degraded but operational
|
||||
Stopping // VM is shutting down
|
||||
Stopped // VM has stopped
|
||||
)
|
||||
|
||||
// Engine defines the consensus engine interface
|
||||
|
||||
Reference in New Issue
Block a user