forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 4
/
vm.go
38 lines (30 loc) · 795 Bytes
/
vm.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package secp256k1fx
import (
"github.com/MetalBlockchain/metalgo/codec"
"github.com/MetalBlockchain/metalgo/utils/logging"
"github.com/MetalBlockchain/metalgo/utils/timer/mockable"
)
// VM that this Fx must be run by
type VM interface {
CodecRegistry() codec.Registry
Clock() *mockable.Clock
Logger() logging.Logger
}
var _ VM = (*TestVM)(nil)
// TestVM is a minimal implementation of a VM
type TestVM struct {
Clk mockable.Clock
Codec codec.Registry
Log logging.Logger
}
func (vm *TestVM) Clock() *mockable.Clock {
return &vm.Clk
}
func (vm *TestVM) CodecRegistry() codec.Registry {
return vm.Codec
}
func (vm *TestVM) Logger() logging.Logger {
return vm.Log
}