mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
- 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
25 lines
698 B
Go
25 lines
698 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
//go:build !cgo
|
|
// +build !cgo
|
|
|
|
package engine
|
|
|
|
// ConsensusFactory creates the appropriate consensus implementation
|
|
// This is the pure Go version when CGO is disabled
|
|
type ConsensusFactory struct{}
|
|
|
|
// NewConsensusFactory creates a new consensus factory
|
|
func NewConsensusFactory() *ConsensusFactory {
|
|
return &ConsensusFactory{}
|
|
}
|
|
|
|
// CreateConsensus creates a consensus engine instance
|
|
func (f *ConsensusFactory) CreateConsensus(params ConsensusParams) (Consensus, error) {
|
|
// Use pure Go implementation when CGO is disabled
|
|
return &PureGoConsensus{
|
|
params: params,
|
|
}, nil
|
|
}
|