Skip to content

Commit 5cfa661

Browse files
committed
indexer codegen
1 parent 2b0ce64 commit 5cfa661

File tree

3 files changed

+196
-2
lines changed

3 files changed

+196
-2
lines changed

indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/params.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ export interface DowntimeParamsSDKType {
1919
*/
2020
durations: DurationSDKType[];
2121
}
22+
/** SynchronyParams defines the parameters for block synchrony. */
23+
24+
export interface SynchronyParams {
25+
/**
26+
* next_block_delay replaces the locally configured timeout_commit in
27+
* CometBFT. It determines the amount of time the CometBFT waits after the If
28+
* the application sends next_block_delay = 0 to the consensus engine, the
29+
* latter defaults back to using timeout_commit.
30+
*/
31+
nextBlockDelay?: Duration;
32+
}
33+
/** SynchronyParams defines the parameters for block synchrony. */
34+
35+
export interface SynchronyParamsSDKType {
36+
/**
37+
* next_block_delay replaces the locally configured timeout_commit in
38+
* CometBFT. It determines the amount of time the CometBFT waits after the If
39+
* the application sends next_block_delay = 0 to the consensus engine, the
40+
* latter defaults back to using timeout_commit.
41+
*/
42+
next_block_delay?: DurationSDKType;
43+
}
2244

