@wireio/opp-solidity-models 1.0.0 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,9 @@ pragma solidity >=0.8.0 <0.9.0;
4
4
  // Auto-generated by protoc-gen-solidity from sysio/opp/attestations/attestations.proto
5
5
  // DO NOT EDIT
6
6
 
7
- import {ProtobufRuntime} from "./ProtobufRuntime.sol";
7
+ import {ProtobufRuntime} from "../../../ProtobufRuntime.sol";
8
+ import {ChainAddress, ChainAddressCodec, ChainId, ChainIdCodec, ChainSignature, ChainSignatureCodec, TokenAmount, TokenAmountCodec} from "../types/Types.sol";
9
+ import {Message, MessageCodec} from "../Opp.sol";
8
10
 
9
11
  struct ChainReserveBalanceSheet {
10
12
  uint64 kind;
@@ -45,7 +47,7 @@ struct WireTokenPurchase {
45
47
  struct OperatorAction {
46
48
  uint64 actionType;
47
49
  ChainAddress actor;
48
- uint64 type;
50
+ uint64 type_;
49
51
  uint64 status;
50
52
  TokenAmount amount;
51
53
  }
@@ -71,17 +73,17 @@ struct ProtocolState {
71
73
 
72
74
  library ChainReserveBalanceSheetCodec {
73
75
 
74
- function encode(ChainReserveBalanceSheet memory msg) internal pure returns (bytes memory) {
76
+ function encode(ChainReserveBalanceSheet memory chainReserveBalanceSheet) internal pure returns (bytes memory) {
75
77
  bytes memory buf = "";
76
78
 
77
79
  // field 1: kind
78
80
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x8));
79
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.kind));
81
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(chainReserveBalanceSheet.kind));
80
82
 
81
83
  // field 2: amounts
82
- for (uint256 _i_amounts = 0; _i_amounts < msg.amounts.length; _i_amounts++) {
84
+ for (uint256 _i_amounts = 0; _i_amounts < chainReserveBalanceSheet.amounts.length; _i_amounts++) {
83
85
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
84
- bytes memory _elem = TokenAmountCodec.encode(msg.amounts[_i_amounts]);
86
+ bytes memory _elem = TokenAmountCodec.encode(chainReserveBalanceSheet.amounts[_i_amounts]);
85
87
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(_elem.length)));
86
88
  buf = abi.encodePacked(buf, _elem);
87
89
  }
@@ -89,31 +91,37 @@ library ChainReserveBalanceSheetCodec {
89
91
  return buf;
90
92
  }
91
93
 
92
- function decode(bytes memory data) internal pure returns (ChainReserveBalanceSheet memory msg) {
94
+ function decode(bytes memory data) internal pure returns (ChainReserveBalanceSheet memory chainReserveBalanceSheet) {
93
95
  uint256 pos = 0;
94
96
  uint256 end = data.length;
95
97
 
98
+ uint256 _count_amounts = 0;
99
+ {
100
+ uint256 _pos = 0;
101
+ while (_pos < end) {
102
+ uint64 _tag;
103
+ (_tag, _pos) = ProtobufRuntime._decode_key(data, _pos);
104
+ if (_tag == 18) { _count_amounts++; }
105
+ _pos = ProtobufRuntime._skip_field(data, _pos, _tag & 0x07);
106
+ }
107
+ }
108
+ chainReserveBalanceSheet.amounts = new TokenAmount[](_count_amounts);
109
+ uint256 _idx_amounts = 0;
110
+
96
111
  while (pos < end) {
97
112
  uint64 tag;
98
113
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
99
114
 
100
- // solhint-disable-next-line no-empty-blocks
101
- switch (tag) {
102
- case 8:
103
- (msg.kind, pos) = ProtobufRuntime._decode_varint(data, pos);
104
- break;
105
- case 18:
106
- {
107
- uint64 _len;
108
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
109
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
110
- msg.amounts.push(TokenAmountCodec.decode(_sub));
111
- pos += uint256(_len);
112
- }
113
- break;
114
- default:
115
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
116
- break;
115
+ if (tag == 8) {
116
+ (chainReserveBalanceSheet.kind, pos) = ProtobufRuntime._decode_varint(data, pos);
117
+ } else if (tag == 18) {
118
+ uint64 _len;
119
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
120
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
121
+ chainReserveBalanceSheet.amounts[_idx_amounts++] = TokenAmountCodec.decode(_sub);
122
+ pos += uint256(_len);
123
+ } else {
124
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
117
125
  }
118
126
  }
119
127
  }
@@ -121,33 +129,33 @@ library ChainReserveBalanceSheetCodec {
121
129
 
122
130
  library PretokenStakeChangeCodec {
123
131
 
124
- function encode(PretokenStakeChange memory msg) internal pure returns (bytes memory) {
132
+ function encode(PretokenStakeChange memory pretokenStakeChange) internal pure returns (bytes memory) {
125
133
  bytes memory buf = "";
126
134
 
127
135
  // field 1: actor
128
136
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
129
- bytes memory actor_encoded = ChainAddressCodec.encode(msg.actor);
137
+ bytes memory actor_encoded = ChainAddressCodec.encode(pretokenStakeChange.actor);
130
138
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
131
139
  buf = abi.encodePacked(buf, actor_encoded);
132
140
 
133
141
  // field 2: amount
134
142
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
135
- bytes memory amount_encoded = TokenAmountCodec.encode(msg.amount);
143
+ bytes memory amount_encoded = TokenAmountCodec.encode(pretokenStakeChange.amount);
136
144
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(amount_encoded.length)));
137
145
  buf = abi.encodePacked(buf, amount_encoded);
138
146
 
139
147
  // field 10: index_at_mint
140
148
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x50));
141
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.indexAtMint));
149
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(pretokenStakeChange.indexAtMint)));
142
150
 
