mirror of
https://github.com/luxfi/vm.git
synced 2026-10-30 15:13:40 +00:00
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]>
162 lines
5.4 KiB
Go
162 lines
5.4 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: github.com/luxfi/vm/api/server (interfaces: Server)
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -package=server -destination=api/server/mock_server.go github.com/luxfi/vm/api/server Server
|
|
//
|
|
|
|
// Package server is a generated GoMock package.
|
|
package server
|
|
|
|
import (
|
|
http "net/http"
|
|
reflect "reflect"
|
|
|
|
runtime "github.com/luxfi/runtime"
|
|
vm "github.com/luxfi/vm"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockServer is a mock of Server interface.
|
|
type MockServer struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockServerMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockServerMockRecorder is the mock recorder for MockServer.
|
|
type MockServerMockRecorder struct {
|
|
mock *MockServer
|
|
}
|
|
|
|
// NewMockServer creates a new mock instance.
|
|
func NewMockServer(ctrl *gomock.Controller) *MockServer {
|
|
mock := &MockServer{ctrl: ctrl}
|
|
mock.recorder = &MockServerMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockServer) EXPECT() *MockServerMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// AddAliases mocks base method.
|
|
func (m *MockServer) AddAliases(endpoint string, aliases ...string) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{endpoint}
|
|
for _, a := range aliases {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "AddAliases", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// AddAliases indicates an expected call of AddAliases.
|
|
func (mr *MockServerMockRecorder) AddAliases(endpoint any, aliases ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{endpoint}, aliases...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliases", reflect.TypeOf((*MockServer)(nil).AddAliases), varargs...)
|
|
}
|
|
|
|
// AddAliasesWithReadLock mocks base method.
|
|
func (m *MockServer) AddAliasesWithReadLock(endpoint string, aliases ...string) error {
|
|
m.ctrl.T.Helper()
|
|
varargs := []any{endpoint}
|
|
for _, a := range aliases {
|
|
varargs = append(varargs, a)
|
|
}
|
|
ret := m.ctrl.Call(m, "AddAliasesWithReadLock", varargs...)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// AddAliasesWithReadLock indicates an expected call of AddAliasesWithReadLock.
|
|
func (mr *MockServerMockRecorder) AddAliasesWithReadLock(endpoint any, aliases ...any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
varargs := append([]any{endpoint}, aliases...)
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAliasesWithReadLock", reflect.TypeOf((*MockServer)(nil).AddAliasesWithReadLock), varargs...)
|
|
}
|
|
|
|
// AddRoute mocks base method.
|
|
func (m *MockServer) AddRoute(handler http.Handler, base, endpoint string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "AddRoute", handler, base, endpoint)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// AddRoute indicates an expected call of AddRoute.
|
|
func (mr *MockServerMockRecorder) AddRoute(handler, base, endpoint any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRoute", reflect.TypeOf((*MockServer)(nil).AddRoute), handler, base, endpoint)
|
|
}
|
|
|
|
// AddRouteWithReadLock mocks base method.
|
|
func (m *MockServer) AddRouteWithReadLock(handler http.Handler, base, endpoint string) error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "AddRouteWithReadLock", handler, base, endpoint)
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// AddRouteWithReadLock indicates an expected call of AddRouteWithReadLock.
|
|
func (mr *MockServerMockRecorder) AddRouteWithReadLock(handler, base, endpoint any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRouteWithReadLock", reflect.TypeOf((*MockServer)(nil).AddRouteWithReadLock), handler, base, endpoint)
|
|
}
|
|
|
|
// Dispatch mocks base method.
|
|
func (m *MockServer) Dispatch() error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Dispatch")
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Dispatch indicates an expected call of Dispatch.
|
|
func (mr *MockServerMockRecorder) Dispatch() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Dispatch", reflect.TypeOf((*MockServer)(nil).Dispatch))
|
|
}
|
|
|
|
// RegisterChain mocks base method.
|
|
func (m *MockServer) RegisterChain(chainName string, rt *runtime.Runtime, arg2 vm.VM) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "RegisterChain", chainName, rt, arg2)
|
|
}
|
|
|
|
// RegisterChain indicates an expected call of RegisterChain.
|
|
func (mr *MockServerMockRecorder) RegisterChain(chainName, rt, arg2 any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterChain", reflect.TypeOf((*MockServer)(nil).RegisterChain), chainName, rt, arg2)
|
|
}
|
|
|
|
// SetRootInfoProvider mocks base method.
|
|
func (m *MockServer) SetRootInfoProvider(provider RootInfoProvider) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "SetRootInfoProvider", provider)
|
|
}
|
|
|
|
// SetRootInfoProvider indicates an expected call of SetRootInfoProvider.
|
|
func (mr *MockServerMockRecorder) SetRootInfoProvider(provider any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetRootInfoProvider", reflect.TypeOf((*MockServer)(nil).SetRootInfoProvider), provider)
|
|
}
|
|
|
|
// Shutdown mocks base method.
|
|
func (m *MockServer) Shutdown() error {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Shutdown")
|
|
ret0, _ := ret[0].(error)
|
|
return ret0
|
|
}
|
|
|
|
// Shutdown indicates an expected call of Shutdown.
|
|
func (mr *MockServerMockRecorder) Shutdown() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Shutdown", reflect.TypeOf((*MockServer)(nil).Shutdown))
|
|
}
|