forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vm.go
30 lines (24 loc) · 784 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
// Copyright (C) 2019-2022, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package secp256k1fx
import (
"github.com/dim4egster/qmallgo/codec"
"github.com/dim4egster/qmallgo/utils/logging"
"github.com/dim4egster/qmallgo/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{}
// 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 }