143
151
  // field 11: index_at_burn
144
152
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x58));
145
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.indexAtBurn));
153
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(pretokenStakeChange.indexAtBurn)));
146
154
 
147
155
  return buf;
148
156
  }
149
157
 
150
- function decode(bytes memory data) internal pure returns (PretokenStakeChange memory msg) {
158
+ function decode(bytes memory data) internal pure returns (PretokenStakeChange memory pretokenStakeChange) {
151
159
  uint256 pos = 0;
152
160
  uint256 end = data.length;
153
161
 
@@ -155,35 +163,28 @@ library PretokenStakeChangeCodec {
155
163
  uint64 tag;
156
164
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
157
165
 
158
- // solhint-disable-next-line no-empty-blocks
159
- switch (tag) {
160
- case 10:
161
- {
162
- uint64 _len;
163
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
164
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
165
- msg.actor = ChainAddressCodec.decode(_sub);
166
- pos += uint256(_len);
167
- }
168
- break;
169
- case 18:
170
- {
171
- uint64 _len;
172
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
173
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
174
- msg.amount = TokenAmountCodec.decode(_sub);
175
- pos += uint256(_len);
176
- }
177
- break;
178
- case 80:
179
- (msg.indexAtMint, pos) = ProtobufRuntime._decode_varint(data, pos);
180
- break;
181
- case 88:
182
- (msg.indexAtBurn, pos) = ProtobufRuntime._decode_varint(data, pos);
183
- break;
184
- default:
185
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
186
- break;
166
+ if (tag == 10) {
167
+ uint64 _len;
168
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
169
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
170
+ pretokenStakeChange.actor = ChainAddressCodec.decode(_sub);
171
+ pos += uint256(_len);
172
+ } else if (tag == 18) {
173
+ uint64 _len;
174
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
175
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
176
+ pretokenStakeChange.amount = TokenAmountCodec.decode(_sub);
177
+ pos += uint256(_len);
178
+ } else if (tag == 80) {
179
+ { uint64 _v;
180
+ (_v, pos) = ProtobufRuntime._decode_varint(data, pos);
181
+ pretokenStakeChange.indexAtMint = int64(_v); }
182
+ } else if (tag == 88) {
183
+ { uint64 _v;
184
+ (_v, pos) = ProtobufRuntime._decode_varint(data, pos);
185
+ pretokenStakeChange.indexAtBurn = int64(_v); }
186
+ } else {
187
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
187
188
  }
188
189
  }
189
190
  }
@@ -191,33 +192,33 @@ library PretokenStakeChangeCodec {
191
192
 
192
193
  library PretokenPurchaseCodec {
193
194
 
194
- function encode(PretokenPurchase memory msg) internal pure returns (bytes memory) {
195
+ function encode(PretokenPurchase memory pretokenPurchase) internal pure returns (bytes memory) {
195
196
  bytes memory buf = "";
196
197
 
197
198
  // field 1: actor
198
199
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
199
- bytes memory actor_encoded = ChainAddressCodec.encode(msg.actor);
200
+ bytes memory actor_encoded = ChainAddressCodec.encode(pretokenPurchase.actor);
200
201
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
201
202
  buf = abi.encodePacked(buf, actor_encoded);
202
203
 
203
204
  // field 2: amount
204
205
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
205
- bytes memory amount_encoded = TokenAmountCodec.encode(msg.amount);
206
+ bytes memory amount_encoded = TokenAmountCodec.encode(pretokenPurchase.amount);
206
207
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(amount_encoded.length)));
207
208
  buf = abi.encodePacked(buf, amount_encoded);
208
209
 
209
210
  // field 3: pretoken_count
210
211
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x18));
211
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.pretokenCount));
212
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(pretokenPurchase.pretokenCount)));
212
213
 
213
214
  // field 10: index_at_mint
