gecko/vms/secp256k1fx/vm.go

34 lines
761 B
Go
Raw Normal View History

2020-03-10 12:20:34 -07:00
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package secp256k1fx
import (
2020-03-29 22:08:45 -07:00
"github.com/ava-labs/gecko/utils/logging"
2020-03-10 12:20:34 -07:00
"github.com/ava-labs/gecko/utils/timer"
"github.com/ava-labs/gecko/vms/components/codec"
)
// VM that this Fx must be run by
type VM interface {
Codec() codec.Codec
Clock() *timer.Clock
2020-03-29 22:08:45 -07:00
Logger() logging.Logger
2020-03-10 12:20:34 -07:00
}
2020-03-30 13:23:06 -07:00
// TestVM is a minimal implementation of a VM
type TestVM struct {
CLK *timer.Clock
Code codec.Codec
Log logging.Logger
}
// Clock returns CLK
func (vm *TestVM) Clock() *timer.Clock { return vm.CLK }
// Codec returns Code
func (vm *TestVM) Codec() codec.Codec { return vm.Code }
// Logger returns Log
func (vm *TestVM) Logger() logging.Logger { return vm.Log }