Files
consensus/engine/interfaces/interfaces.go
T
zeekay 4aac78700d Refactor: remove dead code, add thread safety, improve test coverage
- Remove unused packages: engine/dag/{getter,bootstrap,vertex/vertexmock},
  engine/pq/{bootstrap,block}, core/{tracker,verify}
- Add sync.RWMutex to protocol/wave for thread-safe map access
- Increase engine/dag test coverage from 11.7% to 98.3%
- Add comprehensive tests for DAG consensus, vertex, and engine
- All 27 packages pass tests, 16 at 100% coverage
2025-12-13 07:42:01 +00:00

43 lines
834 B
Go

package interfaces
import (
"context"
"github.com/luxfi/ids"
)
// Engine defines the consensus engine interface
type Engine interface {
// Start starts the engine
Start(context.Context, uint32) error
// Stop stops the engine
Stop(context.Context) error
// HealthCheck performs health check
HealthCheck(context.Context) (interface{}, error)
// IsBootstrapped checks if bootstrapped
IsBootstrapped() bool
}
// VM defines a virtual machine
type VM interface {
// Initialize initializes the VM
Initialize(context.Context, *VMConfig) error
// Shutdown shuts down the VM
Shutdown(context.Context) error
// Version returns VM version
Version(context.Context) (string, error)
}
// VMConfig defines VM configuration
type VMConfig struct {
ChainID ids.ID
NetworkID uint32
NodeID ids.NodeID
PublicKey []byte
}