214
215
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x50));
215
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.indexAtMint));
216
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(pretokenPurchase.indexAtMint)));
216
217
 
217
218
  return buf;
218
219
  }
219
220
 
220
- function decode(bytes memory data) internal pure returns (PretokenPurchase memory msg) {
221
+ function decode(bytes memory data) internal pure returns (PretokenPurchase memory pretokenPurchase) {
221
222
  uint256 pos = 0;
222
223
  uint256 end = data.length;
223
224
 
@@ -225,35 +226,28 @@ library PretokenPurchaseCodec {
225
226
  uint64 tag;
226
227
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
227
228
 
228
- // solhint-disable-next-line no-empty-blocks
229
- switch (tag) {
230
- case 10:
231
- {
232
- uint64 _len;
233
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
234
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
235
- msg.actor = ChainAddressCodec.decode(_sub);
236
- pos += uint256(_len);
237
- }
238
- break;
239
- case 18:
240
- {
241
- uint64 _len;
242
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
243
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
244
- msg.amount = TokenAmountCodec.decode(_sub);
245
- pos += uint256(_len);
246
- }
247
- break;
248
- case 24:
249
- (msg.pretokenCount, pos) = ProtobufRuntime._decode_varint(data, pos);
250
- break;
251
- case 80:
252
- (msg.indexAtMint, pos) = ProtobufRuntime._decode_varint(data, pos);
253
- break;
254
- default:
255
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
256
- break;
229
+ if (tag == 10) {
230
+ uint64 _len;
231
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
232
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
233
+ pretokenPurchase.actor = ChainAddressCodec.decode(_sub);
234
+ pos += uint256(_len);
235
+ } else if (tag == 18) {
236
+ uint64 _len;
237
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
238
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
239
+ pretokenPurchase.amount = TokenAmountCodec.decode(_sub);
240
+ pos += uint256(_len);
241
+ } else if (tag == 24) {
242
+ { uint64 _v;
243
+ (_v, pos) = ProtobufRuntime._decode_varint(data, pos);
244
+ pretokenPurchase.pretokenCount = int64(_v); }
245
+ } else if (tag == 80) {
246
+ { uint64 _v;
247
+ (_v, pos) = ProtobufRuntime._decode_varint(data, pos);
248
+ pretokenPurchase.indexAtMint = int64(_v); }
249
+ } else {
250
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
257
251
  }
258
252
  }
259
253
  }
@@ -261,29 +255,29 @@ library PretokenPurchaseCodec {
261
255
 
262
256
  library PretokenYieldCodec {
263
257
 
264
- function encode(PretokenYield memory msg) internal pure returns (bytes memory) {
258
+ function encode(PretokenYield memory pretokenYield) internal pure returns (bytes memory) {
265
259
  bytes memory buf = "";
266
260
 
267
261
  // field 1: actor
268
262
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
269
- bytes memory actor_encoded = ChainAddressCodec.encode(msg.actor);
263
+ bytes memory actor_encoded = ChainAddressCodec.encode(pretokenYield.actor);
270
264
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
271
265
  buf = abi.encodePacked(buf, actor_encoded);
272
266
 
273
267
  // field 2: amount
274
268
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
275
- bytes memory amount_encoded = TokenAmountCodec.encode(msg.amount);
269
+ bytes memory amount_encoded = TokenAmountCodec.encode(pretokenYield.amount);
276
270
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(amount_encoded.length)));
277
271
  buf = abi.encodePacked(buf, amount_encoded);
278
272
 
279
273
  // field 3: index_at_mint
280
274
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x18));
281
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.indexAtMint));
275
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(pretokenYield.indexAtMint)));
282
276
 
283
277
  return buf;
284
278
  }
285
279
 
