From a5ac1deb791d34612be9ec033b0fed002226143e Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Mon, 4 Mar 2024 14:07:16 -0500 Subject: [PATCH] fix(mocks): update client mocks with PrintMessage Signed-off-by: Artur Troian --- Makefile | 2 +- go/node/client/v1beta1/mocks/client.go | 23 ++++-- go/node/client/v1beta1/mocks/node.go | 15 ++-- go/node/client/v1beta1/mocks/query.go | 75 +++++++++++++++++-- go/node/client/v1beta1/mocks/tx.go | 15 ++-- go/node/client/v1beta2/mocks/client.go | 73 ++++++++++++++++-- go/node/client/v1beta2/mocks/node_client.go | 15 ++-- go/node/client/v1beta2/mocks/query_client.go | 79 ++++++++++++++++++-- go/node/client/v1beta2/mocks/tx_client.go | 33 ++++---- 9 files changed, 271 insertions(+), 59 deletions(-) diff --git a/Makefile b/Makefile index ae3fc362..a23c0c57 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ PROTOC_GEN_DOC_VERSION := $(shell $(GO) list -mod=readonly -m -f '{{ .V PROTOC_GEN_SWAGGER_VERSION := $(PROTOC_GEN_GRPC_GATEWAY_VERSION) MODVENDOR_VERSION ?= v0.5.0 -MOCKERY_VERSION ?= 2.24.0 +MOCKERY_VERSION ?= 2.42.0 GOLANGCI_LINT_VERSION ?= v1.56.1 BUF_VERSION_FILE := $(AKASH_DEVCACHE_VERSIONS)/buf/$(BUF_VERSION) diff --git a/go/node/client/v1beta1/mocks/client.go b/go/node/client/v1beta1/mocks/client.go index b921e97c..d77d89e4 100644 --- a/go/node/client/v1beta1/mocks/client.go +++ b/go/node/client/v1beta1/mocks/client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks @@ -24,6 +24,10 @@ func (_m *Client) EXPECT() *Client_Expecter { func (_m *Client) Node() v1beta1.Node { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Node") + } + var r0 v1beta1.Node if rf, ok := ret.Get(0).(func() v1beta1.Node); ok { r0 = rf() @@ -67,6 +71,10 @@ func (_c *Client_Node_Call) RunAndReturn(run func() v1beta1.Node) *Client_Node_C func (_m *Client) Query() v1beta1.Query { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Query") + } + var r0 v1beta1.Query if rf, ok := ret.Get(0).(func() v1beta1.Query); ok { r0 = rf() @@ -110,6 +118,10 @@ func (_c *Client_Query_Call) RunAndReturn(run func() v1beta1.Query) *Client_Quer func (_m *Client) Tx() v1beta1.Tx { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Tx") + } + var r0 v1beta1.Tx if rf, ok := ret.Get(0).(func() v1beta1.Tx); ok { r0 = rf() @@ -149,13 +161,12 @@ func (_c *Client_Tx_Call) RunAndReturn(run func() v1beta1.Tx) *Client_Tx_Call { return _c } -type mockConstructorTestingTNewClient interface { +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { mock.TestingT Cleanup(func()) -} - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewClient(t mockConstructorTestingTNewClient) *Client { +}) *Client { mock := &Client{} mock.Mock.Test(t) diff --git a/go/node/client/v1beta1/mocks/node.go b/go/node/client/v1beta1/mocks/node.go index 222e0faa..47f5a823 100644 --- a/go/node/client/v1beta1/mocks/node.go +++ b/go/node/client/v1beta1/mocks/node.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks @@ -26,6 +26,10 @@ func (_m *Node) EXPECT() *Node_Expecter { func (_m *Node) SyncInfo(ctx context.Context) (*coretypes.SyncInfo, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for SyncInfo") + } + var r0 *coretypes.SyncInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.SyncInfo, error)); ok { @@ -76,13 +80,12 @@ func (_c *Node_SyncInfo_Call) RunAndReturn(run func(context.Context) (*coretypes return _c } -type mockConstructorTestingTNewNode interface { +// NewNode creates a new instance of Node. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewNode(t interface { mock.TestingT Cleanup(func()) -} - -// NewNode creates a new instance of Node. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewNode(t mockConstructorTestingTNewNode) *Node { +}) *Node { mock := &Node{} mock.Mock.Test(t) diff --git a/go/node/client/v1beta1/mocks/query.go b/go/node/client/v1beta1/mocks/query.go index d8c8a347..32763e64 100644 --- a/go/node/client/v1beta1/mocks/query.go +++ b/go/node/client/v1beta1/mocks/query.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks @@ -44,6 +44,10 @@ func (_m *Query) AllProvidersAttributes(ctx context.Context, in *v1beta3.QueryAl _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for AllProvidersAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryAllProvidersAttributesRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -114,6 +118,10 @@ func (_m *Query) AuditorAttributes(ctx context.Context, in *v1beta3.QueryAuditor _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for AuditorAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryAuditorAttributesRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -184,6 +192,10 @@ func (_m *Query) Bid(ctx context.Context, in *marketv1beta3.QueryBidRequest, opt _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Bid") + } + var r0 *marketv1beta3.QueryBidResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryBidRequest, ...grpc.CallOption) (*marketv1beta3.QueryBidResponse, error)); ok { @@ -254,6 +266,10 @@ func (_m *Query) Bids(ctx context.Context, in *marketv1beta3.QueryBidsRequest, o _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Bids") + } + var r0 *marketv1beta3.QueryBidsResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryBidsRequest, ...grpc.CallOption) (*marketv1beta3.QueryBidsResponse, error)); ok { @@ -324,6 +340,10 @@ func (_m *Query) Certificates(ctx context.Context, in *certv1beta3.QueryCertific _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Certificates") + } + var r0 *certv1beta3.QueryCertificatesResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *certv1beta3.QueryCertificatesRequest, ...grpc.CallOption) (*certv1beta3.QueryCertificatesResponse, error)); ok { @@ -394,6 +414,10 @@ func (_m *Query) Deployment(ctx context.Context, in *deploymentv1beta3.QueryDepl _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Deployment") + } + var r0 *deploymentv1beta3.QueryDeploymentResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *deploymentv1beta3.QueryDeploymentRequest, ...grpc.CallOption) (*deploymentv1beta3.QueryDeploymentResponse, error)); ok { @@ -464,6 +488,10 @@ func (_m *Query) Deployments(ctx context.Context, in *deploymentv1beta3.QueryDep _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Deployments") + } + var r0 *deploymentv1beta3.QueryDeploymentsResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *deploymentv1beta3.QueryDeploymentsRequest, ...grpc.CallOption) (*deploymentv1beta3.QueryDeploymentsResponse, error)); ok { @@ -534,6 +562,10 @@ func (_m *Query) Group(ctx context.Context, in *deploymentv1beta3.QueryGroupRequ _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Group") + } + var r0 *deploymentv1beta3.QueryGroupResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *deploymentv1beta3.QueryGroupRequest, ...grpc.CallOption) (*deploymentv1beta3.QueryGroupResponse, error)); ok { @@ -604,6 +636,10 @@ func (_m *Query) Lease(ctx context.Context, in *marketv1beta3.QueryLeaseRequest, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Lease") + } + var r0 *marketv1beta3.QueryLeaseResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryLeaseRequest, ...grpc.CallOption) (*marketv1beta3.QueryLeaseResponse, error)); ok { @@ -674,6 +710,10 @@ func (_m *Query) Leases(ctx context.Context, in *marketv1beta3.QueryLeasesReques _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Leases") + } + var r0 *marketv1beta3.QueryLeasesResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryLeasesRequest, ...grpc.CallOption) (*marketv1beta3.QueryLeasesResponse, error)); ok { @@ -744,6 +784,10 @@ func (_m *Query) Order(ctx context.Context, in *marketv1beta3.QueryOrderRequest, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Order") + } + var r0 *marketv1beta3.QueryOrderResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryOrderRequest, ...grpc.CallOption) (*marketv1beta3.QueryOrderResponse, error)); ok { @@ -814,6 +858,10 @@ func (_m *Query) Orders(ctx context.Context, in *marketv1beta3.QueryOrdersReques _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Orders") + } + var r0 *marketv1beta3.QueryOrdersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryOrdersRequest, ...grpc.CallOption) (*marketv1beta3.QueryOrdersResponse, error)); ok { @@ -884,6 +932,10 @@ func (_m *Query) Provider(ctx context.Context, in *providerv1beta3.QueryProvider _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Provider") + } + var r0 *providerv1beta3.QueryProviderResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta3.QueryProviderRequest, ...grpc.CallOption) (*providerv1beta3.QueryProviderResponse, error)); ok { @@ -954,6 +1006,10 @@ func (_m *Query) ProviderAttributes(ctx context.Context, in *v1beta3.QueryProvid _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ProviderAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryProviderAttributesRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -1024,6 +1080,10 @@ func (_m *Query) ProviderAuditorAttributes(ctx context.Context, in *v1beta3.Quer _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ProviderAuditorAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryProviderAuditorRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -1094,6 +1154,10 @@ func (_m *Query) Providers(ctx context.Context, in *providerv1beta3.QueryProvide _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Providers") + } + var r0 *providerv1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta3.QueryProvidersRequest, ...grpc.CallOption) (*providerv1beta3.QueryProvidersResponse, error)); ok { @@ -1153,13 +1217,12 @@ func (_c *Query_Providers_Call) RunAndReturn(run func(context.Context, *provider return _c } -type mockConstructorTestingTNewQuery interface { +// NewQuery creates a new instance of Query. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewQuery(t interface { mock.TestingT Cleanup(func()) -} - -// NewQuery creates a new instance of Query. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewQuery(t mockConstructorTestingTNewQuery) *Query { +}) *Query { mock := &Query{} mock.Mock.Test(t) diff --git a/go/node/client/v1beta1/mocks/tx.go b/go/node/client/v1beta1/mocks/tx.go index cc28657d..6846b8a1 100644 --- a/go/node/client/v1beta1/mocks/tx.go +++ b/go/node/client/v1beta1/mocks/tx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks @@ -33,6 +33,10 @@ func (_m *Tx) Broadcast(_a0 context.Context, _a1 ...types.Msg) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Broadcast") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, ...types.Msg) error); ok { r0 = rf(_a0, _a1...) @@ -79,13 +83,12 @@ func (_c *Tx_Broadcast_Call) RunAndReturn(run func(context.Context, ...types.Msg return _c } -type mockConstructorTestingTNewTx interface { +// NewTx creates a new instance of Tx. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTx(t interface { mock.TestingT Cleanup(func()) -} - -// NewTx creates a new instance of Tx. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewTx(t mockConstructorTestingTNewTx) *Tx { +}) *Tx { mock := &Tx{} mock.Mock.Test(t) diff --git a/go/node/client/v1beta2/mocks/client.go b/go/node/client/v1beta2/mocks/client.go index de8783f6..ee15a525 100644 --- a/go/node/client/v1beta2/mocks/client.go +++ b/go/node/client/v1beta2/mocks/client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks @@ -26,6 +26,10 @@ func (_m *Client) EXPECT() *Client_Expecter { func (_m *Client) ClientContext() client.Context { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ClientContext") + } + var r0 client.Context if rf, ok := ret.Get(0).(func() client.Context); ok { r0 = rf() @@ -67,6 +71,10 @@ func (_c *Client_ClientContext_Call) RunAndReturn(run func() client.Context) *Cl func (_m *Client) Node() v1beta2.NodeClient { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Node") + } + var r0 v1beta2.NodeClient if rf, ok := ret.Get(0).(func() v1beta2.NodeClient); ok { r0 = rf() @@ -106,10 +114,60 @@ func (_c *Client_Node_Call) RunAndReturn(run func() v1beta2.NodeClient) *Client_ return _c } +// PrintMessage provides a mock function with given fields: _a0 +func (_m *Client) PrintMessage(_a0 interface{}) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for PrintMessage") + } + + var r0 error + if rf, ok := ret.Get(0).(func(interface{}) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Client_PrintMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrintMessage' +type Client_PrintMessage_Call struct { + *mock.Call +} + +// PrintMessage is a helper method to define mock.On call +// - _a0 interface{} +func (_e *Client_Expecter) PrintMessage(_a0 interface{}) *Client_PrintMessage_Call { + return &Client_PrintMessage_Call{Call: _e.mock.On("PrintMessage", _a0)} +} + +func (_c *Client_PrintMessage_Call) Run(run func(_a0 interface{})) *Client_PrintMessage_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Client_PrintMessage_Call) Return(_a0 error) *Client_PrintMessage_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_PrintMessage_Call) RunAndReturn(run func(interface{}) error) *Client_PrintMessage_Call { + _c.Call.Return(run) + return _c +} + // Query provides a mock function with given fields: func (_m *Client) Query() v1beta2.QueryClient { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Query") + } + var r0 v1beta2.QueryClient if rf, ok := ret.Get(0).(func() v1beta2.QueryClient); ok { r0 = rf() @@ -153,6 +211,10 @@ func (_c *Client_Query_Call) RunAndReturn(run func() v1beta2.QueryClient) *Clien func (_m *Client) Tx() v1beta2.TxClient { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Tx") + } + var r0 v1beta2.TxClient if rf, ok := ret.Get(0).(func() v1beta2.TxClient); ok { r0 = rf() @@ -192,13 +254,12 @@ func (_c *Client_Tx_Call) RunAndReturn(run func() v1beta2.TxClient) *Client_Tx_C return _c } -type mockConstructorTestingTNewClient interface { +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { mock.TestingT Cleanup(func()) -} - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewClient(t mockConstructorTestingTNewClient) *Client { +}) *Client { mock := &Client{} mock.Mock.Test(t) diff --git a/go/node/client/v1beta2/mocks/node_client.go b/go/node/client/v1beta2/mocks/node_client.go index 7df6362f..e567347b 100644 --- a/go/node/client/v1beta2/mocks/node_client.go +++ b/go/node/client/v1beta2/mocks/node_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks @@ -26,6 +26,10 @@ func (_m *NodeClient) EXPECT() *NodeClient_Expecter { func (_m *NodeClient) SyncInfo(ctx context.Context) (*coretypes.SyncInfo, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for SyncInfo") + } + var r0 *coretypes.SyncInfo var r1 error if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.SyncInfo, error)); ok { @@ -76,13 +80,12 @@ func (_c *NodeClient_SyncInfo_Call) RunAndReturn(run func(context.Context) (*cor return _c } -type mockConstructorTestingTNewNodeClient interface { +// NewNodeClient creates a new instance of NodeClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewNodeClient(t interface { mock.TestingT Cleanup(func()) -} - -// NewNodeClient creates a new instance of NodeClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewNodeClient(t mockConstructorTestingTNewNodeClient) *NodeClient { +}) *NodeClient { mock := &NodeClient{} mock.Mock.Test(t) diff --git a/go/node/client/v1beta2/mocks/query_client.go b/go/node/client/v1beta2/mocks/query_client.go index 82170e84..527ea87b 100644 --- a/go/node/client/v1beta2/mocks/query_client.go +++ b/go/node/client/v1beta2/mocks/query_client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks @@ -45,6 +45,10 @@ func (_m *QueryClient) AllProvidersAttributes(ctx context.Context, in *v1beta3.Q _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for AllProvidersAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryAllProvidersAttributesRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -115,6 +119,10 @@ func (_m *QueryClient) AuditorAttributes(ctx context.Context, in *v1beta3.QueryA _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for AuditorAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryAuditorAttributesRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -185,6 +193,10 @@ func (_m *QueryClient) Bid(ctx context.Context, in *v1beta4.QueryBidRequest, opt _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Bid") + } + var r0 *v1beta4.QueryBidResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryBidRequest, ...grpc.CallOption) (*v1beta4.QueryBidResponse, error)); ok { @@ -255,6 +267,10 @@ func (_m *QueryClient) Bids(ctx context.Context, in *v1beta4.QueryBidsRequest, o _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Bids") + } + var r0 *v1beta4.QueryBidsResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryBidsRequest, ...grpc.CallOption) (*v1beta4.QueryBidsResponse, error)); ok { @@ -325,6 +341,10 @@ func (_m *QueryClient) Certificates(ctx context.Context, in *certv1beta3.QueryCe _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Certificates") + } + var r0 *certv1beta3.QueryCertificatesResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *certv1beta3.QueryCertificatesRequest, ...grpc.CallOption) (*certv1beta3.QueryCertificatesResponse, error)); ok { @@ -388,6 +408,10 @@ func (_c *QueryClient_Certificates_Call) RunAndReturn(run func(context.Context, func (_m *QueryClient) ClientContext() client.Context { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ClientContext") + } + var r0 client.Context if rf, ok := ret.Get(0).(func() client.Context); ok { r0 = rf() @@ -436,6 +460,10 @@ func (_m *QueryClient) Deployment(ctx context.Context, in *deploymentv1beta3.Que _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Deployment") + } + var r0 *deploymentv1beta3.QueryDeploymentResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *deploymentv1beta3.QueryDeploymentRequest, ...grpc.CallOption) (*deploymentv1beta3.QueryDeploymentResponse, error)); ok { @@ -506,6 +534,10 @@ func (_m *QueryClient) Deployments(ctx context.Context, in *deploymentv1beta3.Qu _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Deployments") + } + var r0 *deploymentv1beta3.QueryDeploymentsResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *deploymentv1beta3.QueryDeploymentsRequest, ...grpc.CallOption) (*deploymentv1beta3.QueryDeploymentsResponse, error)); ok { @@ -576,6 +608,10 @@ func (_m *QueryClient) Group(ctx context.Context, in *deploymentv1beta3.QueryGro _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Group") + } + var r0 *deploymentv1beta3.QueryGroupResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *deploymentv1beta3.QueryGroupRequest, ...grpc.CallOption) (*deploymentv1beta3.QueryGroupResponse, error)); ok { @@ -646,6 +682,10 @@ func (_m *QueryClient) Lease(ctx context.Context, in *v1beta4.QueryLeaseRequest, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Lease") + } + var r0 *v1beta4.QueryLeaseResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryLeaseRequest, ...grpc.CallOption) (*v1beta4.QueryLeaseResponse, error)); ok { @@ -716,6 +756,10 @@ func (_m *QueryClient) Leases(ctx context.Context, in *v1beta4.QueryLeasesReques _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Leases") + } + var r0 *v1beta4.QueryLeasesResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryLeasesRequest, ...grpc.CallOption) (*v1beta4.QueryLeasesResponse, error)); ok { @@ -786,6 +830,10 @@ func (_m *QueryClient) Order(ctx context.Context, in *v1beta4.QueryOrderRequest, _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Order") + } + var r0 *v1beta4.QueryOrderResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryOrderRequest, ...grpc.CallOption) (*v1beta4.QueryOrderResponse, error)); ok { @@ -856,6 +904,10 @@ func (_m *QueryClient) Orders(ctx context.Context, in *v1beta4.QueryOrdersReques _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Orders") + } + var r0 *v1beta4.QueryOrdersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryOrdersRequest, ...grpc.CallOption) (*v1beta4.QueryOrdersResponse, error)); ok { @@ -926,6 +978,10 @@ func (_m *QueryClient) Provider(ctx context.Context, in *providerv1beta3.QueryPr _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Provider") + } + var r0 *providerv1beta3.QueryProviderResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta3.QueryProviderRequest, ...grpc.CallOption) (*providerv1beta3.QueryProviderResponse, error)); ok { @@ -996,6 +1052,10 @@ func (_m *QueryClient) ProviderAttributes(ctx context.Context, in *v1beta3.Query _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ProviderAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryProviderAttributesRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -1066,6 +1126,10 @@ func (_m *QueryClient) ProviderAuditorAttributes(ctx context.Context, in *v1beta _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for ProviderAuditorAttributes") + } + var r0 *v1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *v1beta3.QueryProviderAuditorRequest, ...grpc.CallOption) (*v1beta3.QueryProvidersResponse, error)); ok { @@ -1136,6 +1200,10 @@ func (_m *QueryClient) Providers(ctx context.Context, in *providerv1beta3.QueryP _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Providers") + } + var r0 *providerv1beta3.QueryProvidersResponse var r1 error if rf, ok := ret.Get(0).(func(context.Context, *providerv1beta3.QueryProvidersRequest, ...grpc.CallOption) (*providerv1beta3.QueryProvidersResponse, error)); ok { @@ -1195,13 +1263,12 @@ func (_c *QueryClient_Providers_Call) RunAndReturn(run func(context.Context, *pr return _c } -type mockConstructorTestingTNewQueryClient interface { +// NewQueryClient creates a new instance of QueryClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewQueryClient(t interface { mock.TestingT Cleanup(func()) -} - -// NewQueryClient creates a new instance of QueryClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewQueryClient(t mockConstructorTestingTNewQueryClient) *QueryClient { +}) *QueryClient { mock := &QueryClient{} mock.Mock.Test(t) diff --git a/go/node/client/v1beta2/mocks/tx_client.go b/go/node/client/v1beta2/mocks/tx_client.go index e0d2343c..f0402d63 100644 --- a/go/node/client/v1beta2/mocks/tx_client.go +++ b/go/node/client/v1beta2/mocks/tx_client.go @@ -1,14 +1,12 @@ -// Code generated by mockery v2.24.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mocks import ( context "context" - proto "github.com/gogo/protobuf/proto" - mock "github.com/stretchr/testify/mock" - types "github.com/cosmos/cosmos-sdk/types" + mock "github.com/stretchr/testify/mock" v1beta2 "github.com/akash-network/akash-api/go/node/client/v1beta2" ) @@ -27,7 +25,7 @@ func (_m *TxClient) EXPECT() *TxClient_Expecter { } // Broadcast provides a mock function with given fields: _a0, _a1, _a2 -func (_m *TxClient) Broadcast(_a0 context.Context, _a1 []types.Msg, _a2 ...v1beta2.BroadcastOption) (proto.Message, error) { +func (_m *TxClient) Broadcast(_a0 context.Context, _a1 []types.Msg, _a2 ...v1beta2.BroadcastOption) (interface{}, error) { _va := make([]interface{}, len(_a2)) for _i := range _a2 { _va[_i] = _a2[_i] @@ -37,16 +35,20 @@ func (_m *TxClient) Broadcast(_a0 context.Context, _a1 []types.Msg, _a2 ...v1bet _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 proto.Message + if len(ret) == 0 { + panic("no return value specified for Broadcast") + } + + var r0 interface{} var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []types.Msg, ...v1beta2.BroadcastOption) (proto.Message, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []types.Msg, ...v1beta2.BroadcastOption) (interface{}, error)); ok { return rf(_a0, _a1, _a2...) } - if rf, ok := ret.Get(0).(func(context.Context, []types.Msg, ...v1beta2.BroadcastOption) proto.Message); ok { + if rf, ok := ret.Get(0).(func(context.Context, []types.Msg, ...v1beta2.BroadcastOption) interface{}); ok { r0 = rf(_a0, _a1, _a2...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(proto.Message) + r0 = ret.Get(0).(interface{}) } } @@ -86,23 +88,22 @@ func (_c *TxClient_Broadcast_Call) Run(run func(_a0 context.Context, _a1 []types return _c } -func (_c *TxClient_Broadcast_Call) Return(_a0 proto.Message, _a1 error) *TxClient_Broadcast_Call { +func (_c *TxClient_Broadcast_Call) Return(_a0 interface{}, _a1 error) *TxClient_Broadcast_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *TxClient_Broadcast_Call) RunAndReturn(run func(context.Context, []types.Msg, ...v1beta2.BroadcastOption) (proto.Message, error)) *TxClient_Broadcast_Call { +func (_c *TxClient_Broadcast_Call) RunAndReturn(run func(context.Context, []types.Msg, ...v1beta2.BroadcastOption) (interface{}, error)) *TxClient_Broadcast_Call { _c.Call.Return(run) return _c } -type mockConstructorTestingTNewTxClient interface { +// NewTxClient creates a new instance of TxClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTxClient(t interface { mock.TestingT Cleanup(func()) -} - -// NewTxClient creates a new instance of TxClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewTxClient(t mockConstructorTestingTNewTxClient) *TxClient { +}) *TxClient { mock := &TxClient{} mock.Mock.Test(t)