diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts index 4ef29497240..034cbad3db2 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryGetClobPairRequest, QueryClobPairResponseSDKType, QueryAllClobPairRequest, QueryClobPairAllResponseSDKType, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponseSDKType, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponseSDKType, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponseSDKType } from "./query"; +import { QueryGetClobPairRequest, QueryClobPairResponseSDKType, QueryAllClobPairRequest, QueryClobPairAllResponseSDKType, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponseSDKType, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponseSDKType, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponseSDKType, QueryNextClobPairIdRequest, QueryNextClobPairIdResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -15,6 +15,7 @@ export class LCDQueryClient { this.equityTierLimitConfiguration = this.equityTierLimitConfiguration.bind(this); this.blockRateLimitConfiguration = this.blockRateLimitConfiguration.bind(this); this.liquidationsConfiguration = this.liquidationsConfiguration.bind(this); + this.nextClobPairId = this.nextClobPairId.bind(this); } /* Queries a ClobPair by id. */ @@ -61,5 +62,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/clob/liquidations_config`; return await this.req.get(endpoint); } + /* Queries the next clob pair id. */ + + + async nextClobPairId(_params: QueryNextClobPairIdRequest = {}): Promise { + const endpoint = `dydxprotocol/clob/next_clob_pair_id`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts index 5f49481ef31..5c87afce0f1 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryGetClobPairRequest, QueryClobPairResponse, QueryAllClobPairRequest, QueryClobPairAllResponse, MevNodeToNodeCalculationRequest, MevNodeToNodeCalculationResponse, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponse, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponse, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponse, QueryStatefulOrderRequest, QueryStatefulOrderResponse, StreamOrderbookUpdatesRequest, StreamOrderbookUpdatesResponse } from "./query"; +import { QueryGetClobPairRequest, QueryClobPairResponse, QueryAllClobPairRequest, QueryClobPairAllResponse, MevNodeToNodeCalculationRequest, MevNodeToNodeCalculationResponse, QueryEquityTierLimitConfigurationRequest, QueryEquityTierLimitConfigurationResponse, QueryBlockRateLimitConfigurationRequest, QueryBlockRateLimitConfigurationResponse, QueryLiquidationsConfigurationRequest, QueryLiquidationsConfigurationResponse, QueryStatefulOrderRequest, QueryStatefulOrderResponse, QueryNextClobPairIdRequest, QueryNextClobPairIdResponse, StreamOrderbookUpdatesRequest, StreamOrderbookUpdatesResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -25,6 +25,9 @@ export interface Query { /** Queries the stateful order for a given order id. */ statefulOrder(request: QueryStatefulOrderRequest): Promise; + /** Queries the next clob pair id. */ + + nextClobPairId(request?: QueryNextClobPairIdRequest): Promise; /** * Streams orderbook updates. Updates contain orderbook data * such as order placements, updates, and fills. @@ -44,6 +47,7 @@ export class QueryClientImpl implements Query { this.blockRateLimitConfiguration = this.blockRateLimitConfiguration.bind(this); this.liquidationsConfiguration = this.liquidationsConfiguration.bind(this); this.statefulOrder = this.statefulOrder.bind(this); + this.nextClobPairId = this.nextClobPairId.bind(this); this.streamOrderbookUpdates = this.streamOrderbookUpdates.bind(this); } @@ -91,6 +95,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryStatefulOrderResponse.decode(new _m0.Reader(data))); } + nextClobPairId(request: QueryNextClobPairIdRequest = {}): Promise { + const data = QueryNextClobPairIdRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.clob.Query", "NextClobPairId", data); + return promise.then(data => QueryNextClobPairIdResponse.decode(new _m0.Reader(data))); + } + streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise { const data = StreamOrderbookUpdatesRequest.encode(request).finish(); const promise = this.rpc.request("dydxprotocol.clob.Query", "StreamOrderbookUpdates", data); @@ -130,6 +140,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.statefulOrder(request); }, + nextClobPairId(request?: QueryNextClobPairIdRequest): Promise { + return queryService.nextClobPairId(request); + }, + streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise { return queryService.streamOrderbookUpdates(request); } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts index acd51045280..b6032561973 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts @@ -246,6 +246,24 @@ export interface QueryLiquidationsConfigurationResponse { export interface QueryLiquidationsConfigurationResponseSDKType { liquidations_config?: LiquidationsConfigSDKType; } +/** QueryNextClobPairIdRequest is a request message for the next clob pair id */ + +export interface QueryNextClobPairIdRequest {} +/** QueryNextClobPairIdRequest is a request message for the next clob pair id */ + +export interface QueryNextClobPairIdRequestSDKType {} +/** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + +export interface QueryNextClobPairIdResponse { + /** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + nextClobPairId: number; +} +/** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + +export interface QueryNextClobPairIdResponseSDKType { + /** QueryNextClobPairIdResponse is a response message for the next clob pair id */ + next_clob_pair_id: number; +} /** * StreamOrderbookUpdatesRequest is a request message for the * StreamOrderbookUpdates method. @@ -1197,6 +1215,85 @@ export const QueryLiquidationsConfigurationResponse = { }; +function createBaseQueryNextClobPairIdRequest(): QueryNextClobPairIdRequest { + return {}; +} + +export const QueryNextClobPairIdRequest = { + encode(_: QueryNextClobPairIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextClobPairIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextClobPairIdRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QueryNextClobPairIdRequest { + const message = createBaseQueryNextClobPairIdRequest(); + return message; + } + +}; + +function createBaseQueryNextClobPairIdResponse(): QueryNextClobPairIdResponse { + return { + nextClobPairId: 0 + }; +} + +export const QueryNextClobPairIdResponse = { + encode(message: QueryNextClobPairIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextClobPairId !== 0) { + writer.uint32(8).uint32(message.nextClobPairId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextClobPairIdResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextClobPairIdResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.nextClobPairId = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryNextClobPairIdResponse { + const message = createBaseQueryNextClobPairIdResponse(); + message.nextClobPairId = object.nextClobPairId ?? 0; + return message; + } + +}; + function createBaseStreamOrderbookUpdatesRequest(): StreamOrderbookUpdatesRequest { return { clobPairId: [], diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts index bf75ee98d49..a0bdc49c4bd 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryPerpetualRequest, QueryPerpetualResponseSDKType, QueryAllPerpetualsRequest, QueryAllPerpetualsResponseSDKType, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponseSDKType, QueryPremiumVotesRequest, QueryPremiumVotesResponseSDKType, QueryPremiumSamplesRequest, QueryPremiumSamplesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +import { QueryPerpetualRequest, QueryPerpetualResponseSDKType, QueryAllPerpetualsRequest, QueryAllPerpetualsResponseSDKType, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponseSDKType, QueryPremiumVotesRequest, QueryPremiumVotesResponseSDKType, QueryPremiumSamplesRequest, QueryPremiumSamplesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryNextPerpetualIdRequest, QueryNextPerpetualIdResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -16,6 +16,7 @@ export class LCDQueryClient { this.premiumVotes = this.premiumVotes.bind(this); this.premiumSamples = this.premiumSamples.bind(this); this.params = this.params.bind(this); + this.nextPerpetualId = this.nextPerpetualId.bind(this); } /* Queries a Perpetual by id. */ @@ -79,5 +80,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/perpetuals/params`; return await this.req.get(endpoint); } + /* Queries the next perpetual id. */ + + + async nextPerpetualId(_params: QueryNextPerpetualIdRequest = {}): Promise { + const endpoint = `dydxprotocol/perpetuals/next_perpetual_id`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts index afd777b2df5..64c43f1b96b 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryPerpetualRequest, QueryPerpetualResponse, QueryAllPerpetualsRequest, QueryAllPerpetualsResponse, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponse, QueryPremiumVotesRequest, QueryPremiumVotesResponse, QueryPremiumSamplesRequest, QueryPremiumSamplesResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; +import { QueryPerpetualRequest, QueryPerpetualResponse, QueryAllPerpetualsRequest, QueryAllPerpetualsResponse, QueryAllLiquidityTiersRequest, QueryAllLiquidityTiersResponse, QueryPremiumVotesRequest, QueryPremiumVotesResponse, QueryPremiumSamplesRequest, QueryPremiumSamplesResponse, QueryParamsRequest, QueryParamsResponse, QueryNextPerpetualIdRequest, QueryNextPerpetualIdResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -22,6 +22,9 @@ export interface Query { /** Queries the perpetual params. */ params(request?: QueryParamsRequest): Promise; + /** Queries the next perpetual id. */ + + nextPerpetualId(request?: QueryNextPerpetualIdRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -34,6 +37,7 @@ export class QueryClientImpl implements Query { this.premiumVotes = this.premiumVotes.bind(this); this.premiumSamples = this.premiumSamples.bind(this); this.params = this.params.bind(this); + this.nextPerpetualId = this.nextPerpetualId.bind(this); } perpetual(request: QueryPerpetualRequest): Promise { @@ -76,6 +80,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); } + nextPerpetualId(request: QueryNextPerpetualIdRequest = {}): Promise { + const data = QueryNextPerpetualIdRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.perpetuals.Query", "NextPerpetualId", data); + return promise.then(data => QueryNextPerpetualIdResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -103,6 +113,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { params(request?: QueryParamsRequest): Promise { return queryService.params(request); + }, + + nextPerpetualId(request?: QueryNextPerpetualIdRequest): Promise { + return queryService.nextPerpetualId(request); } }; diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts index 4dda168b08b..8fd1e273c66 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/perpetuals/query.ts @@ -141,6 +141,24 @@ export interface QueryParamsResponse { export interface QueryParamsResponseSDKType { params?: ParamsSDKType; } +/** QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdRequest {} +/** QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdRequestSDKType {} +/** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdResponse { + /** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + nextPerpetualId: number; +} +/** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + +export interface QueryNextPerpetualIdResponseSDKType { + /** QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC */ + next_perpetual_id: number; +} function createBaseQueryPerpetualRequest(): QueryPerpetualRequest { return { @@ -667,4 +685,83 @@ export const QueryParamsResponse = { return message; } +}; + +function createBaseQueryNextPerpetualIdRequest(): QueryNextPerpetualIdRequest { + return {}; +} + +export const QueryNextPerpetualIdRequest = { + encode(_: QueryNextPerpetualIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextPerpetualIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextPerpetualIdRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QueryNextPerpetualIdRequest { + const message = createBaseQueryNextPerpetualIdRequest(); + return message; + } + +}; + +function createBaseQueryNextPerpetualIdResponse(): QueryNextPerpetualIdResponse { + return { + nextPerpetualId: 0 + }; +} + +export const QueryNextPerpetualIdResponse = { + encode(message: QueryNextPerpetualIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextPerpetualId !== 0) { + writer.uint32(8).uint32(message.nextPerpetualId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextPerpetualIdResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextPerpetualIdResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.nextPerpetualId = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryNextPerpetualIdResponse { + const message = createBaseQueryNextPerpetualIdResponse(); + message.nextPerpetualId = object.nextPerpetualId ?? 0; + return message; + } + }; \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts index 0f78eab48a6..aa78b042eec 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryMarketPriceRequest, QueryMarketPriceResponseSDKType, QueryAllMarketPricesRequest, QueryAllMarketPricesResponseSDKType, QueryMarketParamRequest, QueryMarketParamResponseSDKType, QueryAllMarketParamsRequest, QueryAllMarketParamsResponseSDKType } from "./query"; +import { QueryMarketPriceRequest, QueryMarketPriceResponseSDKType, QueryAllMarketPricesRequest, QueryAllMarketPricesResponseSDKType, QueryMarketParamRequest, QueryMarketParamResponseSDKType, QueryAllMarketParamsRequest, QueryAllMarketParamsResponseSDKType, QueryNextMarketIdRequest, QueryNextMarketIdResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -14,6 +14,7 @@ export class LCDQueryClient { this.allMarketPrices = this.allMarketPrices.bind(this); this.marketParam = this.marketParam.bind(this); this.allMarketParams = this.allMarketParams.bind(this); + this.nextMarketId = this.nextMarketId.bind(this); } /* Queries a MarketPrice by id. */ @@ -63,5 +64,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/prices/params/market`; return await this.req.get(endpoint, options); } + /* Queries the next market id. */ + + + async nextMarketId(_params: QueryNextMarketIdRequest = {}): Promise { + const endpoint = `dydxprotocol/prices/next_market_id`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts index 2c24a6d01a3..e6b955ad291 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryMarketPriceRequest, QueryMarketPriceResponse, QueryAllMarketPricesRequest, QueryAllMarketPricesResponse, QueryMarketParamRequest, QueryMarketParamResponse, QueryAllMarketParamsRequest, QueryAllMarketParamsResponse } from "./query"; +import { QueryMarketPriceRequest, QueryMarketPriceResponse, QueryAllMarketPricesRequest, QueryAllMarketPricesResponse, QueryMarketParamRequest, QueryMarketParamResponse, QueryAllMarketParamsRequest, QueryAllMarketParamsResponse, QueryNextMarketIdRequest, QueryNextMarketIdResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -16,6 +16,9 @@ export interface Query { /** Queries a list of MarketParam items. */ allMarketParams(request?: QueryAllMarketParamsRequest): Promise; + /** Queries the next market id. */ + + nextMarketId(request?: QueryNextMarketIdRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -26,6 +29,7 @@ export class QueryClientImpl implements Query { this.allMarketPrices = this.allMarketPrices.bind(this); this.marketParam = this.marketParam.bind(this); this.allMarketParams = this.allMarketParams.bind(this); + this.nextMarketId = this.nextMarketId.bind(this); } marketPrice(request: QueryMarketPriceRequest): Promise { @@ -56,6 +60,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryAllMarketParamsResponse.decode(new _m0.Reader(data))); } + nextMarketId(request: QueryNextMarketIdRequest = {}): Promise { + const data = QueryNextMarketIdRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.prices.Query", "NextMarketId", data); + return promise.then(data => QueryNextMarketIdResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -75,6 +85,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { allMarketParams(request?: QueryAllMarketParamsRequest): Promise { return queryService.allMarketParams(request); + }, + + nextMarketId(request?: QueryNextMarketIdRequest): Promise { + return queryService.nextMarketId(request); } }; 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 4c7a38db92f..525f64b6b0a 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/query.ts @@ -151,6 +151,36 @@ export interface QueryAllMarketParamsResponseSDKType { market_params: MarketParamSDKType[]; pagination?: PageResponseSDKType; } +/** QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` */ + +export interface QueryNextMarketIdRequest {} +/** QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` */ + +export interface QueryNextMarketIdRequestSDKType {} +/** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ + +export interface QueryNextMarketIdResponse { + /** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ + nextMarketId: number; +} +/** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ + +export interface QueryNextMarketIdResponseSDKType { + /** + * QueryNextMarketIdResponse is response type for the Query/Params + * `NextMarketId` + */ + next_market_id: number; +} function createBaseQueryMarketPriceRequest(): QueryMarketPriceRequest { return { @@ -530,4 +560,83 @@ export const QueryAllMarketParamsResponse = { return message; } +}; + +function createBaseQueryNextMarketIdRequest(): QueryNextMarketIdRequest { + return {}; +} + +export const QueryNextMarketIdRequest = { + encode(_: QueryNextMarketIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextMarketIdRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextMarketIdRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QueryNextMarketIdRequest { + const message = createBaseQueryNextMarketIdRequest(); + return message; + } + +}; + +function createBaseQueryNextMarketIdResponse(): QueryNextMarketIdResponse { + return { + nextMarketId: 0 + }; +} + +export const QueryNextMarketIdResponse = { + encode(message: QueryNextMarketIdResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nextMarketId !== 0) { + writer.uint32(8).uint32(message.nextMarketId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextMarketIdResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextMarketIdResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.nextMarketId = reader.uint32(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QueryNextMarketIdResponse { + const message = createBaseQueryNextMarketIdResponse(); + message.nextMarketId = object.nextMarketId ?? 0; + return message; + } + }; \ No newline at end of file diff --git a/proto/dydxprotocol/clob/query.proto b/proto/dydxprotocol/clob/query.proto index 380336bbf91..5584a1e9506 100644 --- a/proto/dydxprotocol/clob/query.proto +++ b/proto/dydxprotocol/clob/query.proto @@ -61,6 +61,12 @@ service Query { rpc StatefulOrder(QueryStatefulOrderRequest) returns (QueryStatefulOrderResponse) {} + // Queries the next clob pair id. + rpc NextClobPairId(QueryNextClobPairIdRequest) + returns (QueryNextClobPairIdResponse) { + option (google.api.http).get = "/dydxprotocol/clob/next_clob_pair_id"; + } + // GRPC Streams // Streams orderbook updates. Updates contain orderbook data @@ -163,6 +169,12 @@ message QueryLiquidationsConfigurationResponse { LiquidationsConfig liquidations_config = 1 [ (gogoproto.nullable) = false ]; } +// QueryNextClobPairIdRequest is a request message for the next clob pair id +message QueryNextClobPairIdRequest {} + +// QueryNextClobPairIdResponse is a response message for the next clob pair id +message QueryNextClobPairIdResponse { uint32 next_clob_pair_id = 1; } + // StreamOrderbookUpdatesRequest is a request message for the // StreamOrderbookUpdates method. message StreamOrderbookUpdatesRequest { diff --git a/proto/dydxprotocol/perpetuals/query.proto b/proto/dydxprotocol/perpetuals/query.proto index 8433b112f8c..b69c4420504 100644 --- a/proto/dydxprotocol/perpetuals/query.proto +++ b/proto/dydxprotocol/perpetuals/query.proto @@ -44,6 +44,12 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/dydxprotocol/perpetuals/params"; } + + // Queries the next perpetual id. + rpc NextPerpetualId(QueryNextPerpetualIdRequest) + returns (QueryNextPerpetualIdResponse) { + option (google.api.http).get = "/dydxprotocol/perpetuals/next_perpetual_id"; + } } // Queries a Perpetual by id. @@ -104,4 +110,10 @@ message QueryParamsResponse { Params params = 1 [ (gogoproto.nullable) = false ]; } +// QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC +message QueryNextPerpetualIdRequest {} + +// QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC +message QueryNextPerpetualIdResponse { uint32 next_perpetual_id = 1; } + // this line is used by starport scaffolding # 3 diff --git a/proto/dydxprotocol/prices/query.proto b/proto/dydxprotocol/prices/query.proto index 624db55dd57..fc55b304e85 100644 --- a/proto/dydxprotocol/prices/query.proto +++ b/proto/dydxprotocol/prices/query.proto @@ -32,6 +32,12 @@ service Query { returns (QueryAllMarketParamsResponse) { option (google.api.http).get = "/dydxprotocol/prices/params/market"; } + + // Queries the next market id. + rpc NextMarketId(QueryNextMarketIdRequest) + returns (QueryNextMarketIdResponse) { + option (google.api.http).get = "/dydxprotocol/prices/next_market_id"; + } } // QueryMarketPriceRequest is request type for the Query/Params `MarketPrice` @@ -79,3 +85,10 @@ message QueryAllMarketParamsResponse { repeated MarketParam market_params = 1 [ (gogoproto.nullable) = false ]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } + +// QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` +message QueryNextMarketIdRequest {} + +// QueryNextMarketIdResponse is response type for the Query/Params +// `NextMarketId` +message QueryNextMarketIdResponse { uint32 next_market_id = 1; } diff --git a/protocol/app/upgrades.go b/protocol/app/upgrades.go index 207a5ba8159..34922cb12fc 100644 --- a/protocol/app/upgrades.go +++ b/protocol/app/upgrades.go @@ -3,7 +3,7 @@ package app import ( "fmt" - v7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" + v7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" upgradetypes "cosmossdk.io/x/upgrade/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +14,7 @@ var ( // `Upgrades` defines the upgrade handlers and store loaders for the application. // New upgrades should be added to this slice after they are implemented. Upgrades = []upgrades.Upgrade{ - v7_0.Upgrade, + v7_1.Upgrade, } Forks = []upgrades.Fork{} ) @@ -22,18 +22,17 @@ var ( // setupUpgradeHandlers registers the upgrade handlers to perform custom upgrade // logic and state migrations for software upgrades. func (app *App) setupUpgradeHandlers() { - if app.UpgradeKeeper.HasHandler(v7_0.UpgradeName) { - panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v7_0.UpgradeName)) + if app.UpgradeKeeper.HasHandler(v7_1.UpgradeName) { + panic(fmt.Sprintf("Cannot register duplicate upgrade handler '%s'", v7_1.UpgradeName)) } app.UpgradeKeeper.SetUpgradeHandler( - v7_0.UpgradeName, - v7_0.CreateUpgradeHandler( + v7_1.UpgradeName, + v7_1.CreateUpgradeHandler( app.ModuleManager, app.configurator, - app.AccountKeeper, app.PricesKeeper, - app.VaultKeeper, - app.ListingKeeper, + app.PerpetualsKeeper, + app.ClobKeeper, ), ) } diff --git a/protocol/app/upgrades/v7.0/upgrade_container_test.go b/protocol/app/upgrades/v7.0/upgrade_container_test.go deleted file mode 100644 index d65a77d5684..00000000000 --- a/protocol/app/upgrades/v7.0/upgrade_container_test.go +++ /dev/null @@ -1,241 +0,0 @@ -//go:build all || container_test - -package v_7_0_test - -import ( - "math/big" - "testing" - - listingtypes "github.com/dydxprotocol/v4-chain/protocol/x/listing/types" - - "github.com/cosmos/gogoproto/proto" - - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - v_7_0 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.0" - "github.com/dydxprotocol/v4-chain/protocol/dtypes" - "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" - "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" - affiliatestypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types" - vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" - "github.com/stretchr/testify/require" -) - -const ( - AliceBobBTCQuantums = 1_000_000 - CarlDaveBTCQuantums = 2_000_000 - CarlDaveETHQuantums = 4_000_000 -) - -func TestStateUpgrade(t *testing.T) { - testnet, err := containertest.NewTestnetWithPreupgradeGenesis() - require.NoError(t, err, "failed to create testnet - is docker daemon running?") - err = testnet.Start() - require.NoError(t, err) - defer testnet.MustCleanUp() - node := testnet.Nodes["alice"] - nodeAddress := constants.AliceAccAddress.String() - - preUpgradeSetups(node, t) - preUpgradeChecks(node, t) - - err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_0.UpgradeName) - require.NoError(t, err) - - postUpgradeChecks(node, t) -} - -func preUpgradeSetups(node *containertest.Node, t *testing.T) {} - -func preUpgradeChecks(node *containertest.Node, t *testing.T) { - // Add test for your upgrade handler logic below -} - -func postUpgradeChecks(node *containertest.Node, t *testing.T) { - // Check that vault quoting params are successfully migrated to vault params. - postUpgradeVaultParamsCheck(node, t) - // Check that vault shares are successfully migrated to megavault shares. - postUpgradeMegavaultSharesCheck(node, t) - // Check that megavault module account is successfully initialized. - postUpgradeMegavaultModuleAccCheck(node, t) - - // Check that the affiliates module has been initialized with the default tiers. - postUpgradeAffiliatesModuleTiersCheck(node, t) - - // Check that the listing module state has been initialized with the hard cap and default deposit params. - postUpgradeListingModuleStateCheck(node, t) -} - -func postUpgradeVaultParamsCheck(node *containertest.Node, t *testing.T) { - // Check that a vault with quoting params is successfully migrated and the quoting params are - // successfully migrated to the vault params. - expectedQuotingParams := &vaulttypes.QuotingParams{ - Layers: 3, - SpreadMinPpm: 1500, - SpreadBufferPpm: 500, - SkewFactorPpm: 1000000, - OrderSizePctPpm: 50000, - OrderExpirationSeconds: 30, - ActivationThresholdQuoteQuantums: dtypes.NewIntFromUint64(500_000_000), - } - - checkVaultParams(node, t, 0, vaulttypes.VaultStatus_VAULT_STATUS_QUOTING, expectedQuotingParams) - - // Check that a vault without quoting params is successfully migrated and the quoting params are - // not set in the migrated vault params. - checkVaultParams(node, t, 1, vaulttypes.VaultStatus_VAULT_STATUS_QUOTING, nil) -} - -func checkVaultParams( - node *containertest.Node, - t *testing.T, - vaultNumber uint32, - expectedStatus vaulttypes.VaultStatus, - expectedQuotingParams *vaulttypes.QuotingParams, -) { - resp, err := containertest.Query( - node, - vaulttypes.NewQueryClient, - vaulttypes.QueryClient.VaultParams, - &vaulttypes.QueryVaultParamsRequest{ - Type: vaulttypes.VaultType_VAULT_TYPE_CLOB, - Number: vaultNumber, - }, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - vaultParamsResp := vaulttypes.QueryVaultParamsResponse{} - err = proto.UnmarshalText(resp.String(), &vaultParamsResp) - require.NoError(t, err) - - require.Equal(t, expectedStatus, vaultParamsResp.VaultParams.Status) - require.Equal(t, expectedQuotingParams, vaultParamsResp.VaultParams.QuotingParams) -} - -func postUpgradeMegavaultSharesCheck(node *containertest.Node, t *testing.T) { - // Alice equity = vault_0_equity * 1 + vault_1_equity * 1/3 + vault_2_equity * 123_456/556_677 - // = 1_000 + 2_000 * 1/3 + 3_000 * 123_456/556_677 - // ~= 2331.98605 - // Bob equity = vault_1_equity * 1/3 + vault_2_equity * 433_221/556_677 - // = 2_000 * 1/3 + 3_000 * 433_221/556_677 - // ~= 3001.34728 - // Carl equity = vault_1_equity * 1/3 - // = 2_000 * 1/3 - // ~= 666.66667 - // 0.001 USDC in equity should be granted 1 megavault share and round down to nearest integer. - expectedOwnerShares := map[string]*big.Int{ - constants.AliceAccAddress.String(): big.NewInt(2_331_986), - constants.BobAccAddress.String(): big.NewInt(3_001_347), - constants.CarlAccAddress.String(): big.NewInt(666_666), - } - // 2_331_986 + 3_001_347 + 666_666 = 5_999_999 - expectedTotalShares := big.NewInt(5_999_999) - - // Check MegaVault total shares. - resp, err := containertest.Query( - node, - vaulttypes.NewQueryClient, - vaulttypes.QueryClient.MegavaultTotalShares, - &vaulttypes.QueryMegavaultTotalSharesRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - totalSharesResp := vaulttypes.QueryMegavaultTotalSharesResponse{} - err = proto.UnmarshalText(resp.String(), &totalSharesResp) - require.NoError(t, err) - - require.Equal( - t, - expectedTotalShares, - totalSharesResp.TotalShares.NumShares.BigInt(), - ) - - // Check MegaVault owner shares. - resp, err = containertest.Query( - node, - vaulttypes.NewQueryClient, - vaulttypes.QueryClient.MegavaultAllOwnerShares, - &vaulttypes.QueryMegavaultAllOwnerSharesRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - allOwnerSharesResp := vaulttypes.QueryMegavaultAllOwnerSharesResponse{} - err = proto.UnmarshalText(resp.String(), &allOwnerSharesResp) - require.NoError(t, err) - - require.Len(t, allOwnerSharesResp.OwnerShares, 3) - gotOwnerShares := make(map[string]*big.Int) - for _, ownerShare := range allOwnerSharesResp.OwnerShares { - gotOwnerShares[ownerShare.Owner] = ownerShare.Shares.NumShares.BigInt() - } - for owner, expectedShares := range expectedOwnerShares { - require.Contains(t, gotOwnerShares, owner) - require.Equal(t, expectedShares, gotOwnerShares[owner]) - } -} - -func postUpgradeAffiliatesModuleTiersCheck(node *containertest.Node, t *testing.T) { - resp, err := containertest.Query( - node, - affiliatestypes.NewQueryClient, - affiliatestypes.QueryClient.AllAffiliateTiers, - &affiliatestypes.AllAffiliateTiersRequest{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - affiliateTiersResp := affiliatestypes.AllAffiliateTiersResponse{} - err = proto.UnmarshalText(resp.String(), &affiliateTiersResp) - require.NoError(t, err) - require.Equal(t, affiliatestypes.DefaultAffiliateTiers, affiliateTiersResp.Tiers) -} - -func postUpgradeMegavaultModuleAccCheck(node *containertest.Node, t *testing.T) { - resp, err := containertest.Query( - node, - authtypes.NewQueryClient, - authtypes.QueryClient.ModuleAccountByName, - &authtypes.QueryModuleAccountByNameRequest{ - Name: vaulttypes.MegavaultAccountName, - }, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - moduleAccResp := authtypes.QueryModuleAccountByNameResponse{} - err = proto.UnmarshalText(resp.String(), &moduleAccResp) - require.NoError(t, err) -} - -func postUpgradeListingModuleStateCheck(node *containertest.Node, t *testing.T) { - // Check that the listing module state has been initialized with the hard cap and default deposit params. - resp, err := containertest.Query( - node, - listingtypes.NewQueryClient, - listingtypes.QueryClient.ListingVaultDepositParams, - &listingtypes.QueryListingVaultDepositParams{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - listingVaultDepositParamsResp := listingtypes.QueryListingVaultDepositParamsResponse{} - err = proto.UnmarshalText(resp.String(), &listingVaultDepositParamsResp) - require.NoError(t, err) - require.Equal(t, listingtypes.DefaultParams(), listingVaultDepositParamsResp.Params) - - resp, err = containertest.Query( - node, - listingtypes.NewQueryClient, - listingtypes.QueryClient.MarketsHardCap, - &listingtypes.QueryMarketsHardCap{}, - ) - require.NoError(t, err) - require.NotNil(t, resp) - - marketsHardCapResp := listingtypes.QueryMarketsHardCapResponse{} - err = proto.UnmarshalText(resp.String(), &marketsHardCapResp) - require.NoError(t, err) - require.Equal(t, uint32(500), marketsHardCapResp.HardCap) -} diff --git a/protocol/app/upgrades/v7.1/constants.go b/protocol/app/upgrades/v7.1/constants.go new file mode 100644 index 00000000000..5f84fefec0b --- /dev/null +++ b/protocol/app/upgrades/v7.1/constants.go @@ -0,0 +1,20 @@ +package v_7_1 + +import ( + store "cosmossdk.io/store/types" + "github.com/dydxprotocol/v4-chain/protocol/app/upgrades" + affiliatetypes "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/types" +) + +const ( + UpgradeName = "v7.1" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + affiliatetypes.StoreKey, + }, + }, +} diff --git a/protocol/app/upgrades/v7.1/upgrade.go b/protocol/app/upgrades/v7.1/upgrade.go new file mode 100644 index 00000000000..2cda3140116 --- /dev/null +++ b/protocol/app/upgrades/v7.1/upgrade.go @@ -0,0 +1,53 @@ +package v_7_1 + +import ( + "context" + "fmt" + + clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/dydxprotocol/v4-chain/protocol/lib" + pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" +) + +const ( + ID_NUM = 200 +) + +// Set market, perpetual, and clob ids to a set number +// This is done so that the ids are consistent for convenience +func setMarketListingBaseIds( + ctx sdk.Context, + pricesKeeper pricestypes.PricesKeeper, + perpetualsKeeper perptypes.PerpetualsKeeper, + clobKeeper clobtypes.ClobKeeper, +) { + // Set all ids to a set number + pricesKeeper.SetNextMarketID(ctx, ID_NUM) + + perpetualsKeeper.SetNextPerpetualID(ctx, ID_NUM) + + clobKeeper.SetNextClobPairID(ctx, ID_NUM) +} + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + pricesKeeper pricestypes.PricesKeeper, + perpetualsKeeper perptypes.PerpetualsKeeper, + clobKeeper clobtypes.ClobKeeper, +) upgradetypes.UpgradeHandler { + return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + sdkCtx := lib.UnwrapSDKContext(ctx, "app/upgrades") + sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) + + // Set market, perpetual, and clob ids to a set number + setMarketListingBaseIds(sdkCtx, pricesKeeper, perpetualsKeeper, clobKeeper) + + return mm.RunMigrations(ctx, configurator, vm) + } +} diff --git a/protocol/app/upgrades/v7.1/upgrade_container_test.go b/protocol/app/upgrades/v7.1/upgrade_container_test.go new file mode 100644 index 00000000000..2c52befc4ec --- /dev/null +++ b/protocol/app/upgrades/v7.1/upgrade_container_test.go @@ -0,0 +1,93 @@ +package v_7_1_test + +import ( + "testing" + + "github.com/cosmos/gogoproto/proto" + + v_7_1 "github.com/dydxprotocol/v4-chain/protocol/app/upgrades/v7.1" + clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" + + perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" + pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" + + "github.com/dydxprotocol/v4-chain/protocol/testing/containertest" + "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" + "github.com/stretchr/testify/require" +) + +func TestStateUpgrade(t *testing.T) { + testnet, err := containertest.NewTestnetWithPreupgradeGenesis() + require.NoError(t, err, "failed to create testnet - is docker daemon running?") + err = testnet.Start() + require.NoError(t, err) + defer testnet.MustCleanUp() + node := testnet.Nodes["alice"] + nodeAddress := constants.AliceAccAddress.String() + + preUpgradeSetups(node, t) + preUpgradeChecks(node, t) + + err = containertest.UpgradeTestnet(nodeAddress, t, node, v_7_1.UpgradeName) + require.NoError(t, err) + + postUpgradeChecks(node, t) +} + +func preUpgradeSetups(node *containertest.Node, t *testing.T) {} + +func preUpgradeChecks(node *containertest.Node, t *testing.T) { + // Add test for your upgrade handler logic below +} + +func postUpgradeChecks(node *containertest.Node, t *testing.T) { + // Check that the listing module state has been initialized with the hard cap and default deposit params. + postUpgradeMarketIdsCheck(node, t) +} + +func postUpgradeMarketIdsCheck(node *containertest.Node, t *testing.T) { + // query the next market id + resp, err := containertest.Query( + node, + pricetypes.NewQueryClient, + pricetypes.QueryClient.NextMarketId, + &pricetypes.QueryNextMarketIdRequest{}, + ) + require.NoError(t, err) + require.NotNil(t, resp) + + nextMarketIdResp := pricetypes.QueryNextMarketIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextMarketIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextMarketIdResp.NextMarketId) + + // query the next perpetual id + resp, err = containertest.Query( + node, + perptypes.NewQueryClient, + perptypes.QueryClient.NextPerpetualId, + &perptypes.QueryNextPerpetualIdRequest{}, + ) + require.NoError(t, err) + require.NotNil(t, resp) + + nextPerpIdResp := perptypes.QueryNextPerpetualIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextPerpIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextPerpIdResp.NextPerpetualId) + + // query the next clob pair id + resp, err = containertest.Query( + node, + clobtypes.NewQueryClient, + clobtypes.QueryClient.NextClobPairId, + &clobtypes.QueryNextClobPairIdRequest{}, + ) + require.NoError(t, err) + require.NotNil(t, resp) + + nextClobPairIdResp := clobtypes.QueryNextClobPairIdResponse{} + err = proto.UnmarshalText(resp.String(), &nextClobPairIdResp) + require.NoError(t, err) + require.Equal(t, uint32(v_7_1.ID_NUM), nextClobPairIdResp.NextClobPairId) +} diff --git a/protocol/mocks/ClobKeeper.go b/protocol/mocks/ClobKeeper.go index 0bc85202148..84dd25c4545 100644 --- a/protocol/mocks/ClobKeeper.go +++ b/protocol/mocks/ClobKeeper.go @@ -1114,6 +1114,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 38721a5f1e9..e856f54ced8 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 4776407623a..6f7a5121191 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 e8c611ebb3e..862029d0bda 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 4a7770a9204..2e1187a66b5 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/testing/version/VERSION_CURRENT b/protocol/testing/version/VERSION_CURRENT index 5593dc1fd46..9a0daa352b7 100644 --- a/protocol/testing/version/VERSION_CURRENT +++ b/protocol/testing/version/VERSION_CURRENT @@ -1 +1 @@ -v7.0 \ No newline at end of file +v7.1 \ No newline at end of file diff --git a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE index 5d112be4c5c..d4a02f34471 100644 --- a/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE +++ b/protocol/testing/version/VERSION_FULL_NAME_PREUPGRADE @@ -1 +1 @@ -v6.0.0-dev999 \ No newline at end of file +v7.0.2 \ No newline at end of file diff --git a/protocol/testing/version/VERSION_PREUPGRADE b/protocol/testing/version/VERSION_PREUPGRADE index 9f925ba24c9..5593dc1fd46 100644 --- a/protocol/testing/version/VERSION_PREUPGRADE +++ b/protocol/testing/version/VERSION_PREUPGRADE @@ -1 +1 @@ -v6.0.0 \ No newline at end of file +v7.0 \ No newline at end of file diff --git a/protocol/x/clob/keeper/grpc_query_clob_pair.go b/protocol/x/clob/keeper/grpc_query_clob_pair.go index f1597111aac..ed9bf4d8909 100644 --- a/protocol/x/clob/keeper/grpc_query_clob_pair.go +++ b/protocol/x/clob/keeper/grpc_query_clob_pair.go @@ -58,3 +58,14 @@ func (k Keeper) ClobPair(c context.Context, req *types.QueryGetClobPairRequest) return &types.QueryClobPairResponse{ClobPair: val}, nil } + +func (k Keeper) NextClobPairId( + c context.Context, + request *types.QueryNextClobPairIdRequest, +) (*types.QueryNextClobPairIdResponse, error) { + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + nextId := k.GetNextClobPairID(ctx) + return &types.QueryNextClobPairIdResponse{ + NextClobPairId: nextId, + }, nil +} diff --git a/protocol/x/clob/types/clob_keeper.go b/protocol/x/clob/types/clob_keeper.go index f5bbe110e05..770eaf491f5 100644 --- a/protocol/x/clob/types/clob_keeper.go +++ b/protocol/x/clob/types/clob_keeper.go @@ -152,4 +152,5 @@ type ClobKeeper interface { ResetAllDeliveredOrderIds(ctx sdk.Context) // Migrate order expiration state (for upgrading to 5.2 only) UnsafeMigrateOrderExpirationState(ctx sdk.Context) + SetNextClobPairID(ctx sdk.Context, nextID uint32) } diff --git a/protocol/x/clob/types/query.pb.go b/protocol/x/clob/types/query.pb.go index a6f0c83c557..b2592069108 100644 --- a/protocol/x/clob/types/query.pb.go +++ b/protocol/x/clob/types/query.pb.go @@ -767,6 +767,88 @@ func (m *QueryLiquidationsConfigurationResponse) GetLiquidationsConfig() Liquida return LiquidationsConfig{} } +// QueryNextClobPairIdRequest is a request message for the next clob pair id +type QueryNextClobPairIdRequest struct { +} + +func (m *QueryNextClobPairIdRequest) Reset() { *m = QueryNextClobPairIdRequest{} } +func (m *QueryNextClobPairIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextClobPairIdRequest) ProtoMessage() {} +func (*QueryNextClobPairIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{14} +} +func (m *QueryNextClobPairIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextClobPairIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextClobPairIdRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNextClobPairIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextClobPairIdRequest.Merge(m, src) +} +func (m *QueryNextClobPairIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextClobPairIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextClobPairIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextClobPairIdRequest proto.InternalMessageInfo + +// QueryNextClobPairIdResponse is a response message for the next clob pair id +type QueryNextClobPairIdResponse struct { + NextClobPairId uint32 `protobuf:"varint,1,opt,name=next_clob_pair_id,json=nextClobPairId,proto3" json:"next_clob_pair_id,omitempty"` +} + +func (m *QueryNextClobPairIdResponse) Reset() { *m = QueryNextClobPairIdResponse{} } +func (m *QueryNextClobPairIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextClobPairIdResponse) ProtoMessage() {} +func (*QueryNextClobPairIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{15} +} +func (m *QueryNextClobPairIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextClobPairIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextClobPairIdResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNextClobPairIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextClobPairIdResponse.Merge(m, src) +} +func (m *QueryNextClobPairIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextClobPairIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextClobPairIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextClobPairIdResponse proto.InternalMessageInfo + +func (m *QueryNextClobPairIdResponse) GetNextClobPairId() uint32 { + if m != nil { + return m.NextClobPairId + } + return 0 +} + // StreamOrderbookUpdatesRequest is a request message for the // StreamOrderbookUpdates method. type StreamOrderbookUpdatesRequest struct { @@ -782,7 +864,7 @@ func (m *StreamOrderbookUpdatesRequest) Reset() { *m = StreamOrderbookUp func (m *StreamOrderbookUpdatesRequest) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookUpdatesRequest) ProtoMessage() {} func (*StreamOrderbookUpdatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{14} + return fileDescriptor_3365c195b25c5bc0, []int{16} } func (m *StreamOrderbookUpdatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -843,7 +925,7 @@ func (m *StreamOrderbookUpdatesResponse) Reset() { *m = StreamOrderbookU func (m *StreamOrderbookUpdatesResponse) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookUpdatesResponse) ProtoMessage() {} func (*StreamOrderbookUpdatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{15} + return fileDescriptor_3365c195b25c5bc0, []int{17} } func (m *StreamOrderbookUpdatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -903,7 +985,7 @@ func (m *StreamUpdate) Reset() { *m = StreamUpdate{} } func (m *StreamUpdate) String() string { return proto.CompactTextString(m) } func (*StreamUpdate) ProtoMessage() {} func (*StreamUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{16} + return fileDescriptor_3365c195b25c5bc0, []int{18} } func (m *StreamUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1044,7 +1126,7 @@ func (m *StreamOrderbookUpdate) Reset() { *m = StreamOrderbookUpdate{} } func (m *StreamOrderbookUpdate) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookUpdate) ProtoMessage() {} func (*StreamOrderbookUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{17} + return fileDescriptor_3365c195b25c5bc0, []int{19} } func (m *StreamOrderbookUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1104,7 +1186,7 @@ func (m *StreamOrderbookFill) Reset() { *m = StreamOrderbookFill{} } func (m *StreamOrderbookFill) String() string { return proto.CompactTextString(m) } func (*StreamOrderbookFill) ProtoMessage() {} func (*StreamOrderbookFill) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{18} + return fileDescriptor_3365c195b25c5bc0, []int{20} } func (m *StreamOrderbookFill) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1175,7 +1257,7 @@ func (m *StreamTakerOrder) Reset() { *m = StreamTakerOrder{} } func (m *StreamTakerOrder) String() string { return proto.CompactTextString(m) } func (*StreamTakerOrder) ProtoMessage() {} func (*StreamTakerOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{19} + return fileDescriptor_3365c195b25c5bc0, []int{21} } func (m *StreamTakerOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1278,7 +1360,7 @@ func (m *StreamTakerOrderStatus) Reset() { *m = StreamTakerOrderStatus{} func (m *StreamTakerOrderStatus) String() string { return proto.CompactTextString(m) } func (*StreamTakerOrderStatus) ProtoMessage() {} func (*StreamTakerOrderStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_3365c195b25c5bc0, []int{20} + return fileDescriptor_3365c195b25c5bc0, []int{22} } func (m *StreamTakerOrderStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1344,6 +1426,8 @@ func init() { proto.RegisterType((*QueryStatefulOrderResponse)(nil), "dydxprotocol.clob.QueryStatefulOrderResponse") proto.RegisterType((*QueryLiquidationsConfigurationRequest)(nil), "dydxprotocol.clob.QueryLiquidationsConfigurationRequest") proto.RegisterType((*QueryLiquidationsConfigurationResponse)(nil), "dydxprotocol.clob.QueryLiquidationsConfigurationResponse") + proto.RegisterType((*QueryNextClobPairIdRequest)(nil), "dydxprotocol.clob.QueryNextClobPairIdRequest") + proto.RegisterType((*QueryNextClobPairIdResponse)(nil), "dydxprotocol.clob.QueryNextClobPairIdResponse") proto.RegisterType((*StreamOrderbookUpdatesRequest)(nil), "dydxprotocol.clob.StreamOrderbookUpdatesRequest") proto.RegisterType((*StreamOrderbookUpdatesResponse)(nil), "dydxprotocol.clob.StreamOrderbookUpdatesResponse") proto.RegisterType((*StreamUpdate)(nil), "dydxprotocol.clob.StreamUpdate") @@ -1356,114 +1440,118 @@ func init() { func init() { proto.RegisterFile("dydxprotocol/clob/query.proto", fileDescriptor_3365c195b25c5bc0) } var fileDescriptor_3365c195b25c5bc0 = []byte{ - // 1708 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x41, 0x4c, 0x1c, 0xc9, - 0x15, 0x9d, 0x06, 0x6c,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1b, 0x95, 0x1f, 0x7e, - 0xd8, 0xa6, 0xfc, 0x38, 0x6a, 0x35, 0x6d, 0xe6, 0x65, 0x83, 0xd7, 0xfd, 0xe0, 0x89, 0xb8, 0xf0, - 0x8d, 0x9e, 0xe4, 0x4c, 0x06, 0x94, 0x9f, 0x77, 0x48, 0xd8, 0xba, 0x2e, 0xc4, 0xef, 0x7f, 0x1d, - 0x00, 0x00, 0xff, 0xff, 0x04, 0xfd, 0x8b, 0xa4, 0x91, 0x14, 0x00, 0x00, + // 1770 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4d, 0x6c, 0xdc, 0xc6, + 0x15, 0x5e, 0x4a, 0xb2, 0x2d, 0xbd, 0xb5, 0x14, 0x69, 0x1c, 0x3b, 0x9b, 0x95, 0xbc, 0x92, 0xe9, + 0x58, 0xd6, 0x3a, 0xf1, 0x52, 0x56, 0x82, 0x20, 0xb5, 0x8b, 0x14, 0x96, 0x5b, 0x59, 0x42, 0xad, + 0x44, 0xa1, 0x14, 0x47, 0x68, 0x03, 0x10, 0xb3, 0xe4, 0x68, 0x35, 0x10, 0xc9, 0x59, 0x91, 0xc3, + 0x85, 0x84, 0xa2, 0x28, 0xd0, 0x43, 0x2e, 0x6d, 0x81, 0x02, 0x3d, 0xf4, 0x50, 0xf4, 0xd4, 0x73, + 0xd1, 0x5e, 0x7a, 0xec, 0xdf, 0x2d, 0x47, 0x03, 0xbd, 0xf4, 0x50, 0x14, 0x85, 0xdd, 0x73, 0x8f, + 0x3d, 0x07, 0x9c, 0x19, 0xee, 0x92, 0x4b, 0x72, 0x25, 0xeb, 0x22, 0x71, 0xde, 0xbc, 0xf7, 0xcd, + 0xf7, 0x66, 0xde, 0xbc, 0xf7, 0x66, 0xe1, 0xa6, 0x73, 0xea, 0x9c, 0x74, 0x03, 0xc6, 0x99, 0xcd, + 0x5c, 0xc3, 0x76, 0x59, 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, 0x9f, 0xa5, + 0xa9, 0x9c, 0xfd, 0x12, 0xae, 0x15, 0x54, 0x51, 0xe5, 0xf0, 0x9d, 0x22, 0x87, 0x73, 0x90, 0xca, + 0x59, 0xe4, 0xe6, 0x66, 0xf4, 0x05, 0xb5, 0xd1, 0x9f, 0x90, 0x93, 0x7e, 0xc1, 0xda, 0x72, 0x12, + 0x9a, 0x9b, 0x30, 0x5f, 0x38, 0xab, 0xa8, 0x35, 0x61, 0xce, 0x27, 0x27, 0xdc, 0x2a, 0xb8, 0xe0, + 0x33, 0x7e, 0xc6, 0x44, 0xff, 0x83, 0x06, 0x37, 0x77, 0x45, 0xad, 0x14, 0xe7, 0xd0, 0x66, 0xec, + 0xe8, 0x73, 0x59, 0xb2, 0x93, 0x80, 0xc9, 0x27, 0x8a, 0xf1, 0xa1, 0x44, 0xb1, 0x0d, 0x33, 0x83, + 0xa2, 0x6c, 0x51, 0x27, 0xce, 0xa2, 0xe3, 0xf9, 0x14, 0x9d, 0x2a, 0xe2, 0xad, 0xdd, 0xfe, 0xf7, + 0x96, 0x63, 0x4e, 0x87, 0xa9, 0x51, 0x88, 0x6e, 0x02, 0x78, 0x38, 0x38, 0x22, 0x12, 0x6a, 0x5c, + 0x2c, 0x37, 0x25, 0x25, 0x5b, 0x4e, 0xa8, 0x63, 0x68, 0x94, 0x11, 0x56, 0xee, 0x7f, 0x07, 0xae, + 0xa8, 0xb6, 0x43, 0xa5, 0xd6, 0xc5, 0x82, 0xd3, 0x90, 0x18, 0xd2, 0x34, 0x09, 0x73, 0x65, 0xa5, + 0xff, 0x7f, 0x1c, 0xae, 0xa6, 0xe7, 0xd1, 0x2d, 0xb8, 0x2a, 0xaf, 0xef, 0x21, 0xa1, 0x9d, 0x43, + 0xae, 0xf6, 0xb2, 0x2a, 0x64, 0x9b, 0x42, 0x84, 0xe6, 0x61, 0x8a, 0x9c, 0x10, 0xdb, 0xf2, 0x98, + 0x43, 0x44, 0x7c, 0x4e, 0x9b, 0x93, 0xb1, 0x60, 0x9b, 0x39, 0x04, 0x7d, 0x0e, 0xb3, 0x2c, 0x61, + 0xab, 0x5a, 0x22, 0x11, 0xa4, 0xd5, 0xb5, 0x95, 0x52, 0x6a, 0x43, 0xee, 0x6d, 0x56, 0xcc, 0x37, + 0x58, 0x56, 0x14, 0x17, 0x64, 0x79, 0xdf, 0xe2, 0x8b, 0x50, 0x9b, 0x28, 0xad, 0x8b, 0x43, 0x80, + 0x1b, 0xd4, 0x75, 0x37, 0x2b, 0xe6, 0x94, 0xb0, 0x8d, 0x07, 0x68, 0x03, 0xaa, 0x1c, 0x1f, 0x91, + 0xc0, 0x12, 0xa2, 0xda, 0x25, 0x81, 0x74, 0xbb, 0x14, 0x69, 0x2f, 0xd6, 0x15, 0x70, 0x9b, 0x15, + 0x13, 0x78, 0x7f, 0x84, 0x2c, 0x98, 0x4b, 0x45, 0x82, 0x72, 0xf4, 0xb2, 0x40, 0x5b, 0x1d, 0x11, + 0x0c, 0x02, 0x74, 0x10, 0x12, 0x7d, 0x87, 0x67, 0xc3, 0x21, 0x19, 0xfa, 0x3e, 0x5c, 0x15, 0x0d, + 0x5e, 0x82, 0x7d, 0xa5, 0xc8, 0x67, 0xd9, 0x02, 0x2a, 0xd8, 0x9d, 0x78, 0xd0, 0x47, 0xac, 0x76, + 0x07, 0xc3, 0xf5, 0x59, 0x98, 0x91, 0x30, 0x96, 0x47, 0xc2, 0x10, 0x77, 0x88, 0xfe, 0x0b, 0x0d, + 0xae, 0x17, 0xee, 0x3e, 0xaa, 0xc3, 0x64, 0xe8, 0xe3, 0x6e, 0x78, 0xc8, 0xe4, 0xe9, 0x4f, 0x9a, + 0xfd, 0x31, 0xda, 0x1f, 0xc4, 0x9b, 0x0c, 0xfc, 0x8f, 0xb2, 0x7c, 0x54, 0x9f, 0xdc, 0xca, 0x77, + 0xc5, 0x9f, 0x1e, 0x1c, 0x3c, 0x89, 0x05, 0x72, 0x91, 0xe7, 0x0f, 0x86, 0x03, 0xf1, 0xf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x6f, 0x1a, 0xbc, 0x5d, + 0xda, 0x62, 0xa2, 0x8f, 0xca, 0x18, 0x9c, 0xd5, 0xbf, 0xd6, 0xbf, 0x75, 0x01, 0x4b, 0xc5, 0xbc, + 0x25, 0x98, 0xaf, 0xa0, 0x65, 0xe3, 0x5c, 0x3f, 0x17, 0x21, 0x1f, 0xa6, 0x33, 0xaf, 0x00, 0xf4, + 0x5e, 0xd9, 0xda, 0x45, 0xef, 0x90, 0xfa, 0xfd, 0x73, 0x6a, 0x2b, 0x76, 0x15, 0xf4, 0x5b, 0x0d, + 0x66, 0xb2, 0xfd, 0x2e, 0x2a, 0xc5, 0x28, 0xec, 0x9a, 0xeb, 0xad, 0xf3, 0xaa, 0xab, 0x35, 0xdf, + 0x13, 0x3b, 0xb2, 0x8c, 0xde, 0x29, 0xd8, 0x91, 0x5c, 0x7f, 0x8d, 0x7e, 0x92, 0x64, 0xfc, 0xe1, + 0xbe, 0x14, 0xad, 0x9e, 0xb7, 0xc7, 0x4b, 0x7a, 0xee, 0xfa, 0x83, 0xd7, 0xb0, 0x90, 0x64, 0x57, + 0xb5, 0xf5, 0x9d, 0xaf, 0x5f, 0x36, 0xb4, 0x17, 0x2f, 0x1b, 0xda, 0x7f, 0x5e, 0x36, 0xb4, 0x5f, + 0xbe, 0x6a, 0x54, 0x5e, 0xbc, 0x6a, 0x54, 0xfe, 0xf9, 0xaa, 0x51, 0xf9, 0xc1, 0x87, 0x1d, 0xca, + 0x0f, 0xa3, 0x76, 0xcb, 0x66, 0x5e, 0xd6, 0x95, 0xde, 0x07, 0xf7, 0x45, 0x43, 0x62, 0xf4, 0x25, + 0x27, 0xd2, 0x3d, 0x7e, 0xda, 0x25, 0x61, 0xfb, 0xb2, 0x10, 0xbf, 0xff, 0x4d, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x9d, 0x29, 0x28, 0xfb, 0x99, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1492,6 +1580,8 @@ type QueryClient interface { LiquidationsConfiguration(ctx context.Context, in *QueryLiquidationsConfigurationRequest, opts ...grpc.CallOption) (*QueryLiquidationsConfigurationResponse, error) // Queries the stateful order for a given order id. StatefulOrder(ctx context.Context, in *QueryStatefulOrderRequest, opts ...grpc.CallOption) (*QueryStatefulOrderResponse, error) + // Queries the next clob pair id. + NextClobPairId(ctx context.Context, in *QueryNextClobPairIdRequest, opts ...grpc.CallOption) (*QueryNextClobPairIdResponse, error) // Streams orderbook updates. Updates contain orderbook data // such as order placements, updates, and fills. StreamOrderbookUpdates(ctx context.Context, in *StreamOrderbookUpdatesRequest, opts ...grpc.CallOption) (Query_StreamOrderbookUpdatesClient, error) @@ -1568,6 +1658,15 @@ func (c *queryClient) StatefulOrder(ctx context.Context, in *QueryStatefulOrderR return out, nil } +func (c *queryClient) NextClobPairId(ctx context.Context, in *QueryNextClobPairIdRequest, opts ...grpc.CallOption) (*QueryNextClobPairIdResponse, error) { + out := new(QueryNextClobPairIdResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.clob.Query/NextClobPairId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) StreamOrderbookUpdates(ctx context.Context, in *StreamOrderbookUpdatesRequest, opts ...grpc.CallOption) (Query_StreamOrderbookUpdatesClient, error) { stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[0], "/dydxprotocol.clob.Query/StreamOrderbookUpdates", opts...) if err != nil { @@ -1616,6 +1715,8 @@ type QueryServer interface { LiquidationsConfiguration(context.Context, *QueryLiquidationsConfigurationRequest) (*QueryLiquidationsConfigurationResponse, error) // Queries the stateful order for a given order id. StatefulOrder(context.Context, *QueryStatefulOrderRequest) (*QueryStatefulOrderResponse, error) + // Queries the next clob pair id. + NextClobPairId(context.Context, *QueryNextClobPairIdRequest) (*QueryNextClobPairIdResponse, error) // Streams orderbook updates. Updates contain orderbook data // such as order placements, updates, and fills. StreamOrderbookUpdates(*StreamOrderbookUpdatesRequest, Query_StreamOrderbookUpdatesServer) error @@ -1646,6 +1747,9 @@ func (*UnimplementedQueryServer) LiquidationsConfiguration(ctx context.Context, func (*UnimplementedQueryServer) StatefulOrder(ctx context.Context, req *QueryStatefulOrderRequest) (*QueryStatefulOrderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StatefulOrder not implemented") } +func (*UnimplementedQueryServer) NextClobPairId(ctx context.Context, req *QueryNextClobPairIdRequest) (*QueryNextClobPairIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextClobPairId not implemented") +} func (*UnimplementedQueryServer) StreamOrderbookUpdates(req *StreamOrderbookUpdatesRequest, srv Query_StreamOrderbookUpdatesServer) error { return status.Errorf(codes.Unimplemented, "method StreamOrderbookUpdates not implemented") } @@ -1780,6 +1884,24 @@ func _Query_StatefulOrder_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Query_NextClobPairId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextClobPairIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextClobPairId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.clob.Query/NextClobPairId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextClobPairId(ctx, req.(*QueryNextClobPairIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_StreamOrderbookUpdates_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(StreamOrderbookUpdatesRequest) if err := stream.RecvMsg(m); err != nil { @@ -1833,6 +1955,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "StatefulOrder", Handler: _Query_StatefulOrder_Handler, }, + { + MethodName: "NextClobPairId", + Handler: _Query_NextClobPairId_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -2361,6 +2487,57 @@ func (m *QueryLiquidationsConfigurationResponse) MarshalToSizedBuffer(dAtA []byt return len(dAtA) - i, nil } +func (m *QueryNextClobPairIdRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNextClobPairIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextClobPairIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNextClobPairIdResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNextClobPairIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextClobPairIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextClobPairId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextClobPairId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *StreamOrderbookUpdatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3060,6 +3237,27 @@ func (m *QueryLiquidationsConfigurationResponse) Size() (n int) { return n } +func (m *QueryNextClobPairIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNextClobPairIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextClobPairId != 0 { + n += 1 + sovQuery(uint64(m.NextClobPairId)) + } + return n +} + func (m *StreamOrderbookUpdatesRequest) Size() (n int) { if m == nil { return 0 @@ -4557,6 +4755,125 @@ func (m *QueryLiquidationsConfigurationResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextClobPairIdRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextClobPairIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextClobPairIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextClobPairIdResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextClobPairIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextClobPairIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextClobPairId", wireType) + } + m.NextClobPairId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextClobPairId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *StreamOrderbookUpdatesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/clob/types/query.pb.gw.go b/protocol/x/clob/types/query.pb.gw.go index b11d7c9bc3f..a7f5cf7e958 100644 --- a/protocol/x/clob/types/query.pb.gw.go +++ b/protocol/x/clob/types/query.pb.gw.go @@ -211,6 +211,24 @@ func local_request_Query_LiquidationsConfiguration_0(ctx context.Context, marsha } +func request_Query_NextClobPairId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextClobPairIdRequest + var metadata runtime.ServerMetadata + + msg, err := client.NextClobPairId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextClobPairId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextClobPairIdRequest + var metadata runtime.ServerMetadata + + msg, err := server.NextClobPairId(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -355,6 +373,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextClobPairId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NextClobPairId_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextClobPairId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -516,6 +557,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextClobPairId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NextClobPairId_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextClobPairId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -531,6 +592,8 @@ var ( pattern_Query_BlockRateLimitConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "clob", "block_rate"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_LiquidationsConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "clob", "liquidations_config"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NextClobPairId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "clob", "next_clob_pair_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -545,4 +608,6 @@ var ( forward_Query_BlockRateLimitConfiguration_0 = runtime.ForwardResponseMessage forward_Query_LiquidationsConfiguration_0 = runtime.ForwardResponseMessage + + forward_Query_NextClobPairId_0 = runtime.ForwardResponseMessage ) diff --git a/protocol/x/perpetuals/keeper/grpc_query_perpetual.go b/protocol/x/perpetuals/keeper/grpc_query_perpetual.go index 124660d6ff1..87e381f4b6d 100644 --- a/protocol/x/perpetuals/keeper/grpc_query_perpetual.go +++ b/protocol/x/perpetuals/keeper/grpc_query_perpetual.go @@ -71,3 +71,17 @@ func (k Keeper) Perpetual(c context.Context, req *types.QueryPerpetualRequest) ( return &types.QueryPerpetualResponse{Perpetual: val}, nil } + +func (k Keeper) NextPerpetualId( + c context.Context, + req *types.QueryNextPerpetualIdRequest, +) ( + *types.QueryNextPerpetualIdResponse, + error, +) { + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + + return &types.QueryNextPerpetualIdResponse{ + NextPerpetualId: k.GetNextPerpetualID(ctx), + }, nil +} diff --git a/protocol/x/perpetuals/types/query.pb.go b/protocol/x/perpetuals/types/query.pb.go index b2e55e80e7e..831f4f58c1d 100644 --- a/protocol/x/perpetuals/types/query.pb.go +++ b/protocol/x/perpetuals/types/query.pb.go @@ -566,6 +566,88 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +// QueryNextPerpetualIdRequest is the request type for the NextPerpetualId RPC +type QueryNextPerpetualIdRequest struct { +} + +func (m *QueryNextPerpetualIdRequest) Reset() { *m = QueryNextPerpetualIdRequest{} } +func (m *QueryNextPerpetualIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextPerpetualIdRequest) ProtoMessage() {} +func (*QueryNextPerpetualIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_13b6d29860ccef6b, []int{12} +} +func (m *QueryNextPerpetualIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextPerpetualIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextPerpetualIdRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNextPerpetualIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextPerpetualIdRequest.Merge(m, src) +} +func (m *QueryNextPerpetualIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextPerpetualIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextPerpetualIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextPerpetualIdRequest proto.InternalMessageInfo + +// QueryNextPerpetualIdResponse is the response type for the NextPerpetualId RPC +type QueryNextPerpetualIdResponse struct { + NextPerpetualId uint32 `protobuf:"varint,1,opt,name=next_perpetual_id,json=nextPerpetualId,proto3" json:"next_perpetual_id,omitempty"` +} + +func (m *QueryNextPerpetualIdResponse) Reset() { *m = QueryNextPerpetualIdResponse{} } +func (m *QueryNextPerpetualIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextPerpetualIdResponse) ProtoMessage() {} +func (*QueryNextPerpetualIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_13b6d29860ccef6b, []int{13} +} +func (m *QueryNextPerpetualIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextPerpetualIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextPerpetualIdResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNextPerpetualIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextPerpetualIdResponse.Merge(m, src) +} +func (m *QueryNextPerpetualIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextPerpetualIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextPerpetualIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextPerpetualIdResponse proto.InternalMessageInfo + +func (m *QueryNextPerpetualIdResponse) GetNextPerpetualId() uint32 { + if m != nil { + return m.NextPerpetualId + } + return 0 +} + func init() { proto.RegisterType((*QueryPerpetualRequest)(nil), "dydxprotocol.perpetuals.QueryPerpetualRequest") proto.RegisterType((*QueryPerpetualResponse)(nil), "dydxprotocol.perpetuals.QueryPerpetualResponse") @@ -579,6 +661,8 @@ func init() { proto.RegisterType((*QueryPremiumSamplesResponse)(nil), "dydxprotocol.perpetuals.QueryPremiumSamplesResponse") proto.RegisterType((*QueryParamsRequest)(nil), "dydxprotocol.perpetuals.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "dydxprotocol.perpetuals.QueryParamsResponse") + proto.RegisterType((*QueryNextPerpetualIdRequest)(nil), "dydxprotocol.perpetuals.QueryNextPerpetualIdRequest") + proto.RegisterType((*QueryNextPerpetualIdResponse)(nil), "dydxprotocol.perpetuals.QueryNextPerpetualIdResponse") } func init() { @@ -586,52 +670,56 @@ func init() { } var fileDescriptor_13b6d29860ccef6b = []byte{ - // 716 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xbf, 0x53, 0x13, 0x41, - 0x14, 0xc7, 0xb3, 0x51, 0x71, 0x78, 0x42, 0x18, 0x57, 0x54, 0x3c, 0xf1, 0xd0, 0x13, 0x09, 0xa2, - 0xde, 0x4a, 0x60, 0xb4, 0xd1, 0x42, 0x0a, 0x6c, 0x2c, 0x30, 0x22, 0x85, 0x0d, 0x5e, 0x92, 0x9d, - 0x63, 0x67, 0xee, 0xb2, 0xc7, 0xdd, 0x86, 0x21, 0xe3, 0xd8, 0x58, 0x5b, 0x38, 0x63, 0x6d, 0xa7, - 0x25, 0xad, 0xb5, 0x25, 0x25, 0x33, 0x36, 0x56, 0x8e, 0x03, 0xd6, 0xfe, 0x0d, 0x4e, 0x76, 0xf7, - 0x92, 0x3b, 0xc8, 0x91, 0x84, 0xa1, 0xcb, 0xec, 0xfb, 0xf1, 0xfd, 0xec, 0xf7, 0xf6, 0xbd, 0x09, - 0xdc, 0xae, 0x35, 0x6b, 0xdb, 0x41, 0xc8, 0x05, 0xaf, 0x72, 0x8f, 0x04, 0x34, 0x0c, 0xa8, 0x68, - 0x38, 0x5e, 0x44, 0x36, 0x1b, 0x34, 0x6c, 0xda, 0x32, 0x82, 0xaf, 0x26, 0x93, 0xec, 0x4e, 0x92, - 0x31, 0xee, 0x72, 0x97, 0xcb, 0x00, 0x69, 0xfd, 0x52, 0xe9, 0xc6, 0xa4, 0xcb, 0xb9, 0xeb, 0x51, - 0xe2, 0x04, 0x8c, 0x38, 0xf5, 0x3a, 0x17, 0x8e, 0x60, 0xbc, 0x1e, 0xe9, 0xe8, 0x5c, 0x95, 0x47, - 0x3e, 0x8f, 0x48, 0xc5, 0x89, 0xa8, 0x52, 0x21, 0x5b, 0xf3, 0x15, 0x2a, 0x9c, 0x79, 0x12, 0x38, - 0x2e, 0xab, 0xcb, 0x64, 0x9d, 0x3b, 0x9d, 0x45, 0x17, 0x38, 0xa1, 0xe3, 0xc7, 0x1d, 0x8b, 0x99, - 0x59, 0xf1, 0x4f, 0x95, 0x68, 0x15, 0xe1, 0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x6c, 0x26, 0xf2, 0xa1, 0x05, 0x81, 0xbf, 0x21, 0x18, 0x49, 0xce, 0x1c, 0x9e, - 0xef, 0xf1, 0x49, 0x8f, 0xce, 0xae, 0x51, 0x1a, 0xa4, 0x44, 0x93, 0xda, 0x92, 0x74, 0x16, 0xcf, - 0x64, 0x9b, 0x9b, 0x9c, 0x78, 0xbc, 0x83, 0xa0, 0x90, 0x1e, 0x47, 0xbc, 0xd0, 0x97, 0x6c, 0x7a, - 0xb4, 0x8d, 0xc5, 0xc1, 0x8a, 0xfa, 0xf6, 0xf5, 0xd0, 0x42, 0xc0, 0x1f, 0x11, 0x0c, 0xa9, 0xd1, - 0xc3, 0xf7, 0x7a, 0x48, 0x26, 0xe7, 0xdd, 0xb8, 0xdf, 0x5f, 0xb2, 0xe6, 0x2a, 0x4a, 0xae, 0x5b, - 0x78, 0x8a, 0x1c, 0xff, 0xaf, 0x63, 0x69, 0x6d, 0x77, 0xdf, 0x44, 0x7b, 0xfb, 0x26, 0xfa, 0xb3, - 0x6f, 0xa2, 0x4f, 0x07, 0x66, 0x6e, 0xef, 0xc0, 0xcc, 0xfd, 0x3a, 0x30, 0x73, 0x6f, 0x9e, 0xb8, - 0x4c, 0x6c, 0x34, 0x2a, 0x76, 0x95, 0xfb, 0xe9, 0x26, 0x5b, 0x8b, 0x0f, 0xaa, 0x1b, 0x0e, 0xab, - 0x93, 0xf6, 0xc9, 0x76, 0xb2, 0xb1, 0x68, 0x06, 0x34, 0xaa, 0x0c, 0xc9, 0xe0, 0xc2, 0xff, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xd7, 0x45, 0x0d, 0x89, 0x94, 0x09, 0x00, 0x00, + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xbf, 0x6f, 0xd3, 0x4c, + 0x1c, 0xc6, 0xe3, 0xbc, 0x2f, 0x95, 0xfa, 0xa5, 0x4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xf5, 0x6a, 0xb0, 0xb6, 0x4b, 0xbc, 0xca, 0x08, 0x2f, 0x2e, 0xff, 0x0b, + 0x00, 0x00, 0xff, 0xff, 0x50, 0x66, 0xce, 0xd7, 0xb4, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -658,6 +746,8 @@ type QueryClient interface { PremiumSamples(ctx context.Context, in *QueryPremiumSamplesRequest, opts ...grpc.CallOption) (*QueryPremiumSamplesResponse, error) // Queries the perpetual params. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries the next perpetual id. + NextPerpetualId(ctx context.Context, in *QueryNextPerpetualIdRequest, opts ...grpc.CallOption) (*QueryNextPerpetualIdResponse, error) } type queryClient struct { @@ -722,6 +812,15 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } +func (c *queryClient) NextPerpetualId(ctx context.Context, in *QueryNextPerpetualIdRequest, opts ...grpc.CallOption) (*QueryNextPerpetualIdResponse, error) { + out := new(QueryNextPerpetualIdResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.perpetuals.Query/NextPerpetualId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Queries a Perpetual by id. @@ -736,6 +835,8 @@ type QueryServer interface { PremiumSamples(context.Context, *QueryPremiumSamplesRequest) (*QueryPremiumSamplesResponse, error) // Queries the perpetual params. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries the next perpetual id. + NextPerpetualId(context.Context, *QueryNextPerpetualIdRequest) (*QueryNextPerpetualIdResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -760,6 +861,9 @@ func (*UnimplementedQueryServer) PremiumSamples(ctx context.Context, req *QueryP func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) NextPerpetualId(ctx context.Context, req *QueryNextPerpetualIdRequest) (*QueryNextPerpetualIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextPerpetualId not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -873,6 +977,24 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_NextPerpetualId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextPerpetualIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextPerpetualId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.perpetuals.Query/NextPerpetualId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextPerpetualId(ctx, req.(*QueryNextPerpetualIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.perpetuals.Query", HandlerType: (*QueryServer)(nil), @@ -901,6 +1023,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "NextPerpetualId", + Handler: _Query_NextPerpetualId_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/perpetuals/query.proto", @@ -1303,6 +1429,57 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryNextPerpetualIdRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNextPerpetualIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextPerpetualIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNextPerpetualIdResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNextPerpetualIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextPerpetualIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextPerpetualId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextPerpetualId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1461,6 +1638,27 @@ func (m *QueryParamsResponse) Size() (n int) { return n } +func (m *QueryNextPerpetualIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNextPerpetualIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextPerpetualId != 0 { + n += 1 + sovQuery(uint64(m.NextPerpetualId)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2430,6 +2628,125 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextPerpetualIdRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextPerpetualIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextPerpetualIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextPerpetualIdResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextPerpetualIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextPerpetualIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextPerpetualId", wireType) + } + m.NextPerpetualId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextPerpetualId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/perpetuals/types/query.pb.gw.go b/protocol/x/perpetuals/types/query.pb.gw.go index 21cbd1bbde7..62a41fc9faf 100644 --- a/protocol/x/perpetuals/types/query.pb.gw.go +++ b/protocol/x/perpetuals/types/query.pb.gw.go @@ -213,6 +213,24 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_NextPerpetualId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextPerpetualIdRequest + var metadata runtime.ServerMetadata + + msg, err := client.NextPerpetualId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextPerpetualId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextPerpetualIdRequest + var metadata runtime.ServerMetadata + + msg, err := server.NextPerpetualId(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -357,6 +375,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextPerpetualId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NextPerpetualId_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextPerpetualId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -518,6 +559,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextPerpetualId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NextPerpetualId_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextPerpetualId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -533,6 +594,8 @@ var ( pattern_Query_PremiumSamples_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "premium_samples"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NextPerpetualId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "perpetuals", "next_perpetual_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -547,4 +610,6 @@ var ( forward_Query_PremiumSamples_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_NextPerpetualId_0 = runtime.ForwardResponseMessage ) diff --git a/protocol/x/perpetuals/types/types.go b/protocol/x/perpetuals/types/types.go index 7268ec81a9a..0e6d28da92b 100644 --- a/protocol/x/perpetuals/types/types.go +++ b/protocol/x/perpetuals/types/types.go @@ -118,6 +118,7 @@ type PerpetualsKeeper interface { ctx sdk.Context, perpetual Perpetual, ) error + SetNextPerpetualID(ctx sdk.Context, nextID uint32) } // OpenInterestDelta represents a (perpId, openInterestDelta) tuple. diff --git a/protocol/x/prices/keeper/grpc_query_market.go b/protocol/x/prices/keeper/grpc_query_market.go index 11edcf7b677..fe3c2976f50 100644 --- a/protocol/x/prices/keeper/grpc_query_market.go +++ b/protocol/x/prices/keeper/grpc_query_market.go @@ -121,3 +121,14 @@ func (k Keeper) MarketParam( return &types.QueryMarketParamResponse{MarketParam: val}, nil } + +func (k Keeper) NextMarketId( + c context.Context, + req *types.QueryNextMarketIdRequest, +) ( + *types.QueryNextMarketIdResponse, + error, +) { + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + return &types.QueryNextMarketIdResponse{NextMarketId: k.GetNextMarketID(ctx)}, nil +} diff --git a/protocol/x/prices/types/query.pb.go b/protocol/x/prices/types/query.pb.go index d3579b39978..dabafa61970 100644 --- a/protocol/x/prices/types/query.pb.go +++ b/protocol/x/prices/types/query.pb.go @@ -414,6 +414,89 @@ func (m *QueryAllMarketParamsResponse) GetPagination() *query.PageResponse { return nil } +// QueryNextMarketIdRequest is request type for the Query/Params `NextMarketId` +type QueryNextMarketIdRequest struct { +} + +func (m *QueryNextMarketIdRequest) Reset() { *m = QueryNextMarketIdRequest{} } +func (m *QueryNextMarketIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryNextMarketIdRequest) ProtoMessage() {} +func (*QueryNextMarketIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c306b315383f34f4, []int{8} +} +func (m *QueryNextMarketIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextMarketIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextMarketIdRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNextMarketIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextMarketIdRequest.Merge(m, src) +} +func (m *QueryNextMarketIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryNextMarketIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextMarketIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextMarketIdRequest proto.InternalMessageInfo + +// 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"` +} + +func (m *QueryNextMarketIdResponse) Reset() { *m = QueryNextMarketIdResponse{} } +func (m *QueryNextMarketIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNextMarketIdResponse) ProtoMessage() {} +func (*QueryNextMarketIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c306b315383f34f4, []int{9} +} +func (m *QueryNextMarketIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNextMarketIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNextMarketIdResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNextMarketIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNextMarketIdResponse.Merge(m, src) +} +func (m *QueryNextMarketIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNextMarketIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNextMarketIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNextMarketIdResponse proto.InternalMessageInfo + +func (m *QueryNextMarketIdResponse) GetNextMarketId() uint32 { + if m != nil { + return m.NextMarketId + } + return 0 +} + func init() { proto.RegisterType((*QueryMarketPriceRequest)(nil), "dydxprotocol.prices.QueryMarketPriceRequest") proto.RegisterType((*QueryMarketPriceResponse)(nil), "dydxprotocol.prices.QueryMarketPriceResponse") @@ -423,47 +506,53 @@ func init() { proto.RegisterType((*QueryMarketParamResponse)(nil), "dydxprotocol.prices.QueryMarketParamResponse") proto.RegisterType((*QueryAllMarketParamsRequest)(nil), "dydxprotocol.prices.QueryAllMarketParamsRequest") proto.RegisterType((*QueryAllMarketParamsResponse)(nil), "dydxprotocol.prices.QueryAllMarketParamsResponse") + proto.RegisterType((*QueryNextMarketIdRequest)(nil), "dydxprotocol.prices.QueryNextMarketIdRequest") + proto.RegisterType((*QueryNextMarketIdResponse)(nil), "dydxprotocol.prices.QueryNextMarketIdResponse") } func init() { proto.RegisterFile("dydxprotocol/prices/query.proto", fileDescriptor_c306b315383f34f4) } var fileDescriptor_c306b315383f34f4 = []byte{ - // 556 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0xce, 0x86, 0xc2, 0xc1, 0x49, 0x41, 0x32, 0x48, 0x44, 0x69, 0xd9, 0x46, 0x06, 0xf5, 0x4f, - 0xd4, 0x26, 0x85, 0x03, 0x57, 0x7a, 0x00, 0x21, 0x84, 0x54, 0x72, 0xe4, 0x82, 0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x0b, 0x3f, 0x79, 0xe0, 0xda, 0xcc, - 0x09, 0xc0, 0x7b, 0x8b, 0x9b, 0x55, 0x5f, 0x65, 0xbb, 0x7b, 0x81, 0x8a, 0x82, 0xe2, 0x6d, 0x4d, - 0xf1, 0x16, 0x5c, 0xf9, 0x0b, 0x45, 0xc5, 0xae, 0x61, 0x79, 0xe5, 0x20, 0x9a, 0x75, 0x11, 0x0e, - 0xa2, 0xd9, 0x47, 0x81, 0x88, 0x66, 0xb4, 0x05, 0x37, 0x2a, 0x19, 0x99, 0xad, 0x2a, 0x69, 0xf7, - 0xb9, 0xa4, 0x9d, 0xd9, 0x1c, 0x27, 0xed, 0xec, 0x0b, 0x71, 0xd3, 0xae, 0xb4, 0xeb, 0x68, 0x5b, - 0x33, 0xbd, 0x03, 0xd1, 0xf9, 0x4c, 0xf7, 0x7a, 0x27, 0x63, 0xdf, 0x3b, 0x1d, 0xfb, 0xde, 0x8f, - 0xb1, 0xef, 0xbd, 0x9f, 0xf8, 0xb5, 0xd3, 0x89, 0x5f, 0xfb, 0x36, 0xf1, 0x6b, 0x2f, 0x1f, 0x46, - 0x3c, 0x3f, 0x18, 0xf6, 0x71, 0x20, 0xe2, 0xf2, 0x3b, 0x47, 0x0f, 0x76, 0x82, 0x03, 0xca, 0x13, - 0xf2, 0x27, 0x72, 0x3c, 0x7d, 0x3b, 0x1f, 0xa5, 0x4c, 0xf6, 0xaf, 0xe8, 0xc4, 0xfd, 0xdf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xe8, 0x38, 0x1f, 0x8e, 0x24, 0x07, 0x00, 0x00, + // 616 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4d, 0x4f, 0x13, 0x41, + 0x18, 0xee, 0x56, 0xe5, 0x30, 0x2d, 0x98, 0x8c, 0x26, 0xd6, 0x05, 0x97, 0x66, 0x41, 0xbe, 0x94, + 0x1d,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 0x9d, 0xbf, 0xe8, 0xe8, 0xc9, 0x66, 0xf3, 0x00, 0xc7, 0x09, 0x3a, 0xad, 0xf4, + 0x46, 0x97, 0x67, 0xfd, 0x94, 0xb0, 0xc6, 0x8c, 0x68, 0x3c, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, + 0x50, 0x4b, 0x00, 0xa4, 0x20, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -486,6 +575,8 @@ type QueryClient interface { MarketParam(ctx context.Context, in *QueryMarketParamRequest, opts ...grpc.CallOption) (*QueryMarketParamResponse, error) // Queries a list of MarketParam items. AllMarketParams(ctx context.Context, in *QueryAllMarketParamsRequest, opts ...grpc.CallOption) (*QueryAllMarketParamsResponse, error) + // Queries the next market id. + NextMarketId(ctx context.Context, in *QueryNextMarketIdRequest, opts ...grpc.CallOption) (*QueryNextMarketIdResponse, error) } type queryClient struct { @@ -532,6 +623,15 @@ func (c *queryClient) AllMarketParams(ctx context.Context, in *QueryAllMarketPar return out, nil } +func (c *queryClient) NextMarketId(ctx context.Context, in *QueryNextMarketIdRequest, opts ...grpc.CallOption) (*QueryNextMarketIdResponse, error) { + out := new(QueryNextMarketIdResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.prices.Query/NextMarketId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Queries a MarketPrice by id. @@ -542,6 +642,8 @@ type QueryServer interface { MarketParam(context.Context, *QueryMarketParamRequest) (*QueryMarketParamResponse, error) // Queries a list of MarketParam items. AllMarketParams(context.Context, *QueryAllMarketParamsRequest) (*QueryAllMarketParamsResponse, error) + // Queries the next market id. + NextMarketId(context.Context, *QueryNextMarketIdRequest) (*QueryNextMarketIdResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -560,6 +662,9 @@ func (*UnimplementedQueryServer) MarketParam(ctx context.Context, req *QueryMark func (*UnimplementedQueryServer) AllMarketParams(ctx context.Context, req *QueryAllMarketParamsRequest) (*QueryAllMarketParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllMarketParams not implemented") } +func (*UnimplementedQueryServer) NextMarketId(ctx context.Context, req *QueryNextMarketIdRequest) (*QueryNextMarketIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NextMarketId not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -637,6 +742,24 @@ func _Query_AllMarketParams_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Query_NextMarketId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNextMarketIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NextMarketId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.prices.Query/NextMarketId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NextMarketId(ctx, req.(*QueryNextMarketIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.prices.Query", HandlerType: (*QueryServer)(nil), @@ -657,6 +780,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllMarketParams", Handler: _Query_AllMarketParams_Handler, }, + { + MethodName: "NextMarketId", + Handler: _Query_NextMarketId_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/prices/query.proto", @@ -952,6 +1079,57 @@ func (m *QueryAllMarketParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryNextMarketIdRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNextMarketIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextMarketIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNextMarketIdResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNextMarketIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNextMarketIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NextMarketId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.NextMarketId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1073,6 +1251,27 @@ func (m *QueryAllMarketParamsResponse) Size() (n int) { return n } +func (m *QueryNextMarketIdRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNextMarketIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NextMarketId != 0 { + n += 1 + sovQuery(uint64(m.NextMarketId)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1795,6 +1994,125 @@ func (m *QueryAllMarketParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryNextMarketIdRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextMarketIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextMarketIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNextMarketIdResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNextMarketIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNextMarketIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextMarketId", wireType) + } + m.NextMarketId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextMarketId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/prices/types/query.pb.gw.go b/protocol/x/prices/types/query.pb.gw.go index 401252770f4..2e78d40c061 100644 --- a/protocol/x/prices/types/query.pb.gw.go +++ b/protocol/x/prices/types/query.pb.gw.go @@ -213,6 +213,24 @@ func local_request_Query_AllMarketParams_0(ctx context.Context, marshaler runtim } +func request_Query_NextMarketId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextMarketIdRequest + var metadata runtime.ServerMetadata + + msg, err := client.NextMarketId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NextMarketId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNextMarketIdRequest + var metadata runtime.ServerMetadata + + msg, err := server.NextMarketId(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -311,6 +329,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_NextMarketId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NextMarketId_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextMarketId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -432,6 +473,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_NextMarketId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NextMarketId_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NextMarketId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -443,6 +504,8 @@ var ( pattern_Query_MarketParam_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dydxprotocol", "prices", "params", "market", "id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllMarketParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "prices", "params", "market"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_NextMarketId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dydxprotocol", "prices", "next_market_id"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -453,4 +516,6 @@ var ( forward_Query_MarketParam_0 = runtime.ForwardResponseMessage forward_Query_AllMarketParams_0 = runtime.ForwardResponseMessage + + forward_Query_NextMarketId_0 = runtime.ForwardResponseMessage ) diff --git a/protocol/x/prices/types/types.go b/protocol/x/prices/types/types.go index 87d9fec885d..8f225e7580c 100644 --- a/protocol/x/prices/types/types.go +++ b/protocol/x/prices/types/types.go @@ -57,4 +57,6 @@ type PricesKeeper interface { GetCurrencyPairFromID(ctx context.Context, id uint64) (cp slinkytypes.CurrencyPair, found bool) GetIDForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (uint64, bool) GetPriceForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (oracletypes.QuotePrice, error) + + SetNextMarketID(ctx sdk.Context, nextID uint32) }