286
- function decode(bytes memory data) internal pure returns (PretokenYield memory msg) {
280
+ function decode(bytes memory data) internal pure returns (PretokenYield memory pretokenYield) {
287
281
  uint256 pos = 0;
288
282
  uint256 end = data.length;
289
283
 
@@ -291,32 +285,24 @@ library PretokenYieldCodec {
291
285
  uint64 tag;
292
286
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
293
287
 
294
- // solhint-disable-next-line no-empty-blocks
295
- switch (tag) {
296
- case 10:
297
- {
298
- uint64 _len;
299
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
300
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
301
- msg.actor = ChainAddressCodec.decode(_sub);
302
- pos += uint256(_len);
303
- }
304
- break;
305
- case 18:
306
- {
307
- uint64 _len;
308
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
309
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
310
- msg.amount = TokenAmountCodec.decode(_sub);
311
- pos += uint256(_len);
312
- }
313
- break;
314
- case 24:
315
- (msg.indexAtMint, pos) = ProtobufRuntime._decode_varint(data, pos);
316
- break;
317
- default:
318
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
319
- break;
288
+ if (tag == 10) {
289
+ uint64 _len;
290
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
291
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
292
+ pretokenYield.actor = ChainAddressCodec.decode(_sub);
293
+ pos += uint256(_len);
294
+ } else if (tag == 18) {
295
+ uint64 _len;
296
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
297
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
298
+ pretokenYield.amount = TokenAmountCodec.decode(_sub);
299
+ pos += uint256(_len);
300
+ } else if (tag == 24) {
301
+ { uint64 _v;
302
+ (_v, pos) = ProtobufRuntime._decode_varint(data, pos);
303
+ pretokenYield.indexAtMint = int64(_v); }
304
+ } else {
305
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
320
306
  }
321
307
  }
322
308
  }
@@ -324,29 +310,29 @@ library PretokenYieldCodec {
324
310
 
325
311
  library StakeUpdateCodec {
326
312
 
327
- function encode(StakeUpdate memory msg) internal pure returns (bytes memory) {
313
+ function encode(StakeUpdate memory stakeUpdate) internal pure returns (bytes memory) {
328
314
  bytes memory buf = "";
329
315
 
330
316
  // field 1: actor
331
317
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
332
- bytes memory actor_encoded = ChainAddressCodec.encode(msg.actor);
318
+ bytes memory actor_encoded = ChainAddressCodec.encode(stakeUpdate.actor);
333
319
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
334
320
  buf = abi.encodePacked(buf, actor_encoded);
335
321
 
336
322
  // field 2: status
337
323
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x10));
338
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.status));
324
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(stakeUpdate.status));
339
325
 
340
326
  // field 3: amount
341
327
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x1a));
342
- bytes memory amount_encoded = TokenAmountCodec.encode(msg.amount);
328
+ bytes memory amount_encoded = TokenAmountCodec.encode(stakeUpdate.amount);
343
329
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(amount_encoded.length)));
344
330
  buf = abi.encodePacked(buf, amount_encoded);
345
331
 
346
332
  return buf;
347
333
  }
348
334
 
