diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.lcd.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.lcd.ts index 0ce2b8ff63f..4f93ab00e4a 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.lcd.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@osmonauts/lcd"; -import { QueryDowntimeParamsRequest, QueryDowntimeParamsResponseSDKType, QueryAllDowntimeInfoRequest, QueryAllDowntimeInfoResponseSDKType } from "./query"; +import { QueryDowntimeParamsRequest, QueryDowntimeParamsResponseSDKType, QueryAllDowntimeInfoRequest, QueryAllDowntimeInfoResponseSDKType, QuerySynchronyParamsRequest, QuerySynchronyParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -11,6 +11,7 @@ export class LCDQueryClient { this.req = requestClient; this.downtimeParams = this.downtimeParams.bind(this); this.allDowntimeInfo = this.allDowntimeInfo.bind(this); + this.synchronyParams = this.synchronyParams.bind(this); } /* Queries the DowntimeParams. */ @@ -26,5 +27,12 @@ export class LCDQueryClient { const endpoint = `dydxprotocol/v4/blocktime/all_downtime_info`; return await this.req.get(endpoint); } + /* Queries the SynchronyParams. */ + + + async synchronyParams(_params: QuerySynchronyParamsRequest = {}): Promise { + const endpoint = `dydxprotocol/v4/blocktime/synchrony_params`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.rpc.Query.ts index 7f7b23cd07b..eb65ce6ff66 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/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 { QueryDowntimeParamsRequest, QueryDowntimeParamsResponse, QueryPreviousBlockInfoRequest, QueryPreviousBlockInfoResponse, QueryAllDowntimeInfoRequest, QueryAllDowntimeInfoResponse } from "./query"; +import { QueryDowntimeParamsRequest, QueryDowntimeParamsResponse, QueryPreviousBlockInfoRequest, QueryPreviousBlockInfoResponse, QueryAllDowntimeInfoRequest, QueryAllDowntimeInfoResponse, QuerySynchronyParamsRequest, QuerySynchronyParamsResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -13,6 +13,9 @@ export interface Query { /** Queries all recorded downtime info. */ allDowntimeInfo(request?: QueryAllDowntimeInfoRequest): Promise; + /** Queries the SynchronyParams. */ + + synchronyParams(request?: QuerySynchronyParamsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -22,6 +25,7 @@ export class QueryClientImpl implements Query { this.downtimeParams = this.downtimeParams.bind(this); this.previousBlockInfo = this.previousBlockInfo.bind(this); this.allDowntimeInfo = this.allDowntimeInfo.bind(this); + this.synchronyParams = this.synchronyParams.bind(this); } downtimeParams(request: QueryDowntimeParamsRequest = {}): Promise { @@ -42,6 +46,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryAllDowntimeInfoResponse.decode(new _m0.Reader(data))); } + synchronyParams(request: QuerySynchronyParamsRequest = {}): Promise { + const data = QuerySynchronyParamsRequest.encode(request).finish(); + const promise = this.rpc.request("dydxprotocol.blocktime.Query", "SynchronyParams", data); + return promise.then(data => QuerySynchronyParamsResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -57,6 +67,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { allDowntimeInfo(request?: QueryAllDowntimeInfoRequest): Promise { return queryService.allDowntimeInfo(request); + }, + + synchronyParams(request?: QuerySynchronyParamsRequest): Promise { + return queryService.synchronyParams(request); } }; diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.ts index 0ec8d42f5d5..33a39ac84dd 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/query.ts @@ -1,7 +1,23 @@ -import { DowntimeParams, DowntimeParamsSDKType } from "./params"; +import { SynchronyParams, SynchronyParamsSDKType, DowntimeParams, DowntimeParamsSDKType } from "./params"; import { BlockInfo, BlockInfoSDKType, AllDowntimeInfo, AllDowntimeInfoSDKType } from "./blocktime"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial } from "../../helpers"; +/** QuerySynchronyParamsRequest is a request type for the SynchronyParams */ + +export interface QuerySynchronyParamsRequest {} +/** QuerySynchronyParamsRequest is a request type for the SynchronyParams */ + +export interface QuerySynchronyParamsRequestSDKType {} +/** QuerySynchronyParamsResponse is a response type for the SynchronyParams */ + +export interface QuerySynchronyParamsResponse { + params?: SynchronyParams; +} +/** QuerySynchronyParamsResponse is a response type for the SynchronyParams */ + +export interface QuerySynchronyParamsResponseSDKType { + params?: SynchronyParamsSDKType; +} /** * QueryDowntimeParamsRequest is a request type for the DowntimeParams * RPC method. @@ -103,6 +119,85 @@ export interface QueryAllDowntimeInfoResponseSDKType { info?: AllDowntimeInfoSDKType; } +function createBaseQuerySynchronyParamsRequest(): QuerySynchronyParamsRequest { + return {}; +} + +export const QuerySynchronyParamsRequest = { + encode(_: QuerySynchronyParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySynchronyParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySynchronyParamsRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(_: DeepPartial): QuerySynchronyParamsRequest { + const message = createBaseQuerySynchronyParamsRequest(); + return message; + } + +}; + +function createBaseQuerySynchronyParamsResponse(): QuerySynchronyParamsResponse { + return { + params: undefined + }; +} + +export const QuerySynchronyParamsResponse = { + encode(message: QuerySynchronyParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + SynchronyParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySynchronyParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySynchronyParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.params = SynchronyParams.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): QuerySynchronyParamsResponse { + const message = createBaseQuerySynchronyParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? SynchronyParams.fromPartial(object.params) : undefined; + return message; + } + +}; + function createBaseQueryDowntimeParamsRequest(): QueryDowntimeParamsRequest { return {}; } diff --git a/proto/dydxprotocol/blocktime/query.proto b/proto/dydxprotocol/blocktime/query.proto index 16ddf96d828..d05351fd71d 100644 --- a/proto/dydxprotocol/blocktime/query.proto +++ b/proto/dydxprotocol/blocktime/query.proto @@ -30,7 +30,8 @@ service Query { // Queries the SynchronyParams. rpc SynchronyParams(QuerySynchronyParamsRequest) returns (QuerySynchronyParamsResponse) { - option (google.api.http).get = "/dydxprotocol/v4/blocktime/synchrony_params"; + option (google.api.http).get = + "/dydxprotocol/v4/blocktime/synchrony_params"; } } diff --git a/protocol/mocks/QueryClient.go b/protocol/mocks/QueryClient.go index 862029d0bda..6c0d712fe88 100644 --- a/protocol/mocks/QueryClient.go +++ b/protocol/mocks/QueryClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -1140,6 +1140,43 @@ func (_m *QueryClient) SubaccountAll(ctx context.Context, in *subaccountstypes.Q return r0, r1 } +// SynchronyParams provides a mock function with given fields: ctx, in, opts +func (_m *QueryClient) SynchronyParams(ctx context.Context, in *types.QuerySynchronyParamsRequest, opts ...grpc.CallOption) (*types.QuerySynchronyParamsResponse, 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 SynchronyParams") + } + + var r0 *types.QuerySynchronyParamsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySynchronyParamsRequest, ...grpc.CallOption) (*types.QuerySynchronyParamsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.QuerySynchronyParamsRequest, ...grpc.CallOption) *types.QuerySynchronyParamsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QuerySynchronyParamsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.QuerySynchronyParamsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // UpdateMarketPrices provides a mock function with given fields: ctx, in, opts func (_m *QueryClient) UpdateMarketPrices(ctx context.Context, in *pricefeedapi.UpdateMarketPricesRequest, opts ...grpc.CallOption) (*pricefeedapi.UpdateMarketPricesResponse, error) { _va := make([]interface{}, len(opts))