mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
- 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)
32 lines
859 B
Go
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
|
|
}
|