349
- function decode(bytes memory data) internal pure returns (StakeUpdate memory msg) {
335
+ function decode(bytes memory data) internal pure returns (StakeUpdate memory stakeUpdate) {
350
336
  uint256 pos = 0;
351
337
  uint256 end = data.length;
352
338
 
@@ -354,32 +340,22 @@ library StakeUpdateCodec {
354
340
  uint64 tag;
355
341
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
356
342
 
357
- // solhint-disable-next-line no-empty-blocks
358
- switch (tag) {
359
- case 10:
360
- {
361
- uint64 _len;
362
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
363
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
364
- msg.actor = ChainAddressCodec.decode(_sub);
365
- pos += uint256(_len);
366
- }
367
- break;
368
- case 16:
369
- (msg.status, pos) = ProtobufRuntime._decode_varint(data, pos);
370
- break;
371
- case 26:
372
- {
373
- uint64 _len;
374
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
375
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
376
- msg.amount = TokenAmountCodec.decode(_sub);
377
- pos += uint256(_len);
378
- }
379
- break;
380
- default:
381
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
382
- break;
343
+ if (tag == 10) {
344
+ uint64 _len;
345
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
346
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
347
+ stakeUpdate.actor = ChainAddressCodec.decode(_sub);
348
+ pos += uint256(_len);
349
+ } else if (tag == 16) {
350
+ (stakeUpdate.status, pos) = ProtobufRuntime._decode_varint(data, pos);
351
+ } else if (tag == 26) {
352
+ uint64 _len;
353
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
354
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
355
+ stakeUpdate.amount = TokenAmountCodec.decode(_sub);
356
+ pos += uint256(_len);
357
+ } else {
358
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
383
359
  }
384
360
  }
385
361
  }
@@ -387,19 +363,19 @@ library StakeUpdateCodec {
387
363
 
388
364
  library WireTokenPurchaseCodec {
389
365
 
390
- function encode(WireTokenPurchase memory msg) internal pure returns (bytes memory) {
366
+ function encode(WireTokenPurchase memory wireTokenPurchase) internal pure returns (bytes memory) {
391
367
  bytes memory buf = "";
392
368
 
393
369
  // field 1: actor
394
370
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
395
- bytes memory actor_encoded = ChainAddressCodec.encode(msg.actor);
371
+ bytes memory actor_encoded = ChainAddressCodec.encode(wireTokenPurchase.actor);
396
372
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
397
373
  buf = abi.encodePacked(buf, actor_encoded);
398
374
 
399
375
  // field 2: amounts
400
- for (uint256 _i_amounts = 0; _i_amounts < msg.amounts.length; _i_amounts++) {
376
+ for (uint256 _i_amounts = 0; _i_amounts < wireTokenPurchase.amounts.length; _i_amounts++) {
401
377
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
402
- bytes memory _elem = TokenAmountCodec.encode(msg.amounts[_i_amounts]);
378
+ bytes memory _elem = TokenAmountCodec.encode(wireTokenPurchase.amounts[_i_amounts]);
403
379
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(_elem.length)));
404
380
  buf = abi.encodePacked(buf, _elem);
405
381
  }
@@ -407,37 +383,41 @@ library WireTokenPurchaseCodec {
407
383
  return buf;
408
384
  }
409
385
 
410
- function decode(bytes memory data) internal pure returns (WireTokenPurchase memory msg) {
386
+ function decode(bytes memory data) internal pure returns (WireTokenPurchase memory wireTokenPurchase) {
411
387
  uint256 pos = 0;
412
388
  uint256 end = data.length;
413
389
 
390
+ uint256 _count_amounts = 0;
391
+ {
392
+ uint256 _pos = 0;
393
+ while (_pos < end) {
394
+ uint64 _tag;
395
+ (_tag, _pos) = ProtobufRuntime._decode_key(data, _pos);
396
+ if (_tag == 18) { _count_amounts++; }
397
+ _pos = ProtobufRuntime._skip_field(data, _pos, _tag & 0x07);
398
+ }
399
+ }
400
+ wireTokenPurchase.amounts = new TokenAmount[](_count_amounts);
401
+ uint256 _idx_amounts = 0;
402
+
414
403
  while (pos < end) {
415
404
  uint64 tag;
416
405
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
417
406
 
418
- // solhint-disable-next-line no-empty-blocks
419
- switch (tag) {
420
- case 10:
421
- {
422
- uint64 _len;
423
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
424
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
425
- msg.actor = ChainAddressCodec.decode(_sub);
426
- pos += uint256(_len);
427
- }
428
- break;
429
- case 18:
430
- {
431
- uint64 _len;
432
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
433
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
434
- msg.amounts.push(TokenAmountCodec.decode(_sub));
435
- pos += uint256(_len);
436
- }
437
- break;
438
- default:
439
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
440
- break;
407
+ if (tag == 10) {
408
+ uint64 _len;
409
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
410
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
411
+ wireTokenPurchase.actor = ChainAddressCodec.decode(_sub);
412
+ pos += uint256(_len);
413
+ } else if (tag == 18) {
414
+ uint64 _len;
415
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
416
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
417
+ wireTokenPurchase.amounts[_idx_amounts++] = TokenAmountCodec.decode(_sub);
418
+ pos += uint256(_len);
419
+ } else {
420
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
441
421
  }
442
422
  }
443
423
  }
@@ -445,37 +425,37 @@ library WireTokenPurchaseCodec {
445
425
 
446
426
  library OperatorActionCodec {
447
427
 
448
- function encode(OperatorAction memory msg) internal pure returns (bytes memory) {
428
+ function encode(OperatorAction memory operatorAction) internal pure returns (bytes memory) {
449
429
  bytes memory buf = "";
450
430
 
451
431
  // field 1: action_type
452
432
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x8));
453
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.actionType));
433
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(operatorAction.actionType));
454
434
 
455
435
  // field 2: actor
456
436
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
457
- bytes memory actor_encoded = ChainAddressCodec.encode(msg.actor);
437
+ bytes memory actor_encoded = ChainAddressCodec.encode(operatorAction.actor);
458
438
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
459
439
  buf = abi.encodePacked(buf, actor_encoded);
460
440
 
461
441
  // field 3: type
462
442
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x18));
463
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.type));
443
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(operatorAction.type_));
464
444
 
465
445
  // field 4: status
466
446
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x20));
467
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.status));
447
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(operatorAction.status));
468
448
 
469
449
  // field 10: amount
470
450
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x52));
471
- bytes memory amount_encoded = TokenAmountCodec.encode(msg.amount);
451
+ bytes memory amount_encoded = TokenAmountCodec.encode(operatorAction.amount);
472
452
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(amount_encoded.length)));
473
453
  buf = abi.encodePacked(buf, amount_encoded);
474
454
 
475
455
  return buf;
476
456
  }
477
457
 
