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 b06e18289c9..d05351fd71d 100644 --- a/proto/dydxprotocol/blocktime/query.proto +++ b/proto/dydxprotocol/blocktime/query.proto @@ -26,6 +26,21 @@ service Query { option (google.api.http).get = "/dydxprotocol/v4/blocktime/all_downtime_info"; } + + // Queries the SynchronyParams. + rpc SynchronyParams(QuerySynchronyParamsRequest) + returns (QuerySynchronyParamsResponse) { + option (google.api.http).get = + "/dydxprotocol/v4/blocktime/synchrony_params"; + } +} + +// QuerySynchronyParamsRequest is a request type for the SynchronyParams +message QuerySynchronyParamsRequest {} + +// QuerySynchronyParamsResponse is a response type for the SynchronyParams +message QuerySynchronyParamsResponse { + SynchronyParams params = 1 [ (gogoproto.nullable) = false ]; } // QueryDowntimeParamsRequest is a request type for the DowntimeParams 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)) diff --git a/protocol/x/blocktime/client/cli/query.go b/protocol/x/blocktime/client/cli/query.go index a91c99873c7..b39e7337d0b 100644 --- a/protocol/x/blocktime/client/cli/query.go +++ b/protocol/x/blocktime/client/cli/query.go @@ -24,6 +24,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryDowntimeParams()) cmd.AddCommand(CmdQueryAllDowntimeInfo()) cmd.AddCommand(CmdQueryPreviousBlockInfo()) + cmd.AddCommand(CmdQuerySynchronyParams()) return cmd } @@ -96,3 +97,26 @@ func CmdQueryPreviousBlockInfo() *cobra.Command { return cmd } + +func CmdQuerySynchronyParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "sychrony-params", + Short: "get synchrony params", + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.SynchronyParams( + context.Background(), + &types.QuerySynchronyParamsRequest{}, + ) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/protocol/x/blocktime/keeper/grpc_query.go b/protocol/x/blocktime/keeper/grpc_query.go index 0cd62b5e2e2..6cde9cd4cd3 100644 --- a/protocol/x/blocktime/keeper/grpc_query.go +++ b/protocol/x/blocktime/keeper/grpc_query.go @@ -11,6 +11,24 @@ import ( var _ types.QueryServer = Keeper{} +func (k Keeper) SynchronyParams( + c context.Context, + req *types.QuerySynchronyParamsRequest, +) ( + *types.QuerySynchronyParamsResponse, + error, +) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := lib.UnwrapSDKContext(c, types.ModuleName) + params := k.GetSynchronyParams(ctx) + return &types.QuerySynchronyParamsResponse{ + Params: params, + }, nil +} + func (k Keeper) DowntimeParams( c context.Context, req *types.QueryDowntimeParamsRequest, diff --git a/protocol/x/blocktime/keeper/grpc_query_test.go b/protocol/x/blocktime/keeper/grpc_query_test.go index 0edfbce4b9f..d78068e2057 100644 --- a/protocol/x/blocktime/keeper/grpc_query_test.go +++ b/protocol/x/blocktime/keeper/grpc_query_test.go @@ -12,6 +12,41 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/x/blocktime/types" ) +func TestSynchronyParams(t *testing.T) { + tApp := testapp.NewTestAppBuilder(t).Build() + ctx := tApp.InitChain() + k := tApp.App.BlockTimeKeeper + + for name, tc := range map[string]struct { + req *types.QuerySynchronyParamsRequest + res *types.QuerySynchronyParamsResponse + err error + }{ + "Default": { + req: &types.QuerySynchronyParamsRequest{}, + res: &types.QuerySynchronyParamsResponse{ + Params: types.DefaultSynchronyParams(), + }, + err: nil, + }, + "Nil": { + req: nil, + res: nil, + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(name, func(t *testing.T) { + res, err := k.SynchronyParams(ctx, tc.req) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, tc.res, res) + } + }) + } +} + func TestDowntimeParams(t *testing.T) { tApp := testapp.NewTestAppBuilder(t).Build() ctx := tApp.InitChain() diff --git a/protocol/x/blocktime/types/query.pb.go b/protocol/x/blocktime/types/query.pb.go index 0c079b2e0b5..a942335030d 100644 --- a/protocol/x/blocktime/types/query.pb.go +++ b/protocol/x/blocktime/types/query.pb.go @@ -29,6 +29,88 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QuerySynchronyParamsRequest is a request type for the SynchronyParams +type QuerySynchronyParamsRequest struct { +} + +func (m *QuerySynchronyParamsRequest) Reset() { *m = QuerySynchronyParamsRequest{} } +func (m *QuerySynchronyParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySynchronyParamsRequest) ProtoMessage() {} +func (*QuerySynchronyParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c6fa5ca81d500c56, []int{0} +} +func (m *QuerySynchronyParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySynchronyParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySynchronyParamsRequest.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 *QuerySynchronyParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySynchronyParamsRequest.Merge(m, src) +} +func (m *QuerySynchronyParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySynchronyParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySynchronyParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySynchronyParamsRequest proto.InternalMessageInfo + +// QuerySynchronyParamsResponse is a response type for the SynchronyParams +type QuerySynchronyParamsResponse struct { + Params SynchronyParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QuerySynchronyParamsResponse) Reset() { *m = QuerySynchronyParamsResponse{} } +func (m *QuerySynchronyParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySynchronyParamsResponse) ProtoMessage() {} +func (*QuerySynchronyParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c6fa5ca81d500c56, []int{1} +} +func (m *QuerySynchronyParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySynchronyParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySynchronyParamsResponse.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 *QuerySynchronyParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySynchronyParamsResponse.Merge(m, src) +} +func (m *QuerySynchronyParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySynchronyParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySynchronyParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySynchronyParamsResponse proto.InternalMessageInfo + +func (m *QuerySynchronyParamsResponse) GetParams() SynchronyParams { + if m != nil { + return m.Params + } + return SynchronyParams{} +} + // QueryDowntimeParamsRequest is a request type for the DowntimeParams // RPC method. type QueryDowntimeParamsRequest struct { @@ -38,7 +120,7 @@ func (m *QueryDowntimeParamsRequest) Reset() { *m = QueryDowntimeParamsR func (m *QueryDowntimeParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryDowntimeParamsRequest) ProtoMessage() {} func (*QueryDowntimeParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c6fa5ca81d500c56, []int{0} + return fileDescriptor_c6fa5ca81d500c56, []int{2} } func (m *QueryDowntimeParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +159,7 @@ func (m *QueryDowntimeParamsResponse) Reset() { *m = QueryDowntimeParams func (m *QueryDowntimeParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryDowntimeParamsResponse) ProtoMessage() {} func (*QueryDowntimeParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c6fa5ca81d500c56, []int{1} + return fileDescriptor_c6fa5ca81d500c56, []int{3} } func (m *QueryDowntimeParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -122,7 +204,7 @@ func (m *QueryPreviousBlockInfoRequest) Reset() { *m = QueryPreviousBloc func (m *QueryPreviousBlockInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryPreviousBlockInfoRequest) ProtoMessage() {} func (*QueryPreviousBlockInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c6fa5ca81d500c56, []int{2} + return fileDescriptor_c6fa5ca81d500c56, []int{4} } func (m *QueryPreviousBlockInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,7 +243,7 @@ func (m *QueryPreviousBlockInfoResponse) Reset() { *m = QueryPreviousBlo func (m *QueryPreviousBlockInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryPreviousBlockInfoResponse) ProtoMessage() {} func (*QueryPreviousBlockInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c6fa5ca81d500c56, []int{3} + return fileDescriptor_c6fa5ca81d500c56, []int{5} } func (m *QueryPreviousBlockInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -206,7 +288,7 @@ func (m *QueryAllDowntimeInfoRequest) Reset() { *m = QueryAllDowntimeInf func (m *QueryAllDowntimeInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllDowntimeInfoRequest) ProtoMessage() {} func (*QueryAllDowntimeInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c6fa5ca81d500c56, []int{4} + return fileDescriptor_c6fa5ca81d500c56, []int{6} } func (m *QueryAllDowntimeInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -245,7 +327,7 @@ func (m *QueryAllDowntimeInfoResponse) Reset() { *m = QueryAllDowntimeIn func (m *QueryAllDowntimeInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllDowntimeInfoResponse) ProtoMessage() {} func (*QueryAllDowntimeInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c6fa5ca81d500c56, []int{5} + return fileDescriptor_c6fa5ca81d500c56, []int{7} } func (m *QueryAllDowntimeInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -282,6 +364,8 @@ func (m *QueryAllDowntimeInfoResponse) GetInfo() *AllDowntimeInfo { } func init() { + proto.RegisterType((*QuerySynchronyParamsRequest)(nil), "dydxprotocol.blocktime.QuerySynchronyParamsRequest") + proto.RegisterType((*QuerySynchronyParamsResponse)(nil), "dydxprotocol.blocktime.QuerySynchronyParamsResponse") proto.RegisterType((*QueryDowntimeParamsRequest)(nil), "dydxprotocol.blocktime.QueryDowntimeParamsRequest") proto.RegisterType((*QueryDowntimeParamsResponse)(nil), "dydxprotocol.blocktime.QueryDowntimeParamsResponse") proto.RegisterType((*QueryPreviousBlockInfoRequest)(nil), "dydxprotocol.blocktime.QueryPreviousBlockInfoRequest") @@ -295,35 +379,39 @@ func init() { } var fileDescriptor_c6fa5ca81d500c56 = []byte{ - // 438 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xa9, 0x4c, 0xa9, - 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x2e, 0xc9, - 0xcc, 0x4d, 0xd5, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x03, 0x4b, 0x08, 0x89, 0x21, 0xab, 0xd1, - 0x83, 0xab, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x8b, 0xeb, 0x83, 0x58, 0x10, 0xd5, 0x52, - 0x32, 0xe9, 0xf9, 0xf9, 0xe9, 0x39, 0xa9, 0xfa, 0x89, 0x05, 0x99, 0xfa, 0x89, 0x79, 0x79, 0xf9, - 0x25, 0x89, 0x25, 0x99, 0xf9, 0x79, 0xc5, 0x50, 0x59, 0x35, 0x1c, 0xf6, 0xc1, 0x59, 0x50, 0x75, - 0xca, 0x38, 0xd4, 0x15, 0x24, 0x16, 0x25, 0xe6, 0x42, 0x0d, 0x53, 0x92, 0xe1, 0x92, 0x0a, 0x04, - 0xb9, 0xd3, 0x25, 0xbf, 0x3c, 0x0f, 0x24, 0x1b, 0x00, 0x96, 0x0c, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, - 0x2e, 0x51, 0x4a, 0xe6, 0x92, 0xc6, 0x2a, 0x5b, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a, 0xe4, 0xc2, - 0xc5, 0x06, 0x31, 0x4c, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4d, 0x0f, 0xbb, 0x37, 0xf5, - 0x50, 0xf5, 0x3b, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0xd5, 0xab, 0x24, 0xcf, 0x25, 0x0b, - 0xb6, 0x24, 0xa0, 0x28, 0xb5, 0x2c, 0x33, 0xbf, 0xb4, 0xd8, 0x09, 0xa4, 0xcd, 0x33, 0x2f, 0x2d, - 0x1f, 0xe6, 0x8a, 0x70, 0x2e, 0x39, 0x5c, 0x0a, 0xa0, 0x0e, 0x31, 0xe5, 0x62, 0xc9, 0xcc, 0x4b, - 0xcb, 0x87, 0x3a, 0x43, 0x11, 0x97, 0x33, 0x10, 0x1a, 0xc1, 0xca, 0x95, 0x64, 0xa1, 0xde, 0x73, - 0xcc, 0xc9, 0x81, 0xb9, 0x10, 0xd9, 0xde, 0x68, 0x2e, 0x19, 0xec, 0xd2, 0x50, 0x5b, 0xad, 0x51, - 0x6c, 0x55, 0xc7, 0x65, 0x2b, 0xba, 0x76, 0xb0, 0x26, 0xa3, 0x8f, 0xcc, 0x5c, 0xac, 0x60, 0xd3, - 0x85, 0xd6, 0x32, 0x72, 0xf1, 0xa1, 0x06, 0x90, 0x90, 0x11, 0x2e, 0xb3, 0x70, 0xc7, 0x95, 0x94, - 0x31, 0x49, 0x7a, 0x20, 0x5e, 0x50, 0x32, 0x6a, 0xba, 0xfc, 0x64, 0x32, 0x93, 0x8e, 0x90, 0x96, - 0x3e, 0x4a, 0x62, 0x29, 0x33, 0x41, 0x4a, 0x2f, 0x29, 0x50, 0xad, 0xf1, 0x90, 0xf8, 0x12, 0x6a, - 0x62, 0xe4, 0x12, 0xc4, 0x88, 0x0a, 0x21, 0x53, 0xbc, 0xd6, 0xe3, 0x8a, 0x5b, 0x29, 0x33, 0x52, - 0xb5, 0x41, 0xc3, 0x7e, 0x13, 0x23, 0x17, 0x3f, 0x5a, 0xc0, 0x0a, 0xe1, 0x0f, 0x01, 0xec, 0x91, - 0x2c, 0x65, 0x42, 0x9a, 0x26, 0x68, 0xb8, 0x99, 0x80, 0xc3, 0x4d, 0x4f, 0x48, 0x07, 0x4f, 0xb8, - 0x25, 0xe6, 0xe4, 0xc4, 0xc3, 0xc3, 0x0e, 0x14, 0xe7, 0x4e, 0xa1, 0x27, 0x1e, 0xc9, 0x31, 0x5e, - 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, - 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x9d, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, - 0x8b, 0x6e, 0xa2, 0x6e, 0x72, 0x46, 0x62, 0x66, 0x9e, 0x3e, 0x5c, 0xa4, 0x02, 0xc9, 0x8a, 0x92, - 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x9c, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xb0, 0xe9, - 0x2a, 0x95, 0x89, 0x04, 0x00, 0x00, + // 501 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x33, 0xd2, 0xf6, 0x30, 0x82, 0xc5, 0x41, 0x44, 0xe2, 0x36, 0xd5, 0x08, 0x55, 0xb4, + 0x4d, 0x20, 0xbb, 0xf5, 0xd2, 0x93, 0x4b, 0x3d, 0x78, 0xab, 0x15, 0x11, 0xf4, 0x50, 0xb2, 0xd9, + 0x69, 0x36, 0x98, 0x9d, 0x37, 0xcd, 0x9f, 0xda, 0x5c, 0xfb, 0x09, 0x04, 0x3f, 0x83, 0x47, 0x0f, + 0xfa, 0x29, 0x7a, 0x2c, 0x78, 0xf1, 0x24, 0xb2, 0xeb, 0x07, 0x91, 0x4c, 0x66, 0x63, 0x32, 0xcd, + 0xa4, 0xec, 0x2d, 0xe4, 0x7d, 0x9f, 0xf7, 0xfd, 0xe5, 0x79, 0x26, 0x83, 0xcd, 0x71, 0x3e, 0x3e, + 0x8b, 0x62, 0x48, 0xc1, 0x83, 0xd0, 0x1e, 0x85, 0xe0, 0x7d, 0x4c, 0x83, 0x29, 0xb5, 0x4f, 0x32, + 0x1a, 0xe7, 0x16, 0x2f, 0x90, 0xbb, 0xf5, 0x1e, 0xab, 0xea, 0xd1, 0xef, 0xf8, 0xe0, 0x03, 0x7f, + 0x6f, 0x17, 0x4f, 0x65, 0xb7, 0xde, 0xf3, 0x01, 0xfc, 0x90, 0xda, 0x6e, 0x14, 0xd8, 0x2e, 0x63, + 0x90, 0xba, 0x69, 0x00, 0x2c, 0x11, 0xd5, 0x2d, 0xc5, 0xbe, 0xea, 0x49, 0xf4, 0x3d, 0x52, 0xf4, + 0x45, 0x6e, 0xec, 0x4e, 0xc5, 0x30, 0x73, 0x03, 0xdf, 0x7f, 0x5d, 0x70, 0xbe, 0xc9, 0x99, 0x37, + 0x89, 0x81, 0xe5, 0x07, 0xbc, 0x7a, 0x48, 0x4f, 0x32, 0x9a, 0xa4, 0x26, 0xc5, 0xbd, 0xf6, 0x72, + 0x12, 0x01, 0x4b, 0x28, 0x79, 0x89, 0xd7, 0xca, 0x71, 0xf7, 0xd0, 0x03, 0xf4, 0xe4, 0xa6, 0xf3, + 0xd8, 0x6a, 0xff, 0x50, 0x4b, 0x1a, 0x30, 0x5c, 0xb9, 0xf8, 0xbd, 0xa9, 0x1d, 0x0a, 0xb1, 0xd9, + 0xc3, 0x3a, 0x5f, 0xb3, 0x0f, 0x9f, 0x58, 0xd1, 0xde, 0x84, 0xf0, 0x04, 0xa3, 0x5c, 0x15, 0x0c, + 0xfb, 0x12, 0xc3, 0x96, 0x8a, 0xa1, 0xa9, 0x97, 0x10, 0x36, 0xf1, 0x06, 0x5f, 0x72, 0x10, 0xd3, + 0xd3, 0x00, 0xb2, 0x64, 0x58, 0xc8, 0x5e, 0xb1, 0x63, 0x58, 0x50, 0xbc, 0xc3, 0x86, 0xaa, 0x41, + 0x80, 0xec, 0xe2, 0x95, 0x80, 0x1d, 0x83, 0xc0, 0x78, 0xa8, 0xc2, 0xf8, 0x2f, 0xe4, 0xed, 0x55, + 0x04, 0x2f, 0xc2, 0x70, 0x41, 0x58, 0xdf, 0xfb, 0x41, 0x44, 0x70, 0xa5, 0x2c, 0xb6, 0xee, 0x35, + 0xb6, 0x2a, 0x03, 0x90, 0xe5, 0x5c, 0xe4, 0x7c, 0x5d, 0xc5, 0xab, 0x7c, 0x3a, 0xf9, 0x86, 0xf0, + 0xad, 0xa6, 0x41, 0xc4, 0x51, 0xcd, 0x52, 0x67, 0xa5, 0xf7, 0x97, 0xd2, 0x94, 0x9f, 0x60, 0x3a, + 0xe7, 0x3f, 0xff, 0x7e, 0xb9, 0xb1, 0x4d, 0x9e, 0xda, 0x8d, 0x23, 0x7b, 0x3a, 0xa8, 0x9d, 0xda, + 0xb1, 0x90, 0x1e, 0x95, 0x79, 0x91, 0x73, 0x84, 0x6f, 0x5f, 0x89, 0x82, 0xec, 0x76, 0xae, 0x57, + 0x65, 0xab, 0x3f, 0x5f, 0x56, 0x26, 0xbc, 0xff, 0x81, 0xf0, 0xba, 0x64, 0x2c, 0xe9, 0x76, 0xa0, + 0x3d, 0x64, 0x7d, 0xb0, 0x9c, 0x48, 0xf8, 0x36, 0xe0, 0xbe, 0x59, 0x64, 0xbb, 0xc3, 0x37, 0x37, + 0x0c, 0x8f, 0x2a, 0xef, 0x8a, 0xcc, 0xc9, 0x77, 0x84, 0xd7, 0xa5, 0xdf, 0xf1, 0x1a, 0xe8, 0xf6, + 0xcb, 0xe1, 0x1a, 0x68, 0xc5, 0x95, 0x61, 0xf6, 0x39, 0xf4, 0x0e, 0x79, 0xd6, 0x01, 0x9d, 0x2c, + 0xb4, 0x22, 0xed, 0xe1, 0xdb, 0x8b, 0x99, 0x81, 0x2e, 0x67, 0x06, 0xfa, 0x33, 0x33, 0xd0, 0xe7, + 0xb9, 0xa1, 0x5d, 0xce, 0x0d, 0xed, 0xd7, 0xdc, 0xd0, 0xde, 0xef, 0xf9, 0x41, 0x3a, 0xc9, 0x46, + 0x96, 0x07, 0x53, 0x79, 0xe0, 0x8e, 0x37, 0x71, 0x03, 0x66, 0x57, 0x6f, 0xce, 0x6a, 0x1b, 0xd2, + 0x3c, 0xa2, 0xc9, 0x68, 0x8d, 0xd7, 0xfa, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x97, 0x4a, 0xf0, + 0x24, 0xc3, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -344,6 +432,8 @@ type QueryClient interface { PreviousBlockInfo(ctx context.Context, in *QueryPreviousBlockInfoRequest, opts ...grpc.CallOption) (*QueryPreviousBlockInfoResponse, error) // Queries all recorded downtime info. AllDowntimeInfo(ctx context.Context, in *QueryAllDowntimeInfoRequest, opts ...grpc.CallOption) (*QueryAllDowntimeInfoResponse, error) + // Queries the SynchronyParams. + SynchronyParams(ctx context.Context, in *QuerySynchronyParamsRequest, opts ...grpc.CallOption) (*QuerySynchronyParamsResponse, error) } type queryClient struct { @@ -381,6 +471,15 @@ func (c *queryClient) AllDowntimeInfo(ctx context.Context, in *QueryAllDowntimeI return out, nil } +func (c *queryClient) SynchronyParams(ctx context.Context, in *QuerySynchronyParamsRequest, opts ...grpc.CallOption) (*QuerySynchronyParamsResponse, error) { + out := new(QuerySynchronyParamsResponse) + err := c.cc.Invoke(ctx, "/dydxprotocol.blocktime.Query/SynchronyParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Queries the DowntimeParams. @@ -389,6 +488,8 @@ type QueryServer interface { PreviousBlockInfo(context.Context, *QueryPreviousBlockInfoRequest) (*QueryPreviousBlockInfoResponse, error) // Queries all recorded downtime info. AllDowntimeInfo(context.Context, *QueryAllDowntimeInfoRequest) (*QueryAllDowntimeInfoResponse, error) + // Queries the SynchronyParams. + SynchronyParams(context.Context, *QuerySynchronyParamsRequest) (*QuerySynchronyParamsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -404,6 +505,9 @@ func (*UnimplementedQueryServer) PreviousBlockInfo(ctx context.Context, req *Que func (*UnimplementedQueryServer) AllDowntimeInfo(ctx context.Context, req *QueryAllDowntimeInfoRequest) (*QueryAllDowntimeInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AllDowntimeInfo not implemented") } +func (*UnimplementedQueryServer) SynchronyParams(ctx context.Context, req *QuerySynchronyParamsRequest) (*QuerySynchronyParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SynchronyParams not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -463,6 +567,24 @@ func _Query_AllDowntimeInfo_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Query_SynchronyParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySynchronyParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SynchronyParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dydxprotocol.blocktime.Query/SynchronyParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SynchronyParams(ctx, req.(*QuerySynchronyParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dydxprotocol.blocktime.Query", HandlerType: (*QueryServer)(nil), @@ -479,11 +601,71 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "AllDowntimeInfo", Handler: _Query_AllDowntimeInfo_Handler, }, + { + MethodName: "SynchronyParams", + Handler: _Query_SynchronyParams_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dydxprotocol/blocktime/query.proto", } +func (m *QuerySynchronyParamsRequest) 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 *QuerySynchronyParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySynchronyParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QuerySynchronyParamsResponse) 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 *QuerySynchronyParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySynchronyParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryDowntimeParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -667,6 +849,26 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QuerySynchronyParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QuerySynchronyParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryDowntimeParamsRequest) Size() (n int) { if m == nil { return 0 @@ -737,6 +939,139 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QuerySynchronyParamsRequest) 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: QuerySynchronyParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySynchronyParamsRequest: 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 *QuerySynchronyParamsResponse) 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: QuerySynchronyParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySynchronyParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + 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 *QueryDowntimeParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/blocktime/types/query.pb.gw.go b/protocol/x/blocktime/types/query.pb.gw.go index 22ba0bcf076..4162d2d669d 100644 --- a/protocol/x/blocktime/types/query.pb.gw.go +++ b/protocol/x/blocktime/types/query.pb.gw.go @@ -69,6 +69,24 @@ func local_request_Query_AllDowntimeInfo_0(ctx context.Context, marshaler runtim } +func request_Query_SynchronyParams_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySynchronyParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.SynchronyParams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SynchronyParams_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySynchronyParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.SynchronyParams(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. @@ -121,6 +139,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_SynchronyParams_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_SynchronyParams_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_SynchronyParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -202,6 +243,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_SynchronyParams_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_SynchronyParams_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_SynchronyParams_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -209,10 +270,14 @@ var ( pattern_Query_DowntimeParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "v4", "blocktime", "downtime_params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllDowntimeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "v4", "blocktime", "all_downtime_info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SynchronyParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dydxprotocol", "v4", "blocktime", "synchrony_params"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_DowntimeParams_0 = runtime.ForwardResponseMessage forward_Query_AllDowntimeInfo_0 = runtime.ForwardResponseMessage + + forward_Query_SynchronyParams_0 = runtime.ForwardResponseMessage )