From 21fd3c4548cce7eba56ee682982f511452b0ff9e Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Wed, 1 Nov 2023 13:22:25 -0400 Subject: [PATCH] feat(x/market): implement resource offer in bid Signed-off-by: Artur Troian --- app/app_configure.go | 2 +- client/client.go | 2 +- client/mocks/query_client.go | 136 +++++++++---------- cmd/akash/cmd/testnetify/state.go | 2 +- events/publish.go | 2 +- events/publish_test.go | 2 +- go.mod | 17 ++- go.sum | 70 +++------- meta.json | 5 + tests/upgrade/upgrade-v0.28.0.json | 8 ++ testutil/event.go | 2 +- testutil/ids.go | 2 +- testutil/state/suite.go | 4 +- upgrades/CHANGELOG.md | 9 +- upgrades/software/v0.28.0/init.go | 14 ++ upgrades/software/v0.28.0/market.go | 48 +++++++ upgrades/software/v0.28.0/upgrade.go | 54 ++++++++ upgrades/upgrades.go | 2 + x/deployment/handler/keepers.go | 2 +- x/escrow/client/cli/query.go | 2 +- x/market/alias.go | 2 +- x/market/client/cli/bid.go | 2 +- x/market/client/cli/cli_test.go | 2 +- x/market/client/cli/flags.go | 2 +- x/market/client/cli/grpc_rest_test.go | 51 ++++--- x/market/client/cli/lease.go | 2 +- x/market/client/cli/order.go | 2 +- x/market/client/cli/query.go | 2 +- x/market/client/cli/test_helpers.go | 2 +- x/market/client/cli/tx.go | 2 +- x/market/client/rest/params.go | 2 +- x/market/genesis.go | 2 +- x/market/handler/handler.go | 2 +- x/market/handler/handler_test.go | 4 +- x/market/handler/server.go | 4 +- x/market/hooks/external.go | 2 +- x/market/hooks/hooks.go | 2 +- x/market/keeper/grpc_query.go | 4 +- x/market/keeper/grpc_query_test.go | 2 +- x/market/keeper/keeper.go | 4 +- x/market/keeper/keeper_test.go | 2 +- x/market/keeper/keys/v1beta4/key.go | 164 +++++++++++++++++++++++ x/market/keeper/keys/v1beta4/key_test.go | 35 +++++ x/market/module.go | 4 +- x/market/query/client.go | 2 +- x/market/query/path.go | 4 +- x/market/query/rawclient.go | 2 +- x/market/query/types.go | 2 +- x/market/simulation/genesis.go | 2 +- x/market/simulation/operations.go | 2 +- x/market/simulation/utils.go | 2 +- x/provider/handler/server.go | 2 +- 52 files changed, 499 insertions(+), 206 deletions(-) create mode 100644 tests/upgrade/upgrade-v0.28.0.json create mode 100644 upgrades/software/v0.28.0/init.go create mode 100644 upgrades/software/v0.28.0/market.go create mode 100644 upgrades/software/v0.28.0/upgrade.go create mode 100644 x/market/keeper/keys/v1beta4/key.go create mode 100644 x/market/keeper/keys/v1beta4/key_test.go diff --git a/app/app_configure.go b/app/app_configure.go index 9bff760115..6921d9e120 100644 --- a/app/app_configure.go +++ b/app/app_configure.go @@ -28,7 +28,7 @@ import ( deploymenttypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" escrowtypes "github.com/akash-network/akash-api/go/node/escrow/v1beta3" inflationtypes "github.com/akash-network/akash-api/go/node/inflation/v1beta3" - markettypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + markettypes "github.com/akash-network/akash-api/go/node/market/v1beta4" providertypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" taketypes "github.com/akash-network/akash-api/go/node/take/v1beta3" diff --git a/client/client.go b/client/client.go index a2f09d53f1..b96a98ed14 100644 --- a/client/client.go +++ b/client/client.go @@ -17,7 +17,7 @@ import ( ctypes "github.com/akash-network/akash-api/go/node/cert/v1beta3" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" diff --git a/client/mocks/query_client.go b/client/mocks/query_client.go index 0399d9f686..2c97cf2cee 100644 --- a/client/mocks/query_client.go +++ b/client/mocks/query_client.go @@ -11,13 +11,13 @@ import ( grpc "google.golang.org/grpc" - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" - mock "github.com/stretchr/testify/mock" providerv1beta3 "github.com/akash-network/akash-api/go/node/provider/v1beta3" v1beta3 "github.com/akash-network/akash-api/go/node/audit/v1beta3" + + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // QueryClient is an autogenerated mock type for the QueryClient type @@ -174,7 +174,7 @@ func (_c *QueryClient_AuditorAttributes_Call) RunAndReturn(run func(context.Cont } // Bid provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Bid(ctx context.Context, in *marketv1beta3.QueryBidRequest, opts ...grpc.CallOption) (*marketv1beta3.QueryBidResponse, error) { +func (_m *QueryClient) Bid(ctx context.Context, in *v1beta4.QueryBidRequest, opts ...grpc.CallOption) (*v1beta4.QueryBidResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -184,20 +184,20 @@ func (_m *QueryClient) Bid(ctx context.Context, in *marketv1beta3.QueryBidReques _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *marketv1beta3.QueryBidResponse + var r0 *v1beta4.QueryBidResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryBidRequest, ...grpc.CallOption) (*marketv1beta3.QueryBidResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryBidRequest, ...grpc.CallOption) (*v1beta4.QueryBidResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryBidRequest, ...grpc.CallOption) *marketv1beta3.QueryBidResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryBidRequest, ...grpc.CallOption) *v1beta4.QueryBidResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*marketv1beta3.QueryBidResponse) + r0 = ret.Get(0).(*v1beta4.QueryBidResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *marketv1beta3.QueryBidRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryBidRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -213,14 +213,14 @@ type QueryClient_Bid_Call struct { // Bid is a helper method to define mock.On call // - ctx context.Context -// - in *marketv1beta3.QueryBidRequest +// - in *v1beta4.QueryBidRequest // - opts ...grpc.CallOption func (_e *QueryClient_Expecter) Bid(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Bid_Call { return &QueryClient_Bid_Call{Call: _e.mock.On("Bid", append([]interface{}{ctx, in}, opts...)...)} } -func (_c *QueryClient_Bid_Call) Run(run func(ctx context.Context, in *marketv1beta3.QueryBidRequest, opts ...grpc.CallOption)) *QueryClient_Bid_Call { +func (_c *QueryClient_Bid_Call) Run(run func(ctx context.Context, in *v1beta4.QueryBidRequest, opts ...grpc.CallOption)) *QueryClient_Bid_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]grpc.CallOption, len(args)-2) for i, a := range args[2:] { @@ -228,23 +228,23 @@ func (_c *QueryClient_Bid_Call) Run(run func(ctx context.Context, in *marketv1be variadicArgs[i] = a.(grpc.CallOption) } } - run(args[0].(context.Context), args[1].(*marketv1beta3.QueryBidRequest), variadicArgs...) + run(args[0].(context.Context), args[1].(*v1beta4.QueryBidRequest), variadicArgs...) }) return _c } -func (_c *QueryClient_Bid_Call) Return(_a0 *marketv1beta3.QueryBidResponse, _a1 error) *QueryClient_Bid_Call { +func (_c *QueryClient_Bid_Call) Return(_a0 *v1beta4.QueryBidResponse, _a1 error) *QueryClient_Bid_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *QueryClient_Bid_Call) RunAndReturn(run func(context.Context, *marketv1beta3.QueryBidRequest, ...grpc.CallOption) (*marketv1beta3.QueryBidResponse, error)) *QueryClient_Bid_Call { +func (_c *QueryClient_Bid_Call) RunAndReturn(run func(context.Context, *v1beta4.QueryBidRequest, ...grpc.CallOption) (*v1beta4.QueryBidResponse, error)) *QueryClient_Bid_Call { _c.Call.Return(run) return _c } // Bids provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Bids(ctx context.Context, in *marketv1beta3.QueryBidsRequest, opts ...grpc.CallOption) (*marketv1beta3.QueryBidsResponse, error) { +func (_m *QueryClient) Bids(ctx context.Context, in *v1beta4.QueryBidsRequest, opts ...grpc.CallOption) (*v1beta4.QueryBidsResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -254,20 +254,20 @@ func (_m *QueryClient) Bids(ctx context.Context, in *marketv1beta3.QueryBidsRequ _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *marketv1beta3.QueryBidsResponse + var r0 *v1beta4.QueryBidsResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryBidsRequest, ...grpc.CallOption) (*marketv1beta3.QueryBidsResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryBidsRequest, ...grpc.CallOption) (*v1beta4.QueryBidsResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryBidsRequest, ...grpc.CallOption) *marketv1beta3.QueryBidsResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryBidsRequest, ...grpc.CallOption) *v1beta4.QueryBidsResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*marketv1beta3.QueryBidsResponse) + r0 = ret.Get(0).(*v1beta4.QueryBidsResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *marketv1beta3.QueryBidsRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryBidsRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -283,14 +283,14 @@ type QueryClient_Bids_Call struct { // Bids is a helper method to define mock.On call // - ctx context.Context -// - in *marketv1beta3.QueryBidsRequest +// - in *v1beta4.QueryBidsRequest // - opts ...grpc.CallOption func (_e *QueryClient_Expecter) Bids(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Bids_Call { return &QueryClient_Bids_Call{Call: _e.mock.On("Bids", append([]interface{}{ctx, in}, opts...)...)} } -func (_c *QueryClient_Bids_Call) Run(run func(ctx context.Context, in *marketv1beta3.QueryBidsRequest, opts ...grpc.CallOption)) *QueryClient_Bids_Call { +func (_c *QueryClient_Bids_Call) Run(run func(ctx context.Context, in *v1beta4.QueryBidsRequest, opts ...grpc.CallOption)) *QueryClient_Bids_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]grpc.CallOption, len(args)-2) for i, a := range args[2:] { @@ -298,17 +298,17 @@ func (_c *QueryClient_Bids_Call) Run(run func(ctx context.Context, in *marketv1b variadicArgs[i] = a.(grpc.CallOption) } } - run(args[0].(context.Context), args[1].(*marketv1beta3.QueryBidsRequest), variadicArgs...) + run(args[0].(context.Context), args[1].(*v1beta4.QueryBidsRequest), variadicArgs...) }) return _c } -func (_c *QueryClient_Bids_Call) Return(_a0 *marketv1beta3.QueryBidsResponse, _a1 error) *QueryClient_Bids_Call { +func (_c *QueryClient_Bids_Call) Return(_a0 *v1beta4.QueryBidsResponse, _a1 error) *QueryClient_Bids_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *QueryClient_Bids_Call) RunAndReturn(run func(context.Context, *marketv1beta3.QueryBidsRequest, ...grpc.CallOption) (*marketv1beta3.QueryBidsResponse, error)) *QueryClient_Bids_Call { +func (_c *QueryClient_Bids_Call) RunAndReturn(run func(context.Context, *v1beta4.QueryBidsRequest, ...grpc.CallOption) (*v1beta4.QueryBidsResponse, error)) *QueryClient_Bids_Call { _c.Call.Return(run) return _c } @@ -594,7 +594,7 @@ func (_c *QueryClient_Group_Call) RunAndReturn(run func(context.Context, *deploy } // Lease provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Lease(ctx context.Context, in *marketv1beta3.QueryLeaseRequest, opts ...grpc.CallOption) (*marketv1beta3.QueryLeaseResponse, error) { +func (_m *QueryClient) Lease(ctx context.Context, in *v1beta4.QueryLeaseRequest, opts ...grpc.CallOption) (*v1beta4.QueryLeaseResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -604,20 +604,20 @@ func (_m *QueryClient) Lease(ctx context.Context, in *marketv1beta3.QueryLeaseRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *marketv1beta3.QueryLeaseResponse + var r0 *v1beta4.QueryLeaseResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryLeaseRequest, ...grpc.CallOption) (*marketv1beta3.QueryLeaseResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryLeaseRequest, ...grpc.CallOption) (*v1beta4.QueryLeaseResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryLeaseRequest, ...grpc.CallOption) *marketv1beta3.QueryLeaseResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryLeaseRequest, ...grpc.CallOption) *v1beta4.QueryLeaseResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*marketv1beta3.QueryLeaseResponse) + r0 = ret.Get(0).(*v1beta4.QueryLeaseResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *marketv1beta3.QueryLeaseRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryLeaseRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -633,14 +633,14 @@ type QueryClient_Lease_Call struct { // Lease is a helper method to define mock.On call // - ctx context.Context -// - in *marketv1beta3.QueryLeaseRequest +// - in *v1beta4.QueryLeaseRequest // - opts ...grpc.CallOption func (_e *QueryClient_Expecter) Lease(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Lease_Call { return &QueryClient_Lease_Call{Call: _e.mock.On("Lease", append([]interface{}{ctx, in}, opts...)...)} } -func (_c *QueryClient_Lease_Call) Run(run func(ctx context.Context, in *marketv1beta3.QueryLeaseRequest, opts ...grpc.CallOption)) *QueryClient_Lease_Call { +func (_c *QueryClient_Lease_Call) Run(run func(ctx context.Context, in *v1beta4.QueryLeaseRequest, opts ...grpc.CallOption)) *QueryClient_Lease_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]grpc.CallOption, len(args)-2) for i, a := range args[2:] { @@ -648,23 +648,23 @@ func (_c *QueryClient_Lease_Call) Run(run func(ctx context.Context, in *marketv1 variadicArgs[i] = a.(grpc.CallOption) } } - run(args[0].(context.Context), args[1].(*marketv1beta3.QueryLeaseRequest), variadicArgs...) + run(args[0].(context.Context), args[1].(*v1beta4.QueryLeaseRequest), variadicArgs...) }) return _c } -func (_c *QueryClient_Lease_Call) Return(_a0 *marketv1beta3.QueryLeaseResponse, _a1 error) *QueryClient_Lease_Call { +func (_c *QueryClient_Lease_Call) Return(_a0 *v1beta4.QueryLeaseResponse, _a1 error) *QueryClient_Lease_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *QueryClient_Lease_Call) RunAndReturn(run func(context.Context, *marketv1beta3.QueryLeaseRequest, ...grpc.CallOption) (*marketv1beta3.QueryLeaseResponse, error)) *QueryClient_Lease_Call { +func (_c *QueryClient_Lease_Call) RunAndReturn(run func(context.Context, *v1beta4.QueryLeaseRequest, ...grpc.CallOption) (*v1beta4.QueryLeaseResponse, error)) *QueryClient_Lease_Call { _c.Call.Return(run) return _c } // Leases provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Leases(ctx context.Context, in *marketv1beta3.QueryLeasesRequest, opts ...grpc.CallOption) (*marketv1beta3.QueryLeasesResponse, error) { +func (_m *QueryClient) Leases(ctx context.Context, in *v1beta4.QueryLeasesRequest, opts ...grpc.CallOption) (*v1beta4.QueryLeasesResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -674,20 +674,20 @@ func (_m *QueryClient) Leases(ctx context.Context, in *marketv1beta3.QueryLeases _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *marketv1beta3.QueryLeasesResponse + var r0 *v1beta4.QueryLeasesResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryLeasesRequest, ...grpc.CallOption) (*marketv1beta3.QueryLeasesResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryLeasesRequest, ...grpc.CallOption) (*v1beta4.QueryLeasesResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryLeasesRequest, ...grpc.CallOption) *marketv1beta3.QueryLeasesResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryLeasesRequest, ...grpc.CallOption) *v1beta4.QueryLeasesResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*marketv1beta3.QueryLeasesResponse) + r0 = ret.Get(0).(*v1beta4.QueryLeasesResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *marketv1beta3.QueryLeasesRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryLeasesRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -703,14 +703,14 @@ type QueryClient_Leases_Call struct { // Leases is a helper method to define mock.On call // - ctx context.Context -// - in *marketv1beta3.QueryLeasesRequest +// - in *v1beta4.QueryLeasesRequest // - opts ...grpc.CallOption func (_e *QueryClient_Expecter) Leases(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Leases_Call { return &QueryClient_Leases_Call{Call: _e.mock.On("Leases", append([]interface{}{ctx, in}, opts...)...)} } -func (_c *QueryClient_Leases_Call) Run(run func(ctx context.Context, in *marketv1beta3.QueryLeasesRequest, opts ...grpc.CallOption)) *QueryClient_Leases_Call { +func (_c *QueryClient_Leases_Call) Run(run func(ctx context.Context, in *v1beta4.QueryLeasesRequest, opts ...grpc.CallOption)) *QueryClient_Leases_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]grpc.CallOption, len(args)-2) for i, a := range args[2:] { @@ -718,23 +718,23 @@ func (_c *QueryClient_Leases_Call) Run(run func(ctx context.Context, in *marketv variadicArgs[i] = a.(grpc.CallOption) } } - run(args[0].(context.Context), args[1].(*marketv1beta3.QueryLeasesRequest), variadicArgs...) + run(args[0].(context.Context), args[1].(*v1beta4.QueryLeasesRequest), variadicArgs...) }) return _c } -func (_c *QueryClient_Leases_Call) Return(_a0 *marketv1beta3.QueryLeasesResponse, _a1 error) *QueryClient_Leases_Call { +func (_c *QueryClient_Leases_Call) Return(_a0 *v1beta4.QueryLeasesResponse, _a1 error) *QueryClient_Leases_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *QueryClient_Leases_Call) RunAndReturn(run func(context.Context, *marketv1beta3.QueryLeasesRequest, ...grpc.CallOption) (*marketv1beta3.QueryLeasesResponse, error)) *QueryClient_Leases_Call { +func (_c *QueryClient_Leases_Call) RunAndReturn(run func(context.Context, *v1beta4.QueryLeasesRequest, ...grpc.CallOption) (*v1beta4.QueryLeasesResponse, error)) *QueryClient_Leases_Call { _c.Call.Return(run) return _c } // Order provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Order(ctx context.Context, in *marketv1beta3.QueryOrderRequest, opts ...grpc.CallOption) (*marketv1beta3.QueryOrderResponse, error) { +func (_m *QueryClient) Order(ctx context.Context, in *v1beta4.QueryOrderRequest, opts ...grpc.CallOption) (*v1beta4.QueryOrderResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -744,20 +744,20 @@ func (_m *QueryClient) Order(ctx context.Context, in *marketv1beta3.QueryOrderRe _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *marketv1beta3.QueryOrderResponse + var r0 *v1beta4.QueryOrderResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryOrderRequest, ...grpc.CallOption) (*marketv1beta3.QueryOrderResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryOrderRequest, ...grpc.CallOption) (*v1beta4.QueryOrderResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryOrderRequest, ...grpc.CallOption) *marketv1beta3.QueryOrderResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryOrderRequest, ...grpc.CallOption) *v1beta4.QueryOrderResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*marketv1beta3.QueryOrderResponse) + r0 = ret.Get(0).(*v1beta4.QueryOrderResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *marketv1beta3.QueryOrderRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryOrderRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -773,14 +773,14 @@ type QueryClient_Order_Call struct { // Order is a helper method to define mock.On call // - ctx context.Context -// - in *marketv1beta3.QueryOrderRequest +// - in *v1beta4.QueryOrderRequest // - opts ...grpc.CallOption func (_e *QueryClient_Expecter) Order(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Order_Call { return &QueryClient_Order_Call{Call: _e.mock.On("Order", append([]interface{}{ctx, in}, opts...)...)} } -func (_c *QueryClient_Order_Call) Run(run func(ctx context.Context, in *marketv1beta3.QueryOrderRequest, opts ...grpc.CallOption)) *QueryClient_Order_Call { +func (_c *QueryClient_Order_Call) Run(run func(ctx context.Context, in *v1beta4.QueryOrderRequest, opts ...grpc.CallOption)) *QueryClient_Order_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]grpc.CallOption, len(args)-2) for i, a := range args[2:] { @@ -788,23 +788,23 @@ func (_c *QueryClient_Order_Call) Run(run func(ctx context.Context, in *marketv1 variadicArgs[i] = a.(grpc.CallOption) } } - run(args[0].(context.Context), args[1].(*marketv1beta3.QueryOrderRequest), variadicArgs...) + run(args[0].(context.Context), args[1].(*v1beta4.QueryOrderRequest), variadicArgs...) }) return _c } -func (_c *QueryClient_Order_Call) Return(_a0 *marketv1beta3.QueryOrderResponse, _a1 error) *QueryClient_Order_Call { +func (_c *QueryClient_Order_Call) Return(_a0 *v1beta4.QueryOrderResponse, _a1 error) *QueryClient_Order_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *QueryClient_Order_Call) RunAndReturn(run func(context.Context, *marketv1beta3.QueryOrderRequest, ...grpc.CallOption) (*marketv1beta3.QueryOrderResponse, error)) *QueryClient_Order_Call { +func (_c *QueryClient_Order_Call) RunAndReturn(run func(context.Context, *v1beta4.QueryOrderRequest, ...grpc.CallOption) (*v1beta4.QueryOrderResponse, error)) *QueryClient_Order_Call { _c.Call.Return(run) return _c } // Orders provides a mock function with given fields: ctx, in, opts -func (_m *QueryClient) Orders(ctx context.Context, in *marketv1beta3.QueryOrdersRequest, opts ...grpc.CallOption) (*marketv1beta3.QueryOrdersResponse, error) { +func (_m *QueryClient) Orders(ctx context.Context, in *v1beta4.QueryOrdersRequest, opts ...grpc.CallOption) (*v1beta4.QueryOrdersResponse, error) { _va := make([]interface{}, len(opts)) for _i := range opts { _va[_i] = opts[_i] @@ -814,20 +814,20 @@ func (_m *QueryClient) Orders(ctx context.Context, in *marketv1beta3.QueryOrders _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 *marketv1beta3.QueryOrdersResponse + var r0 *v1beta4.QueryOrdersResponse var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryOrdersRequest, ...grpc.CallOption) (*marketv1beta3.QueryOrdersResponse, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryOrdersRequest, ...grpc.CallOption) (*v1beta4.QueryOrdersResponse, error)); ok { return rf(ctx, in, opts...) } - if rf, ok := ret.Get(0).(func(context.Context, *marketv1beta3.QueryOrdersRequest, ...grpc.CallOption) *marketv1beta3.QueryOrdersResponse); ok { + if rf, ok := ret.Get(0).(func(context.Context, *v1beta4.QueryOrdersRequest, ...grpc.CallOption) *v1beta4.QueryOrdersResponse); ok { r0 = rf(ctx, in, opts...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*marketv1beta3.QueryOrdersResponse) + r0 = ret.Get(0).(*v1beta4.QueryOrdersResponse) } } - if rf, ok := ret.Get(1).(func(context.Context, *marketv1beta3.QueryOrdersRequest, ...grpc.CallOption) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, *v1beta4.QueryOrdersRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { r1 = ret.Error(1) @@ -843,14 +843,14 @@ type QueryClient_Orders_Call struct { // Orders is a helper method to define mock.On call // - ctx context.Context -// - in *marketv1beta3.QueryOrdersRequest +// - in *v1beta4.QueryOrdersRequest // - opts ...grpc.CallOption func (_e *QueryClient_Expecter) Orders(ctx interface{}, in interface{}, opts ...interface{}) *QueryClient_Orders_Call { return &QueryClient_Orders_Call{Call: _e.mock.On("Orders", append([]interface{}{ctx, in}, opts...)...)} } -func (_c *QueryClient_Orders_Call) Run(run func(ctx context.Context, in *marketv1beta3.QueryOrdersRequest, opts ...grpc.CallOption)) *QueryClient_Orders_Call { +func (_c *QueryClient_Orders_Call) Run(run func(ctx context.Context, in *v1beta4.QueryOrdersRequest, opts ...grpc.CallOption)) *QueryClient_Orders_Call { _c.Call.Run(func(args mock.Arguments) { variadicArgs := make([]grpc.CallOption, len(args)-2) for i, a := range args[2:] { @@ -858,17 +858,17 @@ func (_c *QueryClient_Orders_Call) Run(run func(ctx context.Context, in *marketv variadicArgs[i] = a.(grpc.CallOption) } } - run(args[0].(context.Context), args[1].(*marketv1beta3.QueryOrdersRequest), variadicArgs...) + run(args[0].(context.Context), args[1].(*v1beta4.QueryOrdersRequest), variadicArgs...) }) return _c } -func (_c *QueryClient_Orders_Call) Return(_a0 *marketv1beta3.QueryOrdersResponse, _a1 error) *QueryClient_Orders_Call { +func (_c *QueryClient_Orders_Call) Return(_a0 *v1beta4.QueryOrdersResponse, _a1 error) *QueryClient_Orders_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *QueryClient_Orders_Call) RunAndReturn(run func(context.Context, *marketv1beta3.QueryOrdersRequest, ...grpc.CallOption) (*marketv1beta3.QueryOrdersResponse, error)) *QueryClient_Orders_Call { +func (_c *QueryClient_Orders_Call) RunAndReturn(run func(context.Context, *v1beta4.QueryOrdersRequest, ...grpc.CallOption) (*v1beta4.QueryOrdersResponse, error)) *QueryClient_Orders_Call { _c.Call.Return(run) return _c } diff --git a/cmd/akash/cmd/testnetify/state.go b/cmd/akash/cmd/testnetify/state.go index 4f80384f69..8d5245ae71 100644 --- a/cmd/akash/cmd/testnetify/state.go +++ b/cmd/akash/cmd/testnetify/state.go @@ -30,7 +30,7 @@ import ( ctypes "github.com/akash-network/akash-api/go/node/cert/v1beta3" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" etypes "github.com/akash-network/akash-api/go/node/escrow/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/x/audit" "github.com/akash-network/node/x/cert" diff --git a/events/publish.go b/events/publish.go index d8c5b66b55..a39f7b3e6c 100644 --- a/events/publish.go +++ b/events/publish.go @@ -13,7 +13,7 @@ import ( atypes "github.com/akash-network/akash-api/go/node/audit/v1beta3" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" "github.com/akash-network/akash-api/go/sdkutil" diff --git a/events/publish_test.go b/events/publish_test.go index f2c250bbe1..8b480b1d9b 100644 --- a/events/publish_test.go +++ b/events/publish_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" "github.com/akash-network/akash-api/go/sdkutil" diff --git a/go.mod b/go.mod index 6be489bbba..e025dff8f0 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/akash-network/node go 1.21 require ( - github.com/akash-network/akash-api v0.0.27 + github.com/akash-network/akash-api v0.0.30 github.com/blang/semver/v4 v4.0.0 github.com/boz/go-lifecycle v0.1.1 github.com/cosmos/cosmos-sdk v0.45.16 @@ -37,8 +37,8 @@ require ( ) retract ( - v0.22.1 v0.26.0 + v0.22.1 ) replace ( @@ -123,7 +123,6 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/orderedcode v0.0.1 // indirect @@ -194,11 +193,11 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - k8s.io/api v0.23.4 // indirect - k8s.io/apimachinery v0.23.4 // indirect - k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect + k8s.io/api v0.26.1 // indirect + k8s.io/apimachinery v0.26.1 // indirect + k8s.io/klog/v2 v2.80.1 // indirect + k8s.io/utils v0.0.0-20221107191617-1a15be271d1d // indirect nhooyr.io/websocket v1.8.6 // indirect - sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) diff --git a/go.sum b/go.sum index 348ad6c8df..6bb0e2f241 100644 --- a/go.sum +++ b/go.sum @@ -78,15 +78,12 @@ github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4K github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -103,8 +100,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/akash-network/akash-api v0.0.27 h1:jit/zaBtx97ctL35/wM0r8yBJ74sXJsVlCa6uTEamHo= -github.com/akash-network/akash-api v0.0.27/go.mod h1:9/uYusyBcZecBQCgZWUbXRu0i1tyxj4/ze45XB2oLIU= +github.com/akash-network/akash-api v0.0.30 h1:zDNgudNmfiDgjhE3+caeT/Qy1d4Wr5FEtoe/1sFNwwY= +github.com/akash-network/akash-api v0.0.30/go.mod h1:pW5NnJNhxynCOUGEcgxa338GSU2qzMkpn3MMYcAY6O4= github.com/akash-network/cometbft v0.34.27-akash h1:V1dApDOr8Ee7BJzYyQ7Z9VBtrAul4+baMeA6C49dje0= github.com/akash-network/cometbft v0.34.27-akash/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= github.com/akash-network/ledger-go v0.14.3 h1:LCEFkTfgGA2xFMN2CtiKvXKE7dh0QSM77PJHCpSkaAo= @@ -131,7 +128,6 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -315,7 +311,6 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -329,13 +324,10 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= @@ -367,7 +359,6 @@ github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= github.com/getsentry/sentry-go v0.17.0 h1:UustVWnOoDFHBS7IJUB2QK/nB5pap748ZEp0swnQJak= github.com/getsentry/sentry-go v0.17.0/go.mod h1:B82dxtBvxG0KaPD8/hfSV+VcHD+Lg/xUS4JuQn1P4cM= @@ -399,16 +390,12 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -509,7 +496,6 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -535,8 +521,6 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -705,7 +689,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -789,7 +772,6 @@ github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -802,12 +784,10 @@ github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOA github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -828,7 +808,6 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -836,12 +815,12 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= +github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -994,7 +973,6 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1015,7 +993,6 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1247,7 +1224,6 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1348,7 +1324,6 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1421,7 +1396,6 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1446,8 +1420,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1522,7 +1494,6 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1551,7 +1522,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= @@ -1592,7 +1562,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -1608,19 +1577,14 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= -k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= -k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= -k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= -k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= +k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= +k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= +k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= +k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d h1:0Smp/HP1OH4Rvhe+4B8nWGERtlqAGSftbSbbmm45oFs= +k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= @@ -1630,13 +1594,11 @@ rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= -sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/meta.json b/meta.json index cec474a149..22fa13d498 100644 --- a/meta.json +++ b/meta.json @@ -9,6 +9,11 @@ "skipped": false, "from_binary": "v0.24.2", "from_version": "v0.24.0" + }, + "v0.28.0": { + "skipped": false, + "from_binary": "v0.26.1", + "from_version": "v0.26.0" } } } diff --git a/tests/upgrade/upgrade-v0.28.0.json b/tests/upgrade/upgrade-v0.28.0.json new file mode 100644 index 0000000000..4eae0ffe42 --- /dev/null +++ b/tests/upgrade/upgrade-v0.28.0.json @@ -0,0 +1,8 @@ +{ + "migrations": { + "market": { + "from": "3", + "to": "4" + } + } +} diff --git a/testutil/event.go b/testutil/event.go index 32e694c70f..0597fea6f9 100644 --- a/testutil/event.go +++ b/testutil/event.go @@ -8,7 +8,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" "github.com/akash-network/akash-api/go/sdkutil" ) diff --git a/testutil/ids.go b/testutil/ids.go index b3ab8f2379..6ed7fa10f7 100644 --- a/testutil/ids.go +++ b/testutil/ids.go @@ -11,7 +11,7 @@ import ( "github.com/tendermint/tendermint/crypto/ed25519" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) func Keyring(t testing.TB) keyring.Keyring { diff --git a/testutil/state/suite.go b/testutil/state/suite.go index 925c3fa39f..36d0f488a6 100644 --- a/testutil/state/suite.go +++ b/testutil/state/suite.go @@ -13,9 +13,7 @@ import ( dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" etypes "github.com/akash-network/akash-api/go/node/escrow/v1beta3" - - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" - + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" "github.com/akash-network/node/app" diff --git a/upgrades/CHANGELOG.md b/upgrades/CHANGELOG.md index 82eb780e75..ac59162e4e 100644 --- a/upgrades/CHANGELOG.md +++ b/upgrades/CHANGELOG.md @@ -12,7 +12,7 @@ | escrow | 2 | | agov | 1 | | inflation | 1 | -| market | 3 | +| market | 4 | | provider | 2 | | astaking | 1 | | take | 1 | @@ -43,6 +43,13 @@ Goal of the upgrade here Add new upgrades after this line based on the template above ----- +##### v0.28.0 + +1. Add resource offer for the bid, allowing providers to show details on the resources they offer, when order has wildcard resources, for example GPU. + +- Migrations + - market `3 -> 4` + ##### v0.26.0 1. Enforce **Minimum Validators commission** using onchain parameter. Default value is set to 5%. This is carry-over from v0.24.0 upgrade, as this change was dry-run diff --git a/upgrades/software/v0.28.0/init.go b/upgrades/software/v0.28.0/init.go new file mode 100644 index 0000000000..5a9247158e --- /dev/null +++ b/upgrades/software/v0.28.0/init.go @@ -0,0 +1,14 @@ +// Package v0_28_0 +// nolint revive +package v0_28_0 + +import ( + mv1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" + + utypes "github.com/akash-network/node/upgrades/types" +) + +func init() { + utypes.RegisterUpgrade(UpgradeName, initUpgrade) + utypes.RegisterMigration(mv1beta4.ModuleName, 3, newMarketMigration) +} diff --git a/upgrades/software/v0.28.0/market.go b/upgrades/software/v0.28.0/market.go new file mode 100644 index 0000000000..eab6909cc1 --- /dev/null +++ b/upgrades/software/v0.28.0/market.go @@ -0,0 +1,48 @@ +// Package v0_28_0 +// nolint revive +package v0_28_0 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkmodule "github.com/cosmos/cosmos-sdk/types/module" + + mv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + mmigrate "github.com/akash-network/akash-api/go/node/market/v1beta4/migrate" + + utypes "github.com/akash-network/node/upgrades/types" +) + +type marketMigrations struct { + utypes.Migrator +} + +func newMarketMigration(m utypes.Migrator) utypes.Migration { + return marketMigrations{Migrator: m} +} + +func (m marketMigrations) GetHandler() sdkmodule.MigrationHandler { + return m.handler +} + +// handler migrates deployment from version 2 to 3. +func (m marketMigrations) handler(ctx sdk.Context) error { + store := ctx.KVStore(m.StoreKey()) + + err := utypes.MigrateValue(store, m.Codec(), mv1beta3.BidPrefix(), migrateBid) + + if err != nil { + return err + } + + return nil +} + +func migrateBid(fromBz []byte, cdc codec.BinaryCodec) codec.ProtoMarshaler { + var oldObject mv1beta3.Bid + cdc.MustUnmarshal(fromBz, &oldObject) + + to := mmigrate.BidFromV1beta3(oldObject) + + return &to +} diff --git a/upgrades/software/v0.28.0/upgrade.go b/upgrades/software/v0.28.0/upgrade.go new file mode 100644 index 0000000000..30d7cb5813 --- /dev/null +++ b/upgrades/software/v0.28.0/upgrade.go @@ -0,0 +1,54 @@ +// Package v0_28_0 +// nolint revive +package v0_28_0 + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/authz" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + apptypes "github.com/akash-network/node/app/types" + utypes "github.com/akash-network/node/upgrades/types" +) + +const ( + UpgradeName = "v0.28.0" +) + +type upgrade struct { + *apptypes.App + log log.Logger +} + +var _ utypes.IUpgrade = (*upgrade)(nil) + +func initUpgrade(log log.Logger, app *apptypes.App) (utypes.IUpgrade, error) { + up := &upgrade{ + App: app, + log: log.With("module", fmt.Sprintf("upgrade/%s", UpgradeName)), + } + + return up, nil +} + +func (up *upgrade) StoreLoader() *storetypes.StoreUpgrades { + return &storetypes.StoreUpgrades{} +} + +func (up *upgrade) UpgradeHandler() upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + return up.MM.RunMigrations(ctx, up.Configurator, fromVM) + } +} + +type grantBackup struct { + granter sdk.AccAddress + grantee sdk.AccAddress + grant authz.Grant +} diff --git a/upgrades/upgrades.go b/upgrades/upgrades.go index e5d26fa708..8ded4751df 100644 --- a/upgrades/upgrades.go +++ b/upgrades/upgrades.go @@ -1,6 +1,8 @@ package upgrades import ( + // nolint: revive + _ "github.com/akash-network/node/upgrades/software/v0.28.0" // nolint: revive _ "github.com/akash-network/node/upgrades/software/v0.26.0" // nolint: revive diff --git a/x/deployment/handler/keepers.go b/x/deployment/handler/keepers.go index 0cf12a4ea4..4d0e31d086 100644 --- a/x/deployment/handler/keepers.go +++ b/x/deployment/handler/keepers.go @@ -9,7 +9,7 @@ import ( types "github.com/akash-network/akash-api/go/node/deployment/v1beta3" etypes "github.com/akash-network/akash-api/go/node/escrow/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // MarketKeeper Interface includes market methods diff --git a/x/escrow/client/cli/query.go b/x/escrow/client/cli/query.go index 3ed4c837cd..e03a6505a5 100644 --- a/x/escrow/client/cli/query.go +++ b/x/escrow/client/cli/query.go @@ -14,7 +14,7 @@ import ( deploymentTypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" types "github.com/akash-network/akash-api/go/node/escrow/v1beta3" - marketTypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + marketTypes "github.com/akash-network/akash-api/go/node/market/v1beta4" netutil "github.com/akash-network/node/util/network" "github.com/akash-network/node/x/deployment/client/cli" diff --git a/x/market/alias.go b/x/market/alias.go index cdf2fc16e9..322a46ab0b 100644 --- a/x/market/alias.go +++ b/x/market/alias.go @@ -1,7 +1,7 @@ package market import ( - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/x/market/keeper" ) diff --git a/x/market/client/cli/bid.go b/x/market/client/cli/bid.go index 635670f779..21d5b01b63 100644 --- a/x/market/client/cli/bid.go +++ b/x/market/client/cli/bid.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) func cmdGetBids() *cobra.Command { diff --git a/x/market/client/cli/cli_test.go b/x/market/client/cli/cli_test.go index 33915325bc..d93046861b 100644 --- a/x/market/client/cli/cli_test.go +++ b/x/market/client/cli/cli_test.go @@ -16,7 +16,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" "github.com/akash-network/node/testutil" diff --git a/x/market/client/cli/flags.go b/x/market/client/cli/flags.go index 56aaeee5e9..1e4e8489dd 100644 --- a/x/market/client/cli/flags.go +++ b/x/market/client/cli/flags.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" dcli "github.com/akash-network/node/x/deployment/client/cli" ) diff --git a/x/market/client/cli/grpc_rest_test.go b/x/market/client/cli/grpc_rest_test.go index 9c4dde3f29..1f412cfe7d 100644 --- a/x/market/client/cli/grpc_rest_test.go +++ b/x/market/client/cli/grpc_rest_test.go @@ -15,11 +15,10 @@ import ( sdkrest "github.com/cosmos/cosmos-sdk/types/rest" bankcli "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/testutil" "github.com/akash-network/node/testutil/network" - atypes "github.com/akash-network/node/types" ccli "github.com/akash-network/node/x/cert/client/cli" dcli "github.com/akash-network/node/x/deployment/client/cli" "github.com/akash-network/node/x/market/client/cli" @@ -214,7 +213,7 @@ func (s *GRPCRestTestSuite) TestGetOrders() { }{ { "get orders without filters", - fmt.Sprintf("%s/akash/market/%s/orders/list", val.APIAddress, atypes.ProtoAPIVersion), + fmt.Sprintf("%s/akash/market/%s/orders/list", val.APIAddress, types.APIVersion), false, order, 1, @@ -222,7 +221,7 @@ func (s *GRPCRestTestSuite) TestGetOrders() { { "get orders with filters", fmt.Sprintf("%s/akash/market/%s/orders/list?filters.owner=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, order.OrderID.Owner), false, order, @@ -231,7 +230,7 @@ func (s *GRPCRestTestSuite) TestGetOrders() { { "get orders with wrong state filter", fmt.Sprintf("%s/akash/market/%s/orders/list?filters.state=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, types.OrderStateInvalid.String()), true, types.Order{}, @@ -240,7 +239,7 @@ func (s *GRPCRestTestSuite) TestGetOrders() { { "get orders with two filters", fmt.Sprintf("%s/akash/market/%s/orders/list?filters.state=%s&filters.oseq=%d", - val.APIAddress, atypes.ProtoAPIVersion, order.State.String(), order.OrderID.OSeq), + val.APIAddress, types.APIVersion, order.State.String(), order.OrderID.OSeq), false, order, 1, @@ -280,14 +279,14 @@ func (s *GRPCRestTestSuite) TestGetOrder() { }{ { "get order with empty input", - fmt.Sprintf("%s/akash/market/%s/orders/info", val.APIAddress, atypes.ProtoAPIVersion), + fmt.Sprintf("%s/akash/market/%s/orders/info", val.APIAddress, types.APIVersion), true, types.Order{}, }, { "get order with invalid input", fmt.Sprintf("%s/akash/market/%s/orders/info?id.owner=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, order.OrderID.Owner), true, types.Order{}, @@ -296,7 +295,7 @@ func (s *GRPCRestTestSuite) TestGetOrder() { "order not found", fmt.Sprintf("%s/akash/market/%s/orders/info?id.owner=%s&id.dseq=%d&id.gseq=%d&id.oseq=%d", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, order.OrderID.Owner, 249, 32, 235), true, types.Order{}, @@ -305,7 +304,7 @@ func (s *GRPCRestTestSuite) TestGetOrder() { "valid get order request", fmt.Sprintf("%s/akash/market/%s/orders/info?id.owner=%s&id.dseq=%d&id.gseq=%d&id.oseq=%d", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, order.OrderID.Owner, order.OrderID.DSeq, order.OrderID.GSeq, @@ -347,7 +346,7 @@ func (s *GRPCRestTestSuite) TestGetBids() { }{ { "get bids without filters", - fmt.Sprintf("%s/akash/market/%s/bids/list", val.APIAddress, atypes.ProtoAPIVersion), + fmt.Sprintf("%s/akash/market/%s/bids/list", val.APIAddress, types.APIVersion), false, bid, 1, @@ -356,7 +355,7 @@ func (s *GRPCRestTestSuite) TestGetBids() { "get bids with filters", fmt.Sprintf("%s/akash/market/%s/bids/list?filters.owner=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, bid.BidID.Owner), false, bid, @@ -366,7 +365,7 @@ func (s *GRPCRestTestSuite) TestGetBids() { "get bids with wrong state filter", fmt.Sprintf("%s/akash/market/%s/bids/list?filters.state=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, types.BidStateInvalid.String()), true, types.Bid{}, @@ -376,7 +375,7 @@ func (s *GRPCRestTestSuite) TestGetBids() { "get bids with more filters", fmt.Sprintf("%s/akash/market/%s/bids/list?filters.state=%s&filters.oseq=%d&filters.provider=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, bid.State.String(), bid.BidID.OSeq, bid.BidID.Provider), @@ -419,7 +418,7 @@ func (s *GRPCRestTestSuite) TestGetBid() { }{ { "get bid with empty input", - fmt.Sprintf("%s/akash/market/%s/bids/info", val.APIAddress, atypes.ProtoAPIVersion), + fmt.Sprintf("%s/akash/market/%s/bids/info", val.APIAddress, types.APIVersion), true, types.Bid{}, }, @@ -427,7 +426,7 @@ func (s *GRPCRestTestSuite) TestGetBid() { "get bid with invalid input", fmt.Sprintf("%s/akash/market/%s/bids/info?id.owner=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, bid.BidID.Owner), true, types.Bid{}, @@ -436,7 +435,7 @@ func (s *GRPCRestTestSuite) TestGetBid() { "bid not found", fmt.Sprintf("%s/akash/market/%s/bids/info?id.owner=%s&id.dseq=%d&id.gseq=%d&id.oseq=%d&id.provider=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, bid.BidID.Provider, 249, 32, @@ -449,7 +448,7 @@ func (s *GRPCRestTestSuite) TestGetBid() { "valid get bid request", fmt.Sprintf("%s/akash/market/%s/bids/info?id.owner=%s&id.dseq=%d&id.gseq=%d&id.oseq=%d&id.provider=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, bid.BidID.Owner, bid.BidID.DSeq, bid.BidID.GSeq, @@ -492,7 +491,7 @@ func (s *GRPCRestTestSuite) TestGetLeases() { }{ { "get leases without filters", - fmt.Sprintf("%s/akash/market/%s/leases/list", val.APIAddress, atypes.ProtoAPIVersion), + fmt.Sprintf("%s/akash/market/%s/leases/list", val.APIAddress, types.APIVersion), false, lease, 1, @@ -501,7 +500,7 @@ func (s *GRPCRestTestSuite) TestGetLeases() { "get leases with filters", fmt.Sprintf("%s/akash/market/%s/leases/list?filters.owner=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, lease.LeaseID.Owner), false, lease, @@ -511,7 +510,7 @@ func (s *GRPCRestTestSuite) TestGetLeases() { "get leases with wrong state filter", fmt.Sprintf("%s/akash/market/%s/leases/list?filters.state=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, types.LeaseStateInvalid.String()), true, types.Lease{}, @@ -521,7 +520,7 @@ func (s *GRPCRestTestSuite) TestGetLeases() { "get leases with more filters", fmt.Sprintf("%s/akash/market/%s/leases/list?filters.state=%s&filters.oseq=%d&filters.provider=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, lease.State.String(), lease.LeaseID.OSeq, lease.LeaseID.Provider), @@ -564,7 +563,7 @@ func (s *GRPCRestTestSuite) TestGetLease() { }{ { "get lease with empty input", - fmt.Sprintf("%s/akash/market/%s/leases/info", val.APIAddress, atypes.ProtoAPIVersion), + fmt.Sprintf("%s/akash/market/%s/leases/info", val.APIAddress, types.APIVersion), true, types.Lease{}, }, @@ -572,7 +571,7 @@ func (s *GRPCRestTestSuite) TestGetLease() { "get lease with invalid input", fmt.Sprintf("%s/akash/market/%s/leases/info?id.owner=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, lease.LeaseID.Owner), true, types.Lease{}, @@ -581,7 +580,7 @@ func (s *GRPCRestTestSuite) TestGetLease() { "lease not found", fmt.Sprintf("%s/akash/market/%s/leases/info?id.owner=%s&id.dseq=%d&id.gseq=%d&id.oseq=%d&id.provider=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, lease.LeaseID.Provider, 249, 32, @@ -594,7 +593,7 @@ func (s *GRPCRestTestSuite) TestGetLease() { "valid get lease request", fmt.Sprintf("%s/akash/market/%s/leases/info?id.owner=%s&id.dseq=%d&id.gseq=%d&id.oseq=%d&id.provider=%s", val.APIAddress, - atypes.ProtoAPIVersion, + types.APIVersion, lease.LeaseID.Owner, lease.LeaseID.DSeq, lease.LeaseID.GSeq, diff --git a/x/market/client/cli/lease.go b/x/market/client/cli/lease.go index fc608b85c7..4ebca2dae7 100644 --- a/x/market/client/cli/lease.go +++ b/x/market/client/cli/lease.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) func cmdGetLeases() *cobra.Command { diff --git a/x/market/client/cli/order.go b/x/market/client/cli/order.go index 63cca80da4..50ac4174e3 100644 --- a/x/market/client/cli/order.go +++ b/x/market/client/cli/order.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) func cmdGetOrders() *cobra.Command { diff --git a/x/market/client/cli/query.go b/x/market/client/cli/query.go index eb28061163..bd6f984fab 100644 --- a/x/market/client/cli/query.go +++ b/x/market/client/cli/query.go @@ -4,7 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // GetQueryCmd returns the transaction commands for the market module diff --git a/x/market/client/cli/test_helpers.go b/x/market/client/cli/test_helpers.go index 0461cc6805..ac87c1615e 100644 --- a/x/market/client/cli/test_helpers.go +++ b/x/market/client/cli/test_helpers.go @@ -7,7 +7,7 @@ import ( sdktest "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // XXX: WHY TF DON'T THESE RETURN OBJECTS diff --git a/x/market/client/cli/tx.go b/x/market/client/cli/tx.go index a7cb978ad0..b932f4ec68 100644 --- a/x/market/client/cli/tx.go +++ b/x/market/client/cli/tx.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/client/broadcaster" "github.com/akash-network/node/cmd/common" diff --git a/x/market/client/rest/params.go b/x/market/client/rest/params.go index 60e5f992ea..c737e10a82 100644 --- a/x/market/client/rest/params.go +++ b/x/market/client/rest/params.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" drest "github.com/akash-network/node/x/deployment/client/rest" "github.com/akash-network/node/x/market/query" diff --git a/x/market/genesis.go b/x/market/genesis.go index b852b5141a..b38e25f1b2 100644 --- a/x/market/genesis.go +++ b/x/market/genesis.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/tendermint/tendermint/abci/types" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/x/market/keeper" ) diff --git a/x/market/handler/handler.go b/x/market/handler/handler.go index f08f7027e5..8681a0cc5f 100644 --- a/x/market/handler/handler.go +++ b/x/market/handler/handler.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // NewHandler returns a handler for "market" type messages diff --git a/x/market/handler/handler_test.go b/x/market/handler/handler_test.go index e868e40658..093b06a59d 100644 --- a/x/market/handler/handler_test.go +++ b/x/market/handler/handler_test.go @@ -14,10 +14,8 @@ import ( "github.com/tendermint/tendermint/libs/rand" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" - + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" - akashtypes "github.com/akash-network/akash-api/go/node/types/v1beta3" "github.com/akash-network/node/testutil" diff --git a/x/market/handler/server.go b/x/market/handler/server.go index b50fd13835..6bdae78c2b 100644 --- a/x/market/handler/server.go +++ b/x/market/handler/server.go @@ -8,10 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" atypes "github.com/akash-network/akash-api/go/node/audit/v1beta3" - dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" - + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" ) diff --git a/x/market/hooks/external.go b/x/market/hooks/external.go index bd0f9f3d0d..5ccdabf728 100644 --- a/x/market/hooks/external.go +++ b/x/market/hooks/external.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) type DeploymentKeeper interface { diff --git a/x/market/hooks/hooks.go b/x/market/hooks/hooks.go index 967ae72f5a..b4ea5eec68 100644 --- a/x/market/hooks/hooks.go +++ b/x/market/hooks/hooks.go @@ -6,7 +6,7 @@ import ( dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" etypes "github.com/akash-network/akash-api/go/node/escrow/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) type Hooks interface { diff --git a/x/market/keeper/grpc_query.go b/x/market/keeper/grpc_query.go index cd457c04f9..eeb455acc2 100644 --- a/x/market/keeper/grpc_query.go +++ b/x/market/keeper/grpc_query.go @@ -11,9 +11,9 @@ import ( sdkquery "github.com/cosmos/cosmos-sdk/types/query" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" - keys "github.com/akash-network/node/x/market/keeper/keys/v1beta3" + keys "github.com/akash-network/node/x/market/keeper/keys/v1beta4" ) // Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper diff --git a/x/market/keeper/grpc_query_test.go b/x/market/keeper/grpc_query_test.go index 4dd83a7daa..b0bfeedd52 100644 --- a/x/market/keeper/grpc_query_test.go +++ b/x/market/keeper/grpc_query_test.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkquery "github.com/cosmos/cosmos-sdk/types/query" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/testutil" "github.com/akash-network/node/testutil/state" diff --git a/x/market/keeper/keeper.go b/x/market/keeper/keeper.go index 40899e09bc..be37d7e93e 100644 --- a/x/market/keeper/keeper.go +++ b/x/market/keeper/keeper.go @@ -8,9 +8,9 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" - keys "github.com/akash-network/node/x/market/keeper/keys/v1beta3" + keys "github.com/akash-network/node/x/market/keeper/keys/v1beta4" ) // TODO: use interface for all keepers, queriers diff --git a/x/market/keeper/keeper_test.go b/x/market/keeper/keeper_test.go index 5b786c566d..846080b7f0 100644 --- a/x/market/keeper/keeper_test.go +++ b/x/market/keeper/keeper_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/testutil" "github.com/akash-network/node/testutil/state" diff --git a/x/market/keeper/keys/v1beta4/key.go b/x/market/keeper/keys/v1beta4/key.go new file mode 100644 index 0000000000..7892692a88 --- /dev/null +++ b/x/market/keeper/keys/v1beta4/key.go @@ -0,0 +1,164 @@ +package v1beta4 + +import ( + "bytes" + "encoding/binary" + + "github.com/cosmos/cosmos-sdk/types/address" + + dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" + "github.com/akash-network/akash-api/go/sdkutil" +) + +func filterToPrefix(prefix []byte, owner string, dseq uint64, gseq, oseq uint32, provider string) ([]byte, error) { + buf := bytes.NewBuffer(prefix) + + if len(owner) == 0 { + return buf.Bytes(), nil + } + + if _, err := buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(owner))); err != nil { + return nil, err + } + + if dseq == 0 { + return buf.Bytes(), nil + } + if err := binary.Write(buf, binary.BigEndian, dseq); err != nil { + return nil, err + } + + if gseq == 0 { + return buf.Bytes(), nil + } + if err := binary.Write(buf, binary.BigEndian, gseq); err != nil { + return nil, err + } + + if oseq == 0 { + return buf.Bytes(), nil + } + if err := binary.Write(buf, binary.BigEndian, oseq); err != nil { + return nil, err + } + + if len(provider) == 0 { + return buf.Bytes(), nil + } + + if _, err := buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(provider))); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} + +func OrderPrefixFromFilter(f types.OrderFilters) ([]byte, error) { + return filterToPrefix(types.OrderPrefix(), f.Owner, f.DSeq, f.GSeq, f.OSeq, "") +} + +func LeasePrefixFromFilter(f types.LeaseFilters) ([]byte, bool, error) { + prefix, err := filterToPrefix(types.LeasePrefix(), f.Owner, f.DSeq, f.GSeq, f.OSeq, f.Provider) + return prefix, false, err +} + +func BidPrefixFromFilter(f types.BidFilters) ([]byte, error) { + return filterToPrefix(types.BidPrefix(), f.Owner, f.DSeq, f.GSeq, f.OSeq, f.Provider) +} + +func OrderKey(id types.OrderID) []byte { + buf := bytes.NewBuffer(types.OrderPrefix()) + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Owner))) + if err := binary.Write(buf, binary.BigEndian, id.DSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.GSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.OSeq); err != nil { + panic(err) + } + return buf.Bytes() +} + +func BidKey(id types.BidID) []byte { + buf := bytes.NewBuffer(types.BidPrefix()) + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Owner))) + if err := binary.Write(buf, binary.BigEndian, id.DSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.GSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.OSeq); err != nil { + panic(err) + } + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Provider))) + return buf.Bytes() +} + +func LeaseKey(id types.LeaseID) []byte { + buf := bytes.NewBuffer(types.LeasePrefix()) + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Owner))) + if err := binary.Write(buf, binary.BigEndian, id.DSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.GSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.OSeq); err != nil { + panic(err) + } + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Provider))) + return buf.Bytes() +} + +func secondaryLeaseKeyByProvider(id types.LeaseID) []byte { + buf := bytes.NewBuffer(types.SecondaryLeasePrefix()) + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Provider))) + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Owner))) + if err := binary.Write(buf, binary.BigEndian, id.DSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.GSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.OSeq); err != nil { + panic(err) + } + return buf.Bytes() +} + +func SecondaryKeysForLease(id types.LeaseID) [][]byte { + return [][]byte{ + secondaryLeaseKeyByProvider(id), + } +} + +func OrdersForGroupPrefix(id dtypes.GroupID) []byte { + buf := bytes.NewBuffer(types.OrderPrefix()) + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Owner))) + if err := binary.Write(buf, binary.BigEndian, id.DSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.GSeq); err != nil { + panic(err) + } + return buf.Bytes() +} + +func BidsForOrderPrefix(id types.OrderID) []byte { + buf := bytes.NewBuffer(types.BidPrefix()) + buf.Write(address.MustLengthPrefix(sdkutil.MustAccAddressFromBech32(id.Owner))) + if err := binary.Write(buf, binary.BigEndian, id.DSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.GSeq); err != nil { + panic(err) + } + if err := binary.Write(buf, binary.BigEndian, id.OSeq); err != nil { + panic(err) + } + return buf.Bytes() +} diff --git a/x/market/keeper/keys/v1beta4/key_test.go b/x/market/keeper/keys/v1beta4/key_test.go new file mode 100644 index 0000000000..08752aef99 --- /dev/null +++ b/x/market/keeper/keys/v1beta4/key_test.go @@ -0,0 +1,35 @@ +package v1beta4_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + _ "github.com/akash-network/node/testutil" + + types "github.com/akash-network/akash-api/go/node/market/v1beta4" + + keys "github.com/akash-network/node/x/market/keeper/keys/v1beta4" +) + +func TestKeysAndSecondaryKeysFilter(t *testing.T) { + filter := types.LeaseFilters{ + Owner: "akash104fq56d9attl4m709h7mgx9lwqklnh05fhy5nu", + DSeq: 1, + GSeq: 2, + OSeq: 3, + Provider: "akash1vlaa09ytnl0hvu04wgs0d6zw5n6anjc3allk49", + State: types.LeaseClosed.String(), + } + + prefix, isSecondary, err := keys.LeasePrefixFromFilter(filter) + require.NoError(t, err) + require.False(t, isSecondary) + require.Equal(t, types.LeasePrefix(), prefix[0:2]) + + filter.Owner = "" + prefix, isSecondary, err = keys.LeasePrefixFromFilter(filter) + require.NoError(t, err) + require.False(t, isSecondary) + require.Equal(t, types.LeasePrefix(), prefix[0:2]) +} diff --git a/x/market/module.go b/x/market/module.go index 9b4c02006c..c724c0c372 100644 --- a/x/market/module.go +++ b/x/market/module.go @@ -23,7 +23,8 @@ import ( v1beta1types "github.com/akash-network/akash-api/go/node/market/v1beta1" v1beta2types "github.com/akash-network/akash-api/go/node/market/v1beta2" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + v1beta3types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" utypes "github.com/akash-network/node/upgrades/types" akeeper "github.com/akash-network/node/x/audit/keeper" @@ -59,6 +60,7 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { // RegisterInterfaces registers the module's interface types func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { types.RegisterInterfaces(registry) + v1beta3types.RegisterInterfaces(registry) v1beta2types.RegisterInterfaces(registry) v1beta1types.RegisterInterfaces(registry) } diff --git a/x/market/query/client.go b/x/market/query/client.go index 5611ecab6e..189c67c719 100644 --- a/x/market/query/client.go +++ b/x/market/query/client.go @@ -1,7 +1,7 @@ package query import ( - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // Client interface diff --git a/x/market/query/path.go b/x/market/query/path.go index 21fb0089f7..d4dd876049 100644 --- a/x/market/query/path.go +++ b/x/market/query/path.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" dpath "github.com/akash-network/node/x/deployment/query" ) @@ -101,7 +101,7 @@ func parseBidPath(parts []string) (types.BidID, error) { return types.MakeBidID(oid, provider), nil } -// parseLeasePath returns leaseID details with provided queries, and return +// ParseLeasePath returns leaseID details with provided queries, and return // error if occurred due to wrong query func ParseLeasePath(parts []string) (types.LeaseID, error) { bid, err := parseBidPath(parts) diff --git a/x/market/query/rawclient.go b/x/market/query/rawclient.go index dac05131a6..da2e6c713b 100644 --- a/x/market/query/rawclient.go +++ b/x/market/query/rawclient.go @@ -5,7 +5,7 @@ import ( sdkclient "github.com/cosmos/cosmos-sdk/client" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // RawClient interface diff --git a/x/market/query/types.go b/x/market/query/types.go index 5a9aca06d0..2087a20ec8 100644 --- a/x/market/query/types.go +++ b/x/market/query/types.go @@ -3,7 +3,7 @@ package query import ( sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) type ( diff --git a/x/market/simulation/genesis.go b/x/market/simulation/genesis.go index 763579ca5e..f6cf09d027 100644 --- a/x/market/simulation/genesis.go +++ b/x/market/simulation/genesis.go @@ -4,7 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ) var minDeposit, _ = dtypes.DefaultParams().MinDepositFor("uakt") diff --git a/x/market/simulation/operations.go b/x/market/simulation/operations.go index 3a86db5320..cc3a19a02e 100644 --- a/x/market/simulation/operations.go +++ b/x/market/simulation/operations.go @@ -15,7 +15,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" appparams "github.com/akash-network/node/app/params" testsim "github.com/akash-network/node/testutil/sim" diff --git a/x/market/simulation/utils.go b/x/market/simulation/utils.go index 0117675b77..5a9f60be88 100644 --- a/x/market/simulation/utils.go +++ b/x/market/simulation/utils.go @@ -3,7 +3,7 @@ package simulation import ( sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" diff --git a/x/provider/handler/server.go b/x/provider/handler/server.go index 2618cade61..ca783b8364 100644 --- a/x/provider/handler/server.go +++ b/x/provider/handler/server.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" types "github.com/akash-network/akash-api/go/node/provider/v1beta3"