Files
coreth/plugin/evm/factory.go
zeekay f70bac500d refactor: migrate to vm/rpc/chain, remove node dependency from production code
- Update import from vm/rpcchainvm to vm/rpc/chain
- Update vm dependency to v1.0.18
- node dependency now test-only (platformvm.NewClient for warp tests)
2026-01-11 21:38:33 -08:00

32 lines
859 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package evm
import (
log "github.com/luxfi/log"
"github.com/luxfi/timer/mockable"
"github.com/luxfi/coreth/plugin/evm/extension"
"github.com/luxfi/coreth/plugin/evm/message"
)
// Factory is used to create a new VM instance
type Factory struct{}
// New returns a new EVM instance
func (f *Factory) New(logger log.Logger) (interface{}, error) {
vm := &VM{}
// Set default extension config with required fields
// This can be overridden by SetExtensionConfig before Initialize
defaultConfig := &extension.Config{
SyncSummaryProvider: &message.BlockSyncSummaryProvider{},
SyncableParser: message.NewBlockSyncSummaryParser(),
Clock: &mockable.Clock{},
}
vm.extensionConfig = defaultConfig
return vm, nil
}