478
- function decode(bytes memory data) internal pure returns (OperatorAction memory msg) {
458
+ function decode(bytes memory data) internal pure returns (OperatorAction memory operatorAction) {
479
459
  uint256 pos = 0;
480
460
  uint256 end = data.length;
481
461
 
@@ -483,38 +463,26 @@ library OperatorActionCodec {
483
463
  uint64 tag;
484
464
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
485
465
 
486
- // solhint-disable-next-line no-empty-blocks
487
- switch (tag) {
488
- case 8:
489
- (msg.actionType, pos) = ProtobufRuntime._decode_varint(data, pos);
490
- break;
491
- case 18:
492
- {
493
- uint64 _len;
494
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
495
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
496
- msg.actor = ChainAddressCodec.decode(_sub);
497
- pos += uint256(_len);
498
- }
499
- break;
500
- case 24:
501
- (msg.type, pos) = ProtobufRuntime._decode_varint(data, pos);
502
- break;
503
- case 32:
504
- (msg.status, pos) = ProtobufRuntime._decode_varint(data, pos);
505
- break;
506
- case 82:
507
- {
508
- uint64 _len;
509
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
510
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
511
- msg.amount = TokenAmountCodec.decode(_sub);
512
- pos += uint256(_len);
513
- }
514
- break;
515
- default:
516
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
517
- break;
466
+ if (tag == 8) {
467
+ (operatorAction.actionType, pos) = ProtobufRuntime._decode_varint(data, pos);
468
+ } else if (tag == 18) {
469
+ uint64 _len;
470
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
471
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
472
+ operatorAction.actor = ChainAddressCodec.decode(_sub);
473
+ pos += uint256(_len);
474
+ } else if (tag == 24) {
475
+ (operatorAction.type_, pos) = ProtobufRuntime._decode_varint(data, pos);
476
+ } else if (tag == 32) {
477
+ (operatorAction.status, pos) = ProtobufRuntime._decode_varint(data, pos);
478
+ } else if (tag == 82) {
479
+ uint64 _len;
480
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
481
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
482
+ operatorAction.amount = TokenAmountCodec.decode(_sub);
483
+ pos += uint256(_len);
484
+ } else {
485
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
518
486
  }
519
487
  }
520
488
  }
@@ -522,25 +490,25 @@ library OperatorActionCodec {
522
490
 
523
491
  library ReserveDisbursementCodec {
524
492
 
525
- function encode(ReserveDisbursement memory msg) internal pure returns (bytes memory) {
493
+ function encode(ReserveDisbursement memory reserveDisbursement) internal pure returns (bytes memory) {
526
494
  bytes memory buf = "";
527
495
 
528
496
  // field 1: actor
529
497
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
530
- bytes memory actor_encoded = ChainAddressCodec.encode(msg.actor);
498
+ bytes memory actor_encoded = ChainAddressCodec.encode(reserveDisbursement.actor);
531
499
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(actor_encoded.length)));
532
500
  buf = abi.encodePacked(buf, actor_encoded);
533
501
 
534
502
  // field 2: amount
535
503
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
536
- bytes memory amount_encoded = TokenAmountCodec.encode(msg.amount);
504
+ bytes memory amount_encoded = TokenAmountCodec.encode(reserveDisbursement.amount);
537
505
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(amount_encoded.length)));
538
506
  buf = abi.encodePacked(buf, amount_encoded);
539
507
 
540
508
  // field 3: signature
541
- for (uint256 _i_signature = 0; _i_signature < msg.signature.length; _i_signature++) {
509
+ for (uint256 _i_signature = 0; _i_signature < reserveDisbursement.signature.length; _i_signature++) {
542
510
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x1a));
543
- bytes memory _elem = ChainSignatureCodec.encode(msg.signature[_i_signature]);
511
+ bytes memory _elem = ChainSignatureCodec.encode(reserveDisbursement.signature[_i_signature]);
544
512
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(_elem.length)));
545
513
  buf = abi.encodePacked(buf, _elem);
546
514
  }
@@ -548,46 +516,47 @@ library ReserveDisbursementCodec {
548
516
  return buf;
549
517
  }
550
518
 
