Files
zeekayandHanzo Dev f993831e33 The test suite compiles, and 246 tests run where 159 did
Six packages would not build, each from a migration that stopped one step
short, and a package that does not compile reports nothing at all.

The generated mocks had fallen behind their interfaces: Manager kept four of
its eight methods, Server was missing SetRootInfoProvider, and there was no
Factory mock under the name the tests used. All three are regenerated, and
each package now carries the go:generate line that produces them, so a
method added to an interface is a regeneration away rather than a puzzle in
another package's tests.

The interfaces had also taken a context that the expectations had not, so
forty-six of them name it now. Aliases and the level test followed their
types: the standalone atomic package rather than the compatibility
re-export, and log's own Level constants beside the field that holds one.
One table field was renamed in every place but the line that read it.

Two services lost a behaviour along the way. Registration aliases every VM
to its own id, and both GetVMs and LoadVMs handed that back as an alias of
itself, which the tests had said all along they should not; and both read
their context from a request the tests passed as nil, which segfaulted
before a single expectation could run.

chains/atomic still fails, deliberately: its fixture asserts a big-endian
wire layout "so any on-disk record from the legacy build still parses", and
luxfi/util's packer moved to little-endian on purpose. Which side gives is a
question about records already on disk, not about this test.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-17 22:03:36 -07:00

162 lines
5.2 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/luxfi/vm/manager (interfaces: Manager)
//
// Generated by this command:
//
// mockgen -package=managermock -destination=managermock/manager.go -mock_names=Manager=Manager . Manager
//
// Package managermock is a generated GoMock package.
package managermock
import (
context "context"
reflect "reflect"
ids "github.com/luxfi/ids"
manager "github.com/luxfi/vm/manager"
gomock "go.uber.org/mock/gomock"
)
// Manager is a mock of Manager interface.
type Manager struct {
ctrl *gomock.Controller
recorder *ManagerMockRecorder
isgomock struct{}
}
// ManagerMockRecorder is the mock recorder for Manager.
type ManagerMockRecorder struct {
mock *Manager
}
// NewManager creates a new mock instance.
func NewManager(ctrl *gomock.Controller) *Manager {
mock := &Manager{ctrl: ctrl}
mock.recorder = &ManagerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *Manager) EXPECT() *ManagerMockRecorder {
return m.recorder
}
// Alias mocks base method.
func (m *Manager) Alias(ctx context.Context, vmID ids.ID, alias string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Alias", ctx, vmID, alias)
ret0, _ := ret[0].(error)
return ret0
}
// Alias indicates an expected call of Alias.
func (mr *ManagerMockRecorder) Alias(ctx, vmID, alias any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Alias", reflect.TypeOf((*Manager)(nil).Alias), ctx, vmID, alias)
}
// Aliases mocks base method.
func (m *Manager) Aliases(ctx context.Context, vmID ids.ID) ([]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Aliases", ctx, vmID)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Aliases indicates an expected call of Aliases.
func (mr *ManagerMockRecorder) Aliases(ctx, vmID any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Aliases", reflect.TypeOf((*Manager)(nil).Aliases), ctx, vmID)
}
// GetFactory mocks base method.
func (m *Manager) GetFactory(ctx context.Context, vmID ids.ID) (manager.Factory, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetFactory", ctx, vmID)
ret0, _ := ret[0].(manager.Factory)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// GetFactory indicates an expected call of GetFactory.
func (mr *ManagerMockRecorder) GetFactory(ctx, vmID any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFactory", reflect.TypeOf((*Manager)(nil).GetFactory), ctx, vmID)
}
// ListFactories mocks base method.
func (m *Manager) ListFactories(ctx context.Context) ([]ids.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "ListFactories", ctx)
ret0, _ := ret[0].([]ids.ID)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// ListFactories indicates an expected call of ListFactories.
func (mr *ManagerMockRecorder) ListFactories(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListFactories", reflect.TypeOf((*Manager)(nil).ListFactories), ctx)
}
// Lookup mocks base method.
func (m *Manager) Lookup(ctx context.Context, alias string) (ids.ID, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Lookup", ctx, alias)
ret0, _ := ret[0].(ids.ID)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Lookup indicates an expected call of Lookup.
func (mr *ManagerMockRecorder) Lookup(ctx, alias any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Lookup", reflect.TypeOf((*Manager)(nil).Lookup), ctx, alias)
}
// PrimaryAlias mocks base method.
func (m *Manager) PrimaryAlias(ctx context.Context, vmID ids.ID) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PrimaryAlias", ctx, vmID)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// PrimaryAlias indicates an expected call of PrimaryAlias.
func (mr *ManagerMockRecorder) PrimaryAlias(ctx, vmID any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PrimaryAlias", reflect.TypeOf((*Manager)(nil).PrimaryAlias), ctx, vmID)
}
// RegisterFactory mocks base method.
func (m *Manager) RegisterFactory(ctx context.Context, vmID ids.ID, factory manager.Factory) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "RegisterFactory", ctx, vmID, factory)
ret0, _ := ret[0].(error)
return ret0
}
// RegisterFactory indicates an expected call of RegisterFactory.
func (mr *ManagerMockRecorder) RegisterFactory(ctx, vmID, factory any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterFactory", reflect.TypeOf((*Manager)(nil).RegisterFactory), ctx, vmID, factory)
}
// Versions mocks base method.
func (m *Manager) Versions(ctx context.Context) (map[string]string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Versions", ctx)
ret0, _ := ret[0].(map[string]string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// Versions indicates an expected call of Versions.
func (mr *ManagerMockRecorder) Versions(ctx any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Versions", reflect.TypeOf((*Manager)(nil).Versions), ctx)
}