Files
platformvm/factory_patch.go
zeekay ede37547f6 refactor(platformvm): consolidate block code, drop atomic_block, add v0 lift
- Drop atomic_block.go + legacy *_block_test.go (consolidated)
- Add block/v0/ subdir + lift_v0.go for old version handling
- Copyright header: 'Lux Industries, Inc.' → 'Lux Industries Inc' (no comma)
- block_adapter.go: new adapter layer
2026-06-01 15:22:27 -07:00

50 lines
1.6 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//go:build singlevalidator
package platformvm
import (
"github.com/luxfi/ids"
"github.com/luxfi/node/vms"
"github.com/luxfi/version"
)
// SingleValidatorFactory creates a mock Platform VM for single validator mode
type SingleValidatorFactory struct{}
func (f *SingleValidatorFactory) New(vms.Config) (interface{}, error) {
// Return a minimal implementation that doesn't require multiple validators
return &singleValidatorVM{}, nil
}
type singleValidatorVM struct{}
func (vm *singleValidatorVM) Initialize(
ctx interface{},
dbManager interface{},
genesisBytes []byte,
upgradeBytes []byte,
configBytes []byte,
msgChan chan interface{},
fxs []interface{},
appSender interface{},
) error {
// Initialize with single validator mode
return nil
}
func (vm *singleValidatorVM) Bootstrapping() error { return nil }
func (vm *singleValidatorVM) Bootstrapped() error { return nil }
func (vm *singleValidatorVM) Shutdown() error { return nil }
func (vm *singleValidatorVM) Version() (string, error) { return "single-validator-1.0", nil }
func (vm *singleValidatorVM) CreateHandlers() (map[string]interface{}, error) {
return map[string]interface{}{}, nil
}
func (vm *singleValidatorVM) CreateStaticHandlers() (map[string]interface{}, error) {
return map[string]interface{}{}, nil
}
func (vm *singleValidatorVM) Connected(ids.NodeID, *version.Application) error { return nil }
func (vm *singleValidatorVM) Disconnected(ids.NodeID) error { return nil }