551
- function decode(bytes memory data) internal pure returns (ReserveDisbursement memory msg) {
519
+ function decode(bytes memory data) internal pure returns (ReserveDisbursement memory reserveDisbursement) {
552
520
  uint256 pos = 0;
553
521
  uint256 end = data.length;
554
522
 
523
+ uint256 _count_signature = 0;
524
+ {
525
+ uint256 _pos = 0;
526
+ while (_pos < end) {
527
+ uint64 _tag;
528
+ (_tag, _pos) = ProtobufRuntime._decode_key(data, _pos);
529
+ if (_tag == 26) { _count_signature++; }
530
+ _pos = ProtobufRuntime._skip_field(data, _pos, _tag & 0x07);
531
+ }
532
+ }
533
+ reserveDisbursement.signature = new ChainSignature[](_count_signature);
534
+ uint256 _idx_signature = 0;
535
+
555
536
  while (pos < end) {
556
537
  uint64 tag;
557
538
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
558
539
 
559
- // solhint-disable-next-line no-empty-blocks
560
- switch (tag) {
561
- case 10:
562
- {
563
- uint64 _len;
564
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
565
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
566
- msg.actor = ChainAddressCodec.decode(_sub);
567
- pos += uint256(_len);
568
- }
569
- break;
570
- case 18:
571
- {
572
- uint64 _len;
573
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
574
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
575
- msg.amount = TokenAmountCodec.decode(_sub);
576
- pos += uint256(_len);
577
- }
578
- break;
579
- case 26:
580
- {
581
- uint64 _len;
582
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
583
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
584
- msg.signature.push(ChainSignatureCodec.decode(_sub));
585
- pos += uint256(_len);
586
- }
587
- break;
588
- default:
589
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
590
- break;
540
+ if (tag == 10) {
541
+ uint64 _len;
542
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
543
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
544
+ reserveDisbursement.actor = ChainAddressCodec.decode(_sub);
545
+ pos += uint256(_len);
546
+ } else if (tag == 18) {
547
+ uint64 _len;
548
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
549
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
550
+ reserveDisbursement.amount = TokenAmountCodec.decode(_sub);
551
+ pos += uint256(_len);
552
+ } else if (tag == 26) {
553
+ uint64 _len;
554
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
555
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
556
+ reserveDisbursement.signature[_idx_signature++] = ChainSignatureCodec.decode(_sub);
557
+ pos += uint256(_len);
558
+ } else {
559
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
591
560
  }
592
561
  }
593
562
  }
@@ -595,23 +564,23 @@ library ReserveDisbursementCodec {
595
564
 
596
565
  library TimestampedMessageCodec {
597
566
 
598
- function encode(TimestampedMessage memory msg) internal pure returns (bytes memory) {
567
+ function encode(TimestampedMessage memory timestampedMessage) internal pure returns (bytes memory) {
599
568
  bytes memory buf = "";
600
569
 
601
570
  // field 1: timestamp
602
571
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x8));
603
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(msg.timestamp));
572
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(timestampedMessage.timestamp));
604
573
 
605
574
  // field 2: message
606
575
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
607
- bytes memory message_encoded = MessageCodec.encode(msg.message);
576
+ bytes memory message_encoded = MessageCodec.encode(timestampedMessage.message);
608
577
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(message_encoded.length)));
609
578
  buf = abi.encodePacked(buf, message_encoded);
610
579
 
611
580
  return buf;
612
581
  }
613
582
 
614
- function decode(bytes memory data) internal pure returns (TimestampedMessage memory msg) {
583
+ function decode(bytes memory data) internal pure returns (TimestampedMessage memory timestampedMessage) {
615
584
  uint256 pos = 0;
616
585
  uint256 end = data.length;
617
586
 
@@ -619,23 +588,16 @@ library TimestampedMessageCodec {
619
588
  uint64 tag;
620
589
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
621
590
 
622
- // solhint-disable-next-line no-empty-blocks
623
- switch (tag) {
624
- case 8:
625
- (msg.timestamp, pos) = ProtobufRuntime._decode_varint(data, pos);
626
- break;
627
- case 18:
628
- {
629
- uint64 _len;
630
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
631
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
632
- msg.message = MessageCodec.decode(_sub);
633
- pos += uint256(_len);
634
- }
635
- break;
636
- default:
637
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
638
- break;
591
+ if (tag == 8) {
592
+ (timestampedMessage.timestamp, pos) = ProtobufRuntime._decode_varint(data, pos);
593
+ } else if (tag == 18) {
594
+ uint64 _len;
595
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
596
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
597
+ timestampedMessage.message = MessageCodec.decode(_sub);
598
+ pos += uint256(_len);
599
+ } else {
600
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
639
601
  }
640
602
  }
641
603
  }
@@ -643,35 +605,35 @@ library TimestampedMessageCodec {
643
605
 
644
606
  library ProtocolStateCodec {
645
607
 
646
- function encode(ProtocolState memory msg) internal pure returns (bytes memory) {
608
+ function encode(ProtocolState memory protocolState) internal pure returns (bytes memory) {
647
609
  bytes memory buf = "";
648
610
 
649
611
  // field 1: chain_id
650
612
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0xa));
651
- bytes memory chainId_encoded = ChainIdCodec.encode(msg.chainId);
613
+ bytes memory chainId_encoded = ChainIdCodec.encode(protocolState.chainId);
652
614
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(chainId_encoded.length)));
653
615
  buf = abi.encodePacked(buf, chainId_encoded);
654
616
 
655
617
  // field 2: current_message_id
656
618
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x12));
657
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(msg.currentMessageId));
619
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(protocolState.currentMessageId));
658
620
 
659
621
  // field 3: processed_message_id
660
622
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x1a));
661
- buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(msg.processedMessageId));
623
+ buf = abi.encodePacked(buf, ProtobufRuntime._encode_bytes(protocolState.processedMessageId));
662
624
 
663
625
  // field 4: incoming_messages
664
- for (uint256 _i_incomingMessages = 0; _i_incomingMessages < msg.incomingMessages.length; _i_incomingMessages++) {
626
+ for (uint256 _i_incomingMessages = 0; _i_incomingMessages < protocolState.incomingMessages.length; _i_incomingMessages++) {
665
627
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x22));
666
- bytes memory _elem = TimestampedMessageCodec.encode(msg.incomingMessages[_i_incomingMessages]);
628
+ bytes memory _elem = TimestampedMessageCodec.encode(protocolState.incomingMessages[_i_incomingMessages]);
667
629
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(_elem.length)));
668
630
  buf = abi.encodePacked(buf, _elem);
