diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts index 2730923e0f..525f64b6b0 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts @@ -157,16 +157,28 @@ export interface QueryNextMarketIdRequest {} /** QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` */ export interface QueryNextMarketIdRequestSDKType {} -/** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ +/** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ export interface QueryNextMarketIdResponse { - /** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + /** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ nextMarketId: number; } -/** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ +/** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ export interface QueryNextMarketIdResponseSDKType { - /** QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` */ + /** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ next_market_id: number; } diff --git a/proto/dydxprotocol/perpetuals/query.proto b/proto/dydxprotocol/perpetuals/query.proto index b849a707fd..b69c442050 100644 --- a/proto/dydxprotocol/perpetuals/query.proto +++ b/proto/dydxprotocol/perpetuals/query.proto @@ -46,7 +46,8 @@ service Query { } // Queries the next perpetual id. - rpc NextPerpetualId(QueryNextPerpetualIdRequest) returns (QueryNextPerpetualIdResponse) { + rpc NextPerpetualId(QueryNextPerpetualIdRequest) + returns (QueryNextPerpetualIdResponse) { option (google.api.http).get = "/dydxprotocol/perpetuals/next_perpetual_id"; } } diff --git a/proto/dydxprotocol/prices/query.proto b/proto/dydxprotocol/prices/query.proto index 1fc4ef1f07..fc55b304e8 100644 --- a/proto/dydxprotocol/prices/query.proto +++ b/proto/dydxprotocol/prices/query.proto @@ -34,7 +34,8 @@ service Query { } // Queries the next market id. - rpc NextMarketId(QueryNextMarketIdRequest) returns (QueryNextMarketIdResponse) { + rpc NextMarketId(QueryNextMarketIdRequest) + returns (QueryNextMarketIdResponse) { option (google.api.http).get = "/dydxprotocol/prices/next_market_id"; } } @@ -88,5 +89,6 @@ message QueryAllMarketParamsResponse { // QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` message QueryNextMarketIdRequest {} -// QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` +// QueryNextMarketIdResponse is response type for the Query/Params +// `NextMarketId` message QueryNextMarketIdResponse { uint32 next_market_id = 1; } diff --git a/protocol/mocks/ClobKeeper.go b/protocol/mocks/ClobKeeper.go index 2a7b5cfd9c..4b786d6b81 100644 --- a/protocol/mocks/ClobKeeper.go +++ b/protocol/mocks/ClobKeeper.go @@ -1134,6 +1134,11 @@ func (_m *ClobKeeper) SetLongTermOrderPlacement(ctx types.Context, order clobtyp _m.Called(ctx, order, blockHeight) } +// SetNextClobPairID provides a mock function with given fields: ctx, nextID +func (_m *ClobKeeper) SetNextClobPairID(ctx types.Context, nextID uint32) { + _m.Called(ctx, nextID) +} + // UnsafeMigrateOrderExpirationState provides a mock function with given fields: ctx func (_m *ClobKeeper) UnsafeMigrateOrderExpirationState(ctx types.Context) { _m.Called(ctx) diff --git a/protocol/mocks/PerpetualsKeeper.go b/protocol/mocks/PerpetualsKeeper.go index 38721a5f1e..e856f54ced 100644 --- a/protocol/mocks/PerpetualsKeeper.go +++ b/protocol/mocks/PerpetualsKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.44.1. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks @@ -393,6 +393,11 @@ func (_m *PerpetualsKeeper) SetLiquidityTier(ctx types.Context, id uint32, name return r0, r1 } +// SetNextPerpetualID provides a mock function with given fields: ctx, nextID +func (_m *PerpetualsKeeper) SetNextPerpetualID(ctx types.Context, nextID uint32) { + _m.Called(ctx, nextID) +} + // SetParams provides a mock function with given fields: ctx, params func (_m *PerpetualsKeeper) SetParams(ctx types.Context, params perpetualstypes.Params) error { ret := _m.Called(ctx, params) @@ -469,4 +474,4 @@ func NewPerpetualsKeeper(t interface { t.Cleanup(func() { mock.AssertExpectations(t) }) return mock -} \ No newline at end of file +} diff --git a/protocol/mocks/PricesKeeper.go b/protocol/mocks/PricesKeeper.go index 4776407623..6f7a512119 100644 --- a/protocol/mocks/PricesKeeper.go +++ b/protocol/mocks/PricesKeeper.go @@ -418,6 +418,11 @@ func (_m *PricesKeeper) PerformStatefulPriceUpdateValidation(ctx types.Context, return r0 } +// SetNextMarketID provides a mock function with given fields: ctx, nextID +func (_m *PricesKeeper) SetNextMarketID(ctx types.Context, nextID uint32) { + _m.Called(ctx, nextID) +} + // UpdateMarketPrices provides a mock function with given fields: ctx, updates func (_m *PricesKeeper) UpdateMarketPrices(ctx types.Context, updates []*pricestypes.MsgUpdateMarketPrices_MarketPrice) error { ret := _m.Called(ctx, updates) diff --git a/protocol/mocks/QueryClient.go b/protocol/mocks/QueryClient.go index e8c611ebb3..862029d0bd 100644 --- a/protocol/mocks/QueryClient.go +++ b/protocol/mocks/QueryClient.go @@ -696,6 +696,117 @@ func (_m *QueryClient) MevNodeToNodeCalculation(ctx context.Context, in *clobtyp return r0, r1 } +// NextClobPairId provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) NextClobPairId(ctx context.Context, in *clobtypes.QueryNextClobPairIdRequest, opts ...grpc.CallOption) (*clobtypes.QueryNextClobPairIdResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for NextClobPairId") + } + + var r0 *clobtypes.QueryNextClobPairIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryNextClobPairIdRequest, ...grpc.CallOption) (*clobtypes.QueryNextClobPairIdResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *clobtypes.QueryNextClobPairIdRequest, ...grpc.CallOption) *clobtypes.QueryNextClobPairIdResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*clobtypes.QueryNextClobPairIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *clobtypes.QueryNextClobPairIdRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NextMarketId provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) NextMarketId(ctx context.Context, in *pricestypes.QueryNextMarketIdRequest, opts ...grpc.CallOption) (*pricestypes.QueryNextMarketIdResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for NextMarketId") + } + + var r0 *pricestypes.QueryNextMarketIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *pricestypes.QueryNextMarketIdRequest, ...grpc.CallOption) (*pricestypes.QueryNextMarketIdResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *pricestypes.QueryNextMarketIdRequest, ...grpc.CallOption) *pricestypes.QueryNextMarketIdResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*pricestypes.QueryNextMarketIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *pricestypes.QueryNextMarketIdRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NextPerpetualId provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) NextPerpetualId(ctx context.Context, in *perpetualstypes.QueryNextPerpetualIdRequest, opts ...grpc.CallOption) (*perpetualstypes.QueryNextPerpetualIdResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for NextPerpetualId") + } + + var r0 *perpetualstypes.QueryNextPerpetualIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *perpetualstypes.QueryNextPerpetualIdRequest, ...grpc.CallOption) (*perpetualstypes.QueryNextPerpetualIdResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *perpetualstypes.QueryNextPerpetualIdRequest, ...grpc.CallOption) *perpetualstypes.QueryNextPerpetualIdResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*perpetualstypes.QueryNextPerpetualIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *perpetualstypes.QueryNextPerpetualIdRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // Params provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) Params(ctx context.Context, in *perpetualstypes.QueryParamsRequest, opts ...grpc.CallOption) (*perpetualstypes.QueryParamsResponse, error) { _va := make([]interface{}, len(opts)) diff --git a/protocol/mocks/QueryServer.go b/protocol/mocks/QueryServer.go index 4a7770a920..2e1187a66b 100644 --- a/protocol/mocks/QueryServer.go +++ b/protocol/mocks/QueryServer.go @@ -135,6 +135,36 @@ func (_m *QueryServer) MarketPrice(_a0 context.Context, _a1 *types.QueryMarketPr return r0, r1 } +// NextMarketId provides a mock function with given fields: _a0, _a1 +func (_m *QueryServer) NextMarketId(_a0 context.Context, _a1 *types.QueryNextMarketIdRequest) (*types.QueryNextMarketIdResponse, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for NextMarketId") + } + + var r0 *types.QueryNextMarketIdResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryNextMarketIdRequest) (*types.QueryNextMarketIdResponse, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryNextMarketIdRequest) *types.QueryNextMarketIdResponse); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QueryNextMarketIdResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.QueryNextMarketIdRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewQueryServer creates a new instance of QueryServer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewQueryServer(t interface { diff --git a/protocol/x/prices/types/query.pb.go b/protocol/x/prices/types/query.pb.go index 9a5129fd11..dabafa6197 100644 --- a/protocol/x/prices/types/query.pb.go +++ b/protocol/x/prices/types/query.pb.go @@ -451,7 +451,8 @@ func (m *QueryNextMarketIdRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryNextMarketIdRequest proto.InternalMessageInfo -// QueryNextMarketIdResponse is response type for the Query/Params `NextMarketId` +// QueryNextMarketIdResponse is response type for the Query/Params +// `NextMarketId` type QueryNextMarketIdResponse struct { NextMarketId uint32 `protobuf:"varint,1,opt,name=next_market_id,json=nextMarketId,proto3" json:"next_market_id,omitempty"` }