2345
function createBaseDowntimeParams(): DowntimeParams {
2446
return {
@@ -63,4 +85,49 @@ export const DowntimeParams = {
6385
return message;
6486
}
6587

88+
};
89+
90+
function createBaseSynchronyParams(): SynchronyParams {
91+
return {
92+
nextBlockDelay: undefined
93+
};
94+
}
95+
96+
export const SynchronyParams = {
97+
encode(message: SynchronyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
98+
if (message.nextBlockDelay !== undefined) {
99+
Duration.encode(message.nextBlockDelay, writer.uint32(10).fork()).ldelim();
100+
}
101+
102+
return writer;
103+
},
104+
105+
decode(input: _m0.Reader | Uint8Array, length?: number): SynchronyParams {
106+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
107+
let end = length === undefined ? reader.len : reader.pos + length;
108+
const message = createBaseSynchronyParams();
109+
110+
while (reader.pos < end) {
111+
const tag = reader.uint32();
112+
113+
switch (tag >>> 3) {
114+
case 1:
115+
message.nextBlockDelay = Duration.decode(reader, reader.uint32());
116+
break;
117+
118+
default:
119+
reader.skipType(tag & 7);
120+
break;
121+
}
122+
}
123+
124+
return message;
125+
},
126+
127+
fromPartial(object: DeepPartial<SynchronyParams>): SynchronyParams {
128+
const message = createBaseSynchronyParams();
129+
message.nextBlockDelay = object.nextBlockDelay !== undefined && object.nextBlockDelay !== null ? Duration.fromPartial(object.nextBlockDelay) : undefined;
130+
return message;
131+
}
132+
66133
};
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
import { Rpc } from "../../helpers";
22
import * as _m0 from "protobufjs/minimal";
3-
import { MsgUpdateDowntimeParams, MsgUpdateDowntimeParamsResponse } from "./tx";
3+
import { MsgUpdateDowntimeParams, MsgUpdateDowntimeParamsResponse, MsgUpdateSynchronyParams, MsgUpdateSynchronyParamsResponse } from "./tx";
44
/** Msg defines the Msg service. */
55

66
export interface Msg {
77
/** UpdateDowntimeParams updates the DowntimeParams in state. */
88
updateDowntimeParams(request: MsgUpdateDowntimeParams): Promise<MsgUpdateDowntimeParamsResponse>;
9+
/** UpdateSynchronyParams updates the SynchronyParams in state. */
10+
11+
updateSynchronyParams(request: MsgUpdateSynchronyParams): Promise<MsgUpdateSynchronyParamsResponse>;
912
}
1013
export class MsgClientImpl implements Msg {
1114
private readonly rpc: Rpc;
1215

1316
constructor(rpc: Rpc) {
1417
this.rpc = rpc;
1518
this.updateDowntimeParams = this.updateDowntimeParams.bind(this);
19+
this.updateSynchronyParams = this.updateSynchronyParams.bind(this);
1620
}
1721

1822
updateDowntimeParams(request: MsgUpdateDowntimeParams): Promise<MsgUpdateDowntimeParamsResponse> {
@@ -21,4 +25,10 @@ export class MsgClientImpl implements Msg {
2125
return promise.then(data => MsgUpdateDowntimeParamsResponse.decode(new _m0.Reader(data)));
2226
}
2327

28+
updateSynchronyParams(request: MsgUpdateSynchronyParams): Promise<MsgUpdateSynchronyParamsResponse> {
29+
const data = MsgUpdateSynchronyParams.encode(request).finish();
30+
const promise = this.rpc.request("dydxprotocol.blocktime.Msg", "UpdateSynchronyParams", data);
31+
return promise.then(data => MsgUpdateSynchronyParamsResponse.decode(new _m0.Reader(data)));
32+
}
33+
2434
}

indexer/packages/v4-protos/src/codegen/dydxprotocol/blocktime/tx.ts

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DowntimeParams, DowntimeParamsSDKType } from "./params";
1+
import { DowntimeParams, DowntimeParamsSDKType, SynchronyParams, SynchronyParamsSDKType } from "./params";
22
import * as _m0 from "protobufjs/minimal";
33
import { DeepPartial } from "../../helpers";
44
/** MsgUpdateDowntimeParams is the Msg/UpdateDowntimeParams request type. */
@@ -29,6 +29,34 @@ export interface MsgUpdateDowntimeParamsResponse {}
2929
*/
3030

3131
export interface MsgUpdateDowntimeParamsResponseSDKType {}
32+
/** MsgUpdateSynchronyParams is the Msg/UpdateSynchronyParams request type. */
33+
34+
export interface MsgUpdateSynchronyParams {
35+
authority: string;
36+
/** Defines the parameters to update. All parameters must be supplied. */
37+
38+
params?: SynchronyParams;
39+
}
40+
/** MsgUpdateSynchronyParams is the Msg/UpdateSynchronyParams request type. */
41+
42+
export interface MsgUpdateSynchronyParamsSDKType {
43+
authority: string;
44+
/** Defines the parameters to update. All parameters must be supplied. */
45+
46+
params?: SynchronyParamsSDKType;
47+
}
48+
/**
49+
* MsgUpdateSynchronyParamsResponse is the Msg/UpdateSynchronyParams response
50+
* type.
51+
*/
52+
53+
export interface MsgUpdateSynchronyParamsResponse {}
54+
/**
55+
* MsgUpdateSynchronyParamsResponse is the Msg/UpdateSynchronyParams response
56+
* type.
57+
*/
58+
59+
export interface MsgUpdateSynchronyParamsResponseSDKType {}
3260

3361
function createBaseMsgUpdateDowntimeParams(): MsgUpdateDowntimeParams {
3462
return {
@@ -117,4 +145,93 @@ export const MsgUpdateDowntimeParamsResponse = {
117145
return message;
118146
}
119147

148+
};
149+
150+
function createBaseMsgUpdateSynchronyParams(): MsgUpdateSynchronyParams {
151+
return {
152+
authority: "",
153+
params: undefined
154+
};
155+
}
156+
157+
export const MsgUpdateSynchronyParams = {
158+
encode(message: MsgUpdateSynchronyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
159+
if (message.authority !== "") {
160+
writer.uint32(10).string(message.authority);
161+
}
162+
163+
if (message.params !== undefined) {
164+
SynchronyParams.encode(message.params, writer.uint32(18).fork()).ldelim();
165+
}
166+
167+
return writer;
168+
},
169+
170+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSynchronyParams {
171+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
172+
let end = length === undefined ? reader.len : reader.pos + length;
173+
const message = createBaseMsgUpdateSynchronyParams();
174+
175+
while (reader.pos < end) {
176+
const tag = reader.uint32();
177+
178+
switch (tag >>> 3) {
179+
case 1:
180+
message.authority = reader.string();
181+
break;
182+
183+
case 2:
184+
message.params = SynchronyParams.decode(reader, reader.uint32());
185+
break;
186+
187+
default:
188+
reader.skipType(tag & 7);
189+
break;
190+
}
191+
}
192+
193+
return message;
194+
},
195+
196+
fromPartial(object: DeepPartial<MsgUpdateSynchronyParams>): MsgUpdateSynchronyParams {
197+
const message = createBaseMsgUpdateSynchronyParams();
198+
message.authority = object.authority ?? "";
199+
message.params = object.params !== undefined && object.params !== null ? SynchronyParams.fromPartial(object.params) : undefined;
200+
return message;
201+
}
202+
203+
};
204+
205+
function createBaseMsgUpdateSynchronyParamsResponse(): MsgUpdateSynchronyParamsResponse {
206+
return {};
207+
}
208+
209+
export const MsgUpdateSynchronyParamsResponse = {
210+
encode(_: MsgUpdateSynchronyParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
211+
return writer;
212+
},
213+
214+
decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateSynchronyParamsResponse {
215+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
216+
let end = length === undefined ? reader.len : reader.pos + length;
217+
const message = createBaseMsgUpdateSynchronyParamsResponse();
218+
219+
while (reader.pos < end) {
220+
const tag = reader.uint32();
221+
222+
switch (tag >>> 3) {
223+
default:
224+
reader.skipType(tag & 7);
225+
break;
226+
}
227+
}
228+
229+
return message;
230+
},
231+
232+
fromPartial(_: DeepPartial<MsgUpdateSynchronyParamsResponse>): MsgUpdateSynchronyParamsResponse {
233+
const message = createBaseMsgUpdateSynchronyParamsResponse();
234+
return message;
235+
}
236+
120237
};

0 commit comments

Comments
 (0)