669
631
  }
670
632
 
671
633
  // field 5: outgoing
672
- for (uint256 _i_outgoing = 0; _i_outgoing < msg.outgoing.length; _i_outgoing++) {
634
+ for (uint256 _i_outgoing = 0; _i_outgoing < protocolState.outgoing.length; _i_outgoing++) {
673
635
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_key(0x2a));
674
- bytes memory _elem = MessageCodec.encode(msg.outgoing[_i_outgoing]);
636
+ bytes memory _elem = MessageCodec.encode(protocolState.outgoing[_i_outgoing]);
675
637
  buf = abi.encodePacked(buf, ProtobufRuntime._encode_varint(uint64(_elem.length)));
676
638
  buf = abi.encodePacked(buf, _elem);
677
639
  }
@@ -679,52 +641,55 @@ library ProtocolStateCodec {
679
641
  return buf;
680
642
  }
681
643
 
682
- function decode(bytes memory data) internal pure returns (ProtocolState memory msg) {
644
+ function decode(bytes memory data) internal pure returns (ProtocolState memory protocolState) {
683
645
  uint256 pos = 0;
684
646
  uint256 end = data.length;
685
647
 
648
+ uint256 _count_incomingMessages = 0;
649
+ uint256 _count_outgoing = 0;
650
+ {
651
+ uint256 _pos = 0;
652
+ while (_pos < end) {
653
+ uint64 _tag;
654
+ (_tag, _pos) = ProtobufRuntime._decode_key(data, _pos);
655
+ if (_tag == 34) { _count_incomingMessages++; }
656
+ if (_tag == 42) { _count_outgoing++; }
657
+ _pos = ProtobufRuntime._skip_field(data, _pos, _tag & 0x07);
658
+ }
659
+ }
660
+ protocolState.incomingMessages = new TimestampedMessage[](_count_incomingMessages);
661
+ protocolState.outgoing = new Message[](_count_outgoing);
662
+ uint256 _idx_incomingMessages = 0;
663
+ uint256 _idx_outgoing = 0;
664
+
686
665
  while (pos < end) {
687
666
  uint64 tag;
688
667
  (tag, pos) = ProtobufRuntime._decode_key(data, pos);
689
668
 
690
- // solhint-disable-next-line no-empty-blocks
691
- switch (tag) {
692
- case 10:
693
- {
694
- uint64 _len;
695
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
696
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
697
- msg.chainId = ChainIdCodec.decode(_sub);
698
- pos += uint256(_len);
699
- }
700
- break;
701
- case 18:
702
- (msg.currentMessageId, pos) = ProtobufRuntime._decode_bytes(data, pos);
703
- break;
704
- case 26:
705
- (msg.processedMessageId, pos) = ProtobufRuntime._decode_bytes(data, pos);
706
- break;
707
- case 34:
708
- {
709
- uint64 _len;
710
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
711
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
712
- msg.incomingMessages.push(TimestampedMessageCodec.decode(_sub));
713
- pos += uint256(_len);
714
- }
715
- break;
716
- case 42:
717
- {
718
- uint64 _len;
719
- (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
720
- bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
721
- msg.outgoing.push(MessageCodec.decode(_sub));
722
- pos += uint256(_len);
723
- }
724
- break;
725
- default:
726
- pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
727
- break;
669
+ if (tag == 10) {
670
+ uint64 _len;
671
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
672
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
673
+ protocolState.chainId = ChainIdCodec.decode(_sub);
674
+ pos += uint256(_len);
675
+ } else if (tag == 18) {
676
+ (protocolState.currentMessageId, pos) = ProtobufRuntime._decode_bytes(data, pos);
677
+ } else if (tag == 26) {
678
+ (protocolState.processedMessageId, pos) = ProtobufRuntime._decode_bytes(data, pos);
679
+ } else if (tag == 34) {
680
+ uint64 _len;
681
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
682
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
683
+ protocolState.incomingMessages[_idx_incomingMessages++] = TimestampedMessageCodec.decode(_sub);
684
+ pos += uint256(_len);
685
+ } else if (tag == 42) {
686
+ uint64 _len;
687
+ (_len, pos) = ProtobufRuntime._decode_varint(data, pos);
688
+ bytes memory _sub = ProtobufRuntime._slice(data, pos, pos + uint256(_len));
689
+ protocolState.outgoing[_idx_outgoing++] = MessageCodec.decode(_sub);
690
+ pos += uint256(_len);
691
+ } else {
692
+ pos = ProtobufRuntime._skip_field(data, pos, tag & 0x07);
728
693
  }
729
694
  }
730
695
  }