Skip to main content

thruput_node_rpc/
sched_coord.rs

1// -*-Rust-*-
2// Generated Code: DO NOT CHECK IN
3
4// Generated from xdrc commit: cb9cab8a8d69ace37c18d49b505f1e93ec802af8
5
6#![allow(non_camel_case_types)]
7#![allow(non_snake_case)]
8#![allow(non_upper_case_globals)]
9#![allow(unused_imports)]
10#![allow(dead_code)]
11#![allow(unused_variables)]
12#![allow(clippy::unnecessary_cast)]
13
14use crate::*;
15use core::option::Option;
16use core::ops::{Deref, DerefMut};
17
18#[cfg(feature = "std")]
19use std::io::{Read, Write};
20use xdrs::*;
21
22
23#[cfg(feature = "serde")]
24use ::serde::{{Serialize, Deserialize}};
25
26
27
28// clang-format on
29
30#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31#[cfg_attr(feature = "serde", serde(transparent))]
32#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
33#[derive(schemars::JsonSchema)]
34#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
35#[derive(Copy)]
36#[repr(transparent)]
37pub struct CoordinatorRegistrationOutcome(pub i32);
38
39impl CoordinatorRegistrationOutcome {
40    pub const CoordinatorRegistrationOK: Self = Self(0);
41    pub const CoordinatorRegistrationInvalidProtocol: Self = Self(1);
42    pub const CoordinatorRegistrationAlreadyRegistered: Self = Self(2);
43}
44impl From<i32> for CoordinatorRegistrationOutcome {
45    fn from(v: i32) -> Self {
46        Self(v)
47    }
48}
49#[cfg(feature = "std")]
50impl core::fmt::Display for CoordinatorRegistrationOutcome {
51    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
52        match self.0 {
53            x if x == Self::CoordinatorRegistrationOK.0 => {
54                write!(f, "CoordinatorRegistrationOutcome::CoordinatorRegistrationOK")
55            },
56            x if x == Self::CoordinatorRegistrationInvalidProtocol.0 => {
57                write!(f, "CoordinatorRegistrationOutcome::CoordinatorRegistrationInvalidProtocol")
58            },
59            x if x == Self::CoordinatorRegistrationAlreadyRegistered.0 => {
60                write!(f, "CoordinatorRegistrationOutcome::CoordinatorRegistrationAlreadyRegistered")
61            },
62            _ => {
63                write!(f, "CoordinatorRegistrationOutcome({})", self.0)
64            }
65        }
66    }
67}
68
69
70#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
71#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
72#[derive(schemars::JsonSchema)]
73#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
74#[repr(C)]
75pub struct CoordCard {
76    pub protocol: ProtocolCommit,
77    pub address_for_sched: ServerAddress,
78}
79
80#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
81#[cfg_attr(feature = "serde", serde(transparent))]
82#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
83#[derive(schemars::JsonSchema)]
84#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
85#[derive(Copy)]
86#[repr(transparent)]
87pub struct SchedulerProposalOutcome(pub i32);
88
89impl SchedulerProposalOutcome {
90    pub const SchedulerProposalOK: Self = Self(0);
91    pub const SchedulerProposalError: Self = Self(1);
92}
93impl From<i32> for SchedulerProposalOutcome {
94    fn from(v: i32) -> Self {
95        Self(v)
96    }
97}
98#[cfg(feature = "std")]
99impl core::fmt::Display for SchedulerProposalOutcome {
100    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
101        match self.0 {
102            x if x == Self::SchedulerProposalOK.0 => {
103                write!(f, "SchedulerProposalOutcome::SchedulerProposalOK")
104            },
105            x if x == Self::SchedulerProposalError.0 => {
106                write!(f, "SchedulerProposalOutcome::SchedulerProposalError")
107            },
108            _ => {
109                write!(f, "SchedulerProposalOutcome({})", self.0)
110            }
111        }
112    }
113}
114
115
116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
117#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
118#[derive(schemars::JsonSchema)]
119#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
120#[repr(C)]
121pub struct SchedulerProposedBlock {
122    pub block_id: BlockID,
123    pub txs: ParallelSignedTransactionBatch,
124    pub proposal: Proposal,
125}
126
127#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
129#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
130#[derive(schemars::JsonSchema)]
131#[repr(i32)]
132#[non_exhaustive]
133pub enum SchedulerProposalResult {
134    // case SchedulerProposalOK:
135    //   SchedulerProposedBlock proposed_block;
136    SchedulerProposalOK { proposed_block: SchedulerProposedBlock } = SchedulerProposalOutcome::SchedulerProposalOK.0 as i32,
137    // case SchedulerProposalError:
138    //   void;
139    SchedulerProposalError = SchedulerProposalOutcome::SchedulerProposalError.0 as i32,
140    
141}
142
143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
144#[cfg_attr(feature = "serde", serde(transparent))]
145#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
146#[derive(schemars::JsonSchema)]
147#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
148#[derive(Copy)]
149#[repr(transparent)]
150pub struct SchedulerValidationOutcome(pub i32);
151
152impl SchedulerValidationOutcome {
153    pub const SchedulerValidationOK: Self = Self(0);
154    pub const SchedulerValidationInvalid: Self = Self(1);
155    pub const SchedulerValidationMissingTxs: Self = Self(2);
156    pub const SchedulerValidationDbFailed: Self = Self(3);
157    pub const SchedulerValidationExecutorFailed: Self = Self(4);
158    pub const SchedulerValidationTooLateToValidate: Self = Self(5);
159    pub const SchedulerValidationUnknownParentBlock: Self = Self(6);
160
161    // Proposal batch metadata is malformed or fails to decode (e.g.
162    // segment token/byte counts are inconsistent, XDR deserialization
163    // fails, or signed_hash/nondeterministic_data counts do not match).
164    pub const SchedulerValidationMalformed: Self = Self(7);
165}
166impl From<i32> for SchedulerValidationOutcome {
167    fn from(v: i32) -> Self {
168        Self(v)
169    }
170}
171#[cfg(feature = "std")]
172impl core::fmt::Display for SchedulerValidationOutcome {
173    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
174        match self.0 {
175            x if x == Self::SchedulerValidationOK.0 => {
176                write!(f, "SchedulerValidationOutcome::SchedulerValidationOK")
177            },
178            x if x == Self::SchedulerValidationInvalid.0 => {
179                write!(f, "SchedulerValidationOutcome::SchedulerValidationInvalid")
180            },
181            x if x == Self::SchedulerValidationMissingTxs.0 => {
182                write!(f, "SchedulerValidationOutcome::SchedulerValidationMissingTxs")
183            },
184            x if x == Self::SchedulerValidationDbFailed.0 => {
185                write!(f, "SchedulerValidationOutcome::SchedulerValidationDbFailed")
186            },
187            x if x == Self::SchedulerValidationExecutorFailed.0 => {
188                write!(f, "SchedulerValidationOutcome::SchedulerValidationExecutorFailed")
189            },
190            x if x == Self::SchedulerValidationTooLateToValidate.0 => {
191                write!(f, "SchedulerValidationOutcome::SchedulerValidationTooLateToValidate")
192            },
193            x if x == Self::SchedulerValidationUnknownParentBlock.0 => {
194                write!(f, "SchedulerValidationOutcome::SchedulerValidationUnknownParentBlock")
195            },
196            x if x == Self::SchedulerValidationMalformed.0 => {
197                write!(f, "SchedulerValidationOutcome::SchedulerValidationMalformed")
198            },
199            _ => {
200                write!(f, "SchedulerValidationOutcome({})", self.0)
201            }
202        }
203    }
204}
205
206
207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
208#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
209#[derive(schemars::JsonSchema)]
210#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
211#[repr(C)]
212pub struct SchedulerValidationBlock {
213    pub block_id: BlockID,
214    pub signed_transactions: ParallelSignedTransactionBatch,
215}
216
217#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
220#[derive(schemars::JsonSchema)]
221#[repr(i32)]
222#[non_exhaustive]
223pub enum SchedulerValidationResult {
224    // case SchedulerValidationOK:
225    //   SchedulerValidationBlock block;
226    SchedulerValidationOK { block: SchedulerValidationBlock } = SchedulerValidationOutcome::SchedulerValidationOK.0 as i32,
227    // The proposal's transactions this mempool does not hold in the proposed
228    // encoding, including bodies it holds under a different signing.
229    // case SchedulerValidationMissingTxs:
230    //   VecM<SignedTransactionHash> missing_signed_tx_hashes;
231    SchedulerValidationMissingTxs { missing_signed_tx_hashes: VecM<SignedTransactionHash> } = SchedulerValidationOutcome::SchedulerValidationMissingTxs.0 as i32,
232    // case SchedulerValidationDbFailed:
233    // case SchedulerValidationExecutorFailed:
234    // case SchedulerValidationInvalid:
235    // case SchedulerValidationTooLateToValidate:
236    // case SchedulerValidationUnknownParentBlock:
237    // case SchedulerValidationMalformed:
238    //   void;
239    SchedulerValidationDbFailed = SchedulerValidationOutcome::SchedulerValidationDbFailed.0 as i32,
240    SchedulerValidationExecutorFailed = SchedulerValidationOutcome::SchedulerValidationExecutorFailed.0 as i32,
241    SchedulerValidationInvalid = SchedulerValidationOutcome::SchedulerValidationInvalid.0 as i32,
242    SchedulerValidationTooLateToValidate = SchedulerValidationOutcome::SchedulerValidationTooLateToValidate.0 as i32,
243    SchedulerValidationUnknownParentBlock = SchedulerValidationOutcome::SchedulerValidationUnknownParentBlock.0 as i32,
244    SchedulerValidationMalformed = SchedulerValidationOutcome::SchedulerValidationMalformed.0 as i32,
245    
246}
247
248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
249#[cfg_attr(feature = "serde", serde(transparent))]
250#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
251#[derive(schemars::JsonSchema)]
252#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
253#[derive(Copy)]
254#[repr(transparent)]
255pub struct SchedulerCommitOutcome(pub i32);
256
257impl SchedulerCommitOutcome {
258    pub const SchedulerCommitOK: Self = Self(0);
259    pub const SchedulerCommitBlockNotFound: Self = Self(1);
260    pub const SchedulerCommitInvalidConsensusValue: Self = Self(2);
261    pub const SchedulerConcurrentCommit: Self = Self(3);
262}
263impl From<i32> for SchedulerCommitOutcome {
264    fn from(v: i32) -> Self {
265        Self(v)
266    }
267}
268#[cfg(feature = "std")]
269impl core::fmt::Display for SchedulerCommitOutcome {
270    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
271        match self.0 {
272            x if x == Self::SchedulerCommitOK.0 => {
273                write!(f, "SchedulerCommitOutcome::SchedulerCommitOK")
274            },
275            x if x == Self::SchedulerCommitBlockNotFound.0 => {
276                write!(f, "SchedulerCommitOutcome::SchedulerCommitBlockNotFound")
277            },
278            x if x == Self::SchedulerCommitInvalidConsensusValue.0 => {
279                write!(f, "SchedulerCommitOutcome::SchedulerCommitInvalidConsensusValue")
280            },
281            x if x == Self::SchedulerConcurrentCommit.0 => {
282                write!(f, "SchedulerCommitOutcome::SchedulerConcurrentCommit")
283            },
284            _ => {
285                write!(f, "SchedulerCommitOutcome({})", self.0)
286            }
287        }
288    }
289}
290
291
292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
293#[cfg_attr(feature = "serde", serde(transparent))]
294#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
295#[derive(schemars::JsonSchema)]
296#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
297#[derive(Copy)]
298#[repr(transparent)]
299pub struct SchedulerGetTipOutcome(pub i32);
300
301impl SchedulerGetTipOutcome {
302    pub const SchedulerGetTipOK: Self = Self(0);
303    pub const SchedulerGetTipNoGenesisBlock: Self = Self(1);
304}
305impl From<i32> for SchedulerGetTipOutcome {
306    fn from(v: i32) -> Self {
307        Self(v)
308    }
309}
310#[cfg(feature = "std")]
311impl core::fmt::Display for SchedulerGetTipOutcome {
312    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
313        match self.0 {
314            x if x == Self::SchedulerGetTipOK.0 => {
315                write!(f, "SchedulerGetTipOutcome::SchedulerGetTipOK")
316            },
317            x if x == Self::SchedulerGetTipNoGenesisBlock.0 => {
318                write!(f, "SchedulerGetTipOutcome::SchedulerGetTipNoGenesisBlock")
319            },
320            _ => {
321                write!(f, "SchedulerGetTipOutcome({})", self.0)
322            }
323        }
324    }
325}
326
327
328#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
330#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
331#[derive(schemars::JsonSchema)]
332#[repr(i32)]
333#[non_exhaustive]
334pub enum SchedulerGetTipResult {
335    // case SchedulerGetTipOK:
336    //   DbTip db_tip;
337    SchedulerGetTipOK { db_tip: DbTip } = SchedulerGetTipOutcome::SchedulerGetTipOK.0 as i32,
338    // case SchedulerGetTipNoGenesisBlock:
339    //   void;
340    SchedulerGetTipNoGenesisBlock = SchedulerGetTipOutcome::SchedulerGetTipNoGenesisBlock.0 as i32,
341    
342}
343
344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
345#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
346#[derive(schemars::JsonSchema)]
347#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
348#[repr(C)]
349pub struct GenesisCeremonyRequest {
350    pub expected_parent_height: BlockHeight,
351    pub expected_parent_value_hash: ConsensusValueHash,
352    pub context: ProposalContext,
353    pub transactions: ParallelSignedTransactionBatch,
354}
355
356#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
357#[cfg_attr(feature = "serde", serde(transparent))]
358#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
359#[derive(schemars::JsonSchema)]
360#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
361#[derive(Copy)]
362#[repr(transparent)]
363pub struct GenesisCeremonyOutcome(pub i32);
364
365impl GenesisCeremonyOutcome {
366    pub const GenesisCeremonyCommitted: Self = Self(0);
367    pub const GenesisCeremonyParentMismatch: Self = Self(2);
368    pub const GenesisCeremonyBatchMismatch: Self = Self(3);
369    pub const GenesisCeremonyInvalidTransaction: Self = Self(4);
370    pub const GenesisCeremonyExecutionFailed: Self = Self(5);
371}
372impl From<i32> for GenesisCeremonyOutcome {
373    fn from(v: i32) -> Self {
374        Self(v)
375    }
376}
377#[cfg(feature = "std")]
378impl core::fmt::Display for GenesisCeremonyOutcome {
379    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
380        match self.0 {
381            x if x == Self::GenesisCeremonyCommitted.0 => {
382                write!(f, "GenesisCeremonyOutcome::GenesisCeremonyCommitted")
383            },
384            x if x == Self::GenesisCeremonyParentMismatch.0 => {
385                write!(f, "GenesisCeremonyOutcome::GenesisCeremonyParentMismatch")
386            },
387            x if x == Self::GenesisCeremonyBatchMismatch.0 => {
388                write!(f, "GenesisCeremonyOutcome::GenesisCeremonyBatchMismatch")
389            },
390            x if x == Self::GenesisCeremonyInvalidTransaction.0 => {
391                write!(f, "GenesisCeremonyOutcome::GenesisCeremonyInvalidTransaction")
392            },
393            x if x == Self::GenesisCeremonyExecutionFailed.0 => {
394                write!(f, "GenesisCeremonyOutcome::GenesisCeremonyExecutionFailed")
395            },
396            _ => {
397                write!(f, "GenesisCeremonyOutcome({})", self.0)
398            }
399        }
400    }
401}
402
403
404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
405#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
406#[derive(schemars::JsonSchema)]
407#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
408#[repr(C)]
409pub struct GenesisCeremonyCommit {
410    pub db_tip: DbTip,
411    pub proposal_txs: ProposalTxs,
412}
413
414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
415#[cfg_attr(feature = "serde", serde(transparent))]
416#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
417#[derive(schemars::JsonSchema)]
418#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
419#[derive(Copy)]
420#[repr(transparent)]
421pub struct SchedulerTransactionStatus(pub i32);
422
423impl SchedulerTransactionStatus {
424    // The transaction is not pending and has no retained outcome. Note that the
425    // tx *may* have existed at some point in the past, but has since been dropped
426    // altogether from the mempool since the bounded queue filled. This not-found
427    // status does not necessarily mean the tx has never existed at all.
428    pub const SchedulerTransactionNotFound: Self = Self(0);
429
430    // The transaction is currently pending in the mempool.
431    pub const SchedulerTransactionPending: Self = Self(1);
432
433    // The transaction was successfully committed in a block. This status does
434    // *not* mean that the tx was successfully included in a proposed block or a
435    // verified block--the block needs to go on to actually be committed.
436    pub const SchedulerTransactionSucceeded: Self = Self(2);
437
438    // Processing failed for a retryable reason; the transaction may be
439    // resubmitted. Note that it is the responsibility of the wallet owner to
440    // resubmit the tx--the mempool will not retry the tx on its own.
441    pub const SchedulerTransactionRetry: Self = Self(3);
442
443    // Processing failed permanently; the transaction should not be resubmitted
444    // because the error is irrecoverable (e.g., failed authentication). The tx
445    // needs to be modified in some way before it can be successfully processed.
446    pub const SchedulerTransactionDropped: Self = Self(4);
447}
448impl From<i32> for SchedulerTransactionStatus {
449    fn from(v: i32) -> Self {
450        Self(v)
451    }
452}
453#[cfg(feature = "std")]
454impl core::fmt::Display for SchedulerTransactionStatus {
455    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
456        match self.0 {
457            x if x == Self::SchedulerTransactionNotFound.0 => {
458                write!(f, "SchedulerTransactionStatus::SchedulerTransactionNotFound")
459            },
460            x if x == Self::SchedulerTransactionPending.0 => {
461                write!(f, "SchedulerTransactionStatus::SchedulerTransactionPending")
462            },
463            x if x == Self::SchedulerTransactionSucceeded.0 => {
464                write!(f, "SchedulerTransactionStatus::SchedulerTransactionSucceeded")
465            },
466            x if x == Self::SchedulerTransactionRetry.0 => {
467                write!(f, "SchedulerTransactionStatus::SchedulerTransactionRetry")
468            },
469            x if x == Self::SchedulerTransactionDropped.0 => {
470                write!(f, "SchedulerTransactionStatus::SchedulerTransactionDropped")
471            },
472            _ => {
473                write!(f, "SchedulerTransactionStatus({})", self.0)
474            }
475        }
476    }
477}
478
479
480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
481#[cfg_attr(feature = "serde", serde(transparent))]
482#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
483#[derive(schemars::JsonSchema)]
484#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
485#[derive(Copy)]
486#[repr(transparent)]
487pub struct SchedulerTransactionErrorSource(pub i32);
488
489impl SchedulerTransactionErrorSource {
490    // There is no error to report.
491    pub const SchedulerTransactionErrorNone: Self = Self(0);
492
493    // The error was triggered by the authentication subsystem.
494    pub const SchedulerTransactionErrorAuth: Self = Self(1);
495
496    // The error was triggered by the mempool.
497    pub const SchedulerTransactionErrorScheduler: Self = Self(2);
498
499    // The error was triggered by an executor.
500    pub const SchedulerTransactionErrorExecutor: Self = Self(3);
501}
502impl From<i32> for SchedulerTransactionErrorSource {
503    fn from(v: i32) -> Self {
504        Self(v)
505    }
506}
507#[cfg(feature = "std")]
508impl core::fmt::Display for SchedulerTransactionErrorSource {
509    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
510        match self.0 {
511            x if x == Self::SchedulerTransactionErrorNone.0 => {
512                write!(f, "SchedulerTransactionErrorSource::SchedulerTransactionErrorNone")
513            },
514            x if x == Self::SchedulerTransactionErrorAuth.0 => {
515                write!(f, "SchedulerTransactionErrorSource::SchedulerTransactionErrorAuth")
516            },
517            x if x == Self::SchedulerTransactionErrorScheduler.0 => {
518                write!(f, "SchedulerTransactionErrorSource::SchedulerTransactionErrorScheduler")
519            },
520            x if x == Self::SchedulerTransactionErrorExecutor.0 => {
521                write!(f, "SchedulerTransactionErrorSource::SchedulerTransactionErrorExecutor")
522            },
523            _ => {
524                write!(f, "SchedulerTransactionErrorSource({})", self.0)
525            }
526        }
527    }
528}
529
530
531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
532#[cfg_attr(feature = "serde", serde(transparent))]
533#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
534#[derive(schemars::JsonSchema)]
535#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
536#[derive(Copy)]
537#[repr(transparent)]
538pub struct SchedulerErrorCode(pub i32);
539
540impl SchedulerErrorCode {
541    // The mempool had no capacity to admit the transaction.
542    pub const SchedulerErrorCapacity: Self = Self(1);
543
544    // The scheduler could not obtain the account's average native-token age.
545    pub const SchedulerErrorNativeTokenAgeUnavailable: Self = Self(2);
546
547    // The transaction's expiry block height is earlier than the current block.
548    pub const SchedulerErrorExpired: Self = Self(3);
549
550    // The transaction's gas limit exceeds the account's available native tokens.
551    pub const SchedulerErrorInsufficientNativeTokens: Self = Self(4);
552}
553impl From<i32> for SchedulerErrorCode {
554    fn from(v: i32) -> Self {
555        Self(v)
556    }
557}
558#[cfg(feature = "std")]
559impl core::fmt::Display for SchedulerErrorCode {
560    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
561        match self.0 {
562            x if x == Self::SchedulerErrorCapacity.0 => {
563                write!(f, "SchedulerErrorCode::SchedulerErrorCapacity")
564            },
565            x if x == Self::SchedulerErrorNativeTokenAgeUnavailable.0 => {
566                write!(f, "SchedulerErrorCode::SchedulerErrorNativeTokenAgeUnavailable")
567            },
568            x if x == Self::SchedulerErrorExpired.0 => {
569                write!(f, "SchedulerErrorCode::SchedulerErrorExpired")
570            },
571            x if x == Self::SchedulerErrorInsufficientNativeTokens.0 => {
572                write!(f, "SchedulerErrorCode::SchedulerErrorInsufficientNativeTokens")
573            },
574            _ => {
575                write!(f, "SchedulerErrorCode({})", self.0)
576            }
577        }
578    }
579}
580
581
582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
583#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
584#[derive(schemars::JsonSchema)]
585#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
586#[repr(C)]
587pub struct SchedulerTransactionOutcome {
588    // The tx status. If the status is an error, then [error_source] and
589    // [error_code] are filled in below. If the status is not an error, then
590    // [error_source] and [error_code] have unspecified values.
591    pub status: SchedulerTransactionStatus,
592    // Identifies the enum represented by [error_code] below.
593    //
594    // - None ([SchedulerTransactionErrorNone]): there was no error and
595    //   [error_code] has an unspecified value.
596    //
597    // - Auth, Scheduler, and Executor: [error_code] is an [AuthErrorCode],
598    //   [SchedulerErrorCode], or [ExecResult], respectively.
599    pub error_source: SchedulerTransactionErrorSource,
600    // The actual error.
601    pub error_code: i32,
602    // For [SchedulerTransactionSucceeded], the committed block height.
603    // For [SchedulerTransactionRetry] or [SchedulerTransactionDropped], the
604    // proposal height for an executor failure, or the current chain height for
605    // an admission/scheduler failure.
606    // For [SchedulerTransactionPending], the current chain height at lookup.
607    // Unspecified for [SchedulerTransactionNotFound].
608    // Zero is a valid height.
609    pub height: BlockHeight,
610}
611
612pub type SchedulerTransactionOutcomeBatch = VecM::<SchedulerTransactionOutcome>;
613
614#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
616#[derive(ReadXDR, WriteXDR, ConstXDRSize)]
617#[derive(schemars::JsonSchema)]
618#[repr(i32)]
619#[non_exhaustive]
620pub enum GenesisCeremonyResult {
621    // case GenesisCeremonyCommitted:
622    //   GenesisCeremonyCommit commit;
623    GenesisCeremonyCommitted { commit: GenesisCeremonyCommit } = GenesisCeremonyOutcome::GenesisCeremonyCommitted.0 as i32,
624    // default:
625    //   void;
626    #[xdr(default_variant)] Default { outcome: i32 },
627}
628
629
630/// Each handler replies with anything that encodes like the reply type.
631/// Implementations can be plain `async fn`s returning a concrete reply type
632/// under `#[allow(refining_impl_trait)]`.
633#[allow(non_camel_case_types)]
634pub trait SchedulerCoord_SchedulerCoord1: Send + Sync {    
635    fn schedulercoord_null(&self) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<()>, ::thruput_rpc_api::ProgramError>> + Send;
636    
637    fn schedulercoord_intro_coord(&self, arg0 : CoordCard) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<CoordinatorRegistrationOutcome>, ::thruput_rpc_api::ProgramError>> + Send;
638        // Coordinator calls schedulercoord_submit_unvetted to submit new/unvetted
639    // transactions coming from the wallet. Asynchronously, the scheduler will
640    // call the coordinator's coordscheduler_notify_vetted to notify the
641    // coordinator when transactions have become vetted and can be broadcast
642    // to the network.
643
644    fn schedulercoord_submit_unvetted(&self, arg0 : ParallelSignedTransactionBatch) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<()>, ::thruput_rpc_api::ProgramError>> + Send;
645    
646    fn schedulercoord_submit_vetted(&self, arg0 : ValidatorID, arg1 : ParallelSignedTransactionBatch) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<()>, ::thruput_rpc_api::ProgramError>> + Send;
647        // schedulercoord_propose asks the scheduler to prepare a proposal (a
648    // block proposal) on top of the given db block.
649
650    fn schedulercoord_propose_block(&self, arg0 : BlockID, arg1 : ProposalContext) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<SchedulerProposalResult>, ::thruput_rpc_api::ProgramError>> + Send;
651        // schedulercoord_validate asks the scheduler to validate a proposal,
652    // and if successful, return the block ID in the db of the validated
653    // block. BlockID is the block onto which the proposal is done.
654
655    fn schedulercoord_validate_block(&self, arg0 : BlockID, arg1 : Proposal) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<SchedulerValidationResult>, ::thruput_rpc_api::ProgramError>> + Send;
656        // Commit the block with block ID. This block must have been previously
657    // proposed or validated by the mempool.
658    // On commit the block is associated with the ConsensusValue that confirmed it.
659    // This value is saved in the database and retrievable via schedcoord_get_tip.
660
661    fn schedulercoord_commit_block(&self, arg0 : BlockID, arg1 : ConsensusValue) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<SchedulerCommitOutcome>, ::thruput_rpc_api::ProgramError>> + Send;
662        // Returns information about the current highest committed block.
663    // If there is no committed block, returns SchedulerGetTipNoGenesisBlock.
664
665    fn schedcoord_get_tip(&self) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<SchedulerGetTipResult>, ::thruput_rpc_api::ProgramError>> + Send;
666    
667    fn schedcoord_load_genesis_configuration(&self, arg0 : GenesisConfiguration) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<DbSchedResult>, ::thruput_rpc_api::ProgramError>> + Send;
668    
669    fn schedulercoord_commit_genesis_ceremony(&self, arg0 : GenesisCeremonyRequest) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<GenesisCeremonyResult>, ::thruput_rpc_api::ProgramError>> + Send;
670        // Returns transactions from the mempool that have not yet been committed in a block,
671    // by their exact signed encoding.
672
673    fn schedcoord_lookup_transactions(&self, arg0 : SignedTransactionHashBatch) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<OptSignedTransactionBatch>, ::thruput_rpc_api::ProgramError>> + Send;
674        // Returns one pending or recent outcome per input hash (same order).
675
676    fn schedcoord_lookup_transaction_outcomes(&self, arg0 : TransactionHashBatch) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<SchedulerTransactionOutcomeBatch>, ::thruput_rpc_api::ProgramError>> + Send;
677}
678
679
680#[allow(non_camel_case_types)]
681pub struct SchedulerCoord_SchedulerCoord1_Dispatcher<__Handler> {
682  inner: Box<__Handler>,
683}
684
685impl<__Handler: SchedulerCoord_SchedulerCoord1> SchedulerCoord_SchedulerCoord1_Dispatcher<__Handler> {
686  pub fn new(inner: Box<__Handler>) -> Self {
687    Self { inner }
688  }
689}
690
691#[async_trait::async_trait]
692impl<__Handler: SchedulerCoord_SchedulerCoord1> ::thruput_rpc_api::RpcHandler for SchedulerCoord_SchedulerCoord1_Dispatcher<__Handler> {
693    fn prog_vers(&self) -> ::thruput_rpc_api::ProgVers {
694        ::thruput_rpc_api::ProgVers::new(0x76671111, 1)
695    }
696    async fn dispatch(&self, proc: u32, data: &[u8]) -> Result<Vec<u8>, ::thruput_rpc_api::RpcError> {
697        match proc {
698            // schedulercoord_null
699            0 => {
700                let args: () =
701                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
702                let res = self.inner.schedulercoord_null().await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
703                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
704            }
705            // schedulercoord_intro_coord
706            1 => {
707                let args: (CoordCard, ) =
708                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
709                let res = self.inner.schedulercoord_intro_coord(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
710                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
711            }
712            // schedulercoord_submit_unvetted
713            2 => {
714                let args: (ParallelSignedTransactionBatch, ) =
715                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
716                let res = self.inner.schedulercoord_submit_unvetted(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
717                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
718            }
719            // schedulercoord_submit_vetted
720            3 => {
721                let args: (ValidatorID, ParallelSignedTransactionBatch, ) =
722                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
723                let res = self.inner.schedulercoord_submit_vetted(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
724                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
725            }
726            // schedulercoord_propose_block
727            4 => {
728                let args: (BlockID, ProposalContext, ) =
729                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
730                let res = self.inner.schedulercoord_propose_block(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
731                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
732            }
733            // schedulercoord_validate_block
734            5 => {
735                let args: (BlockID, Proposal, ) =
736                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
737                let res = self.inner.schedulercoord_validate_block(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
738                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
739            }
740            // schedulercoord_commit_block
741            6 => {
742                let args: (BlockID, ConsensusValue, ) =
743                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
744                let res = self.inner.schedulercoord_commit_block(args.0, args.1).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
745                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
746            }
747            // schedcoord_get_tip
748            7 => {
749                let args: () =
750                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
751                let res = self.inner.schedcoord_get_tip().await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
752                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
753            }
754            // schedcoord_load_genesis_configuration
755            8 => {
756                let args: (GenesisConfiguration, ) =
757                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
758                let res = self.inner.schedcoord_load_genesis_configuration(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
759                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
760            }
761            // schedulercoord_commit_genesis_ceremony
762            10 => {
763                let args: (GenesisCeremonyRequest, ) =
764                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
765                let res = self.inner.schedulercoord_commit_genesis_ceremony(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
766                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
767            }
768            // schedcoord_lookup_transactions
769            100 => {
770                let args: (SignedTransactionHashBatch, ) =
771                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
772                let res = self.inner.schedcoord_lookup_transactions(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
773                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
774            }
775            // schedcoord_lookup_transaction_outcomes
776            101 => {
777                let args: (TransactionHashBatch, ) =
778                    xdrs::txs::decode(data).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
779                let res = self.inner.schedcoord_lookup_transaction_outcomes(args.0).await.map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?;
780                xdrs::txs::encode(&res).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)
781            }
782            _ => Err(::thruput_rpc_api::RpcError::InvalidProcedure),
783        }
784    }
785}
786
787#[derive(Clone)]
788pub struct SchedulerCoord_SchedulerCoord1_Client {
789    handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>,
790}
791
792impl SchedulerCoord_SchedulerCoord1_Client {
793    pub fn new(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
794        Self { handle }
795    }
796
797    fn prog_vers() -> ::thruput_rpc_api::ProgVers {
798        ::thruput_rpc_api::ProgVers::new(0x76671111, 1)
799    }
800    pub async fn schedulercoord_null(&self) -> Result<(), ::thruput_rpc_api::RpcError> {
801         let mut call = self.handle.call_buf();
802         call.append_with(|buf| {
803             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
804             let r = xdrs::write_xdr(&(), &mut w);
805             *buf = w.into();
806             r
807         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
808         let mut out = ::core::option::Option::None;
809         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
810             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
811             Ok(())
812         };
813         // SAFETY: the call future is awaited right here, so it lives in
814         // this method's future along with `out` and `decode`. Once that
815         // is polled it is pinned, so neither can be freed without the
816         // call future being dropped first. Decoding never blocks.
817         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 0, call, &mut decode) }.await?;
818         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
819    }
820    pub async fn schedulercoord_intro_coord(&self, arg0 : &(impl xdrs::EncodesAs<CoordCard> + ?Sized)) -> Result<CoordinatorRegistrationOutcome, ::thruput_rpc_api::RpcError> {
821         let mut call = self.handle.call_buf();
822         call.append_with(|buf| {
823             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
824             let r = xdrs::write_xdr(&(arg0), &mut w);
825             *buf = w.into();
826             r
827         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
828         let mut out = ::core::option::Option::None;
829         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
830             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
831             Ok(())
832         };
833         // SAFETY: the call future is awaited right here, so it lives in
834         // this method's future along with `out` and `decode`. Once that
835         // is polled it is pinned, so neither can be freed without the
836         // call future being dropped first. Decoding never blocks.
837         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 1, call, &mut decode) }.await?;
838         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
839    }
840    pub async fn schedulercoord_submit_unvetted(&self, arg0 : &(impl xdrs::EncodesAs<ParallelSignedTransactionBatch> + ?Sized)) -> Result<(), ::thruput_rpc_api::RpcError> {
841         let mut call = self.handle.call_buf();
842         call.append_with(|buf| {
843             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
844             let r = xdrs::write_xdr(&(arg0), &mut w);
845             *buf = w.into();
846             r
847         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
848         let mut out = ::core::option::Option::None;
849         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
850             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
851             Ok(())
852         };
853         // SAFETY: the call future is awaited right here, so it lives in
854         // this method's future along with `out` and `decode`. Once that
855         // is polled it is pinned, so neither can be freed without the
856         // call future being dropped first. Decoding never blocks.
857         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 2, call, &mut decode) }.await?;
858         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
859    }
860    pub async fn schedulercoord_submit_vetted(&self, arg0 : &(impl xdrs::EncodesAs<ValidatorID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<ParallelSignedTransactionBatch> + ?Sized)) -> Result<(), ::thruput_rpc_api::RpcError> {
861         let mut call = self.handle.call_buf();
862         call.append_with(|buf| {
863             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
864             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
865             *buf = w.into();
866             r
867         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
868         let mut out = ::core::option::Option::None;
869         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
870             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
871             Ok(())
872         };
873         // SAFETY: the call future is awaited right here, so it lives in
874         // this method's future along with `out` and `decode`. Once that
875         // is polled it is pinned, so neither can be freed without the
876         // call future being dropped first. Decoding never blocks.
877         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 3, call, &mut decode) }.await?;
878         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
879    }
880    pub async fn schedulercoord_propose_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<ProposalContext> + ?Sized)) -> Result<SchedulerProposalResult, ::thruput_rpc_api::RpcError> {
881         let mut call = self.handle.call_buf();
882         call.append_with(|buf| {
883             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
884             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
885             *buf = w.into();
886             r
887         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
888         let mut out = ::core::option::Option::None;
889         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
890             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
891             Ok(())
892         };
893         // SAFETY: the call future is awaited right here, so it lives in
894         // this method's future along with `out` and `decode`. Once that
895         // is polled it is pinned, so neither can be freed without the
896         // call future being dropped first. Decoding never blocks.
897         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 4, call, &mut decode) }.await?;
898         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
899    }
900    pub async fn schedulercoord_validate_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<Proposal> + ?Sized)) -> Result<SchedulerValidationResult, ::thruput_rpc_api::RpcError> {
901         let mut call = self.handle.call_buf();
902         call.append_with(|buf| {
903             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
904             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
905             *buf = w.into();
906             r
907         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
908         let mut out = ::core::option::Option::None;
909         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
910             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
911             Ok(())
912         };
913         // SAFETY: the call future is awaited right here, so it lives in
914         // this method's future along with `out` and `decode`. Once that
915         // is polled it is pinned, so neither can be freed without the
916         // call future being dropped first. Decoding never blocks.
917         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 5, call, &mut decode) }.await?;
918         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
919    }
920    pub async fn schedulercoord_commit_block(&self, arg0 : &(impl xdrs::EncodesAs<BlockID> + ?Sized), arg1 : &(impl xdrs::EncodesAs<ConsensusValue> + ?Sized)) -> Result<SchedulerCommitOutcome, ::thruput_rpc_api::RpcError> {
921         let mut call = self.handle.call_buf();
922         call.append_with(|buf| {
923             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
924             let r = xdrs::write_xdr(&(arg0, arg1), &mut w);
925             *buf = w.into();
926             r
927         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
928         let mut out = ::core::option::Option::None;
929         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
930             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
931             Ok(())
932         };
933         // SAFETY: the call future is awaited right here, so it lives in
934         // this method's future along with `out` and `decode`. Once that
935         // is polled it is pinned, so neither can be freed without the
936         // call future being dropped first. Decoding never blocks.
937         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 6, call, &mut decode) }.await?;
938         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
939    }
940    pub async fn schedcoord_get_tip(&self) -> Result<SchedulerGetTipResult, ::thruput_rpc_api::RpcError> {
941         let mut call = self.handle.call_buf();
942         call.append_with(|buf| {
943             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
944             let r = xdrs::write_xdr(&(), &mut w);
945             *buf = w.into();
946             r
947         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
948         let mut out = ::core::option::Option::None;
949         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
950             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
951             Ok(())
952         };
953         // SAFETY: the call future is awaited right here, so it lives in
954         // this method's future along with `out` and `decode`. Once that
955         // is polled it is pinned, so neither can be freed without the
956         // call future being dropped first. Decoding never blocks.
957         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 7, call, &mut decode) }.await?;
958         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
959    }
960    pub async fn schedcoord_load_genesis_configuration(&self, arg0 : &(impl xdrs::EncodesAs<GenesisConfiguration> + ?Sized)) -> Result<DbSchedResult, ::thruput_rpc_api::RpcError> {
961         let mut call = self.handle.call_buf();
962         call.append_with(|buf| {
963             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
964             let r = xdrs::write_xdr(&(arg0), &mut w);
965             *buf = w.into();
966             r
967         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
968         let mut out = ::core::option::Option::None;
969         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
970             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
971             Ok(())
972         };
973         // SAFETY: the call future is awaited right here, so it lives in
974         // this method's future along with `out` and `decode`. Once that
975         // is polled it is pinned, so neither can be freed without the
976         // call future being dropped first. Decoding never blocks.
977         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 8, call, &mut decode) }.await?;
978         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
979    }
980    pub async fn schedulercoord_commit_genesis_ceremony(&self, arg0 : &(impl xdrs::EncodesAs<GenesisCeremonyRequest> + ?Sized)) -> Result<GenesisCeremonyResult, ::thruput_rpc_api::RpcError> {
981         let mut call = self.handle.call_buf();
982         call.append_with(|buf| {
983             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
984             let r = xdrs::write_xdr(&(arg0), &mut w);
985             *buf = w.into();
986             r
987         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
988         let mut out = ::core::option::Option::None;
989         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
990             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
991             Ok(())
992         };
993         // SAFETY: the call future is awaited right here, so it lives in
994         // this method's future along with `out` and `decode`. Once that
995         // is polled it is pinned, so neither can be freed without the
996         // call future being dropped first. Decoding never blocks.
997         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 10, call, &mut decode) }.await?;
998         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
999    }
1000    pub async fn schedcoord_lookup_transactions(&self, arg0 : &(impl xdrs::EncodesAs<SignedTransactionHashBatch> + ?Sized)) -> Result<OptSignedTransactionBatch, ::thruput_rpc_api::RpcError> {
1001         let mut call = self.handle.call_buf();
1002         call.append_with(|buf| {
1003             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
1004             let r = xdrs::write_xdr(&(arg0), &mut w);
1005             *buf = w.into();
1006             r
1007         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
1008         let mut out = ::core::option::Option::None;
1009         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
1010             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
1011             Ok(())
1012         };
1013         // SAFETY: the call future is awaited right here, so it lives in
1014         // this method's future along with `out` and `decode`. Once that
1015         // is polled it is pinned, so neither can be freed without the
1016         // call future being dropped first. Decoding never blocks.
1017         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 100, call, &mut decode) }.await?;
1018         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
1019    }
1020    pub async fn schedcoord_lookup_transaction_outcomes(&self, arg0 : &(impl xdrs::EncodesAs<TransactionHashBatch> + ?Sized)) -> Result<SchedulerTransactionOutcomeBatch, ::thruput_rpc_api::RpcError> {
1021         let mut call = self.handle.call_buf();
1022         call.append_with(|buf| {
1023             let mut w = xdrs::txs::buf_writer::BufWriter::from(::core::mem::take(buf));
1024             let r = xdrs::write_xdr(&(arg0), &mut w);
1025             *buf = w.into();
1026             r
1027         }).map_err(|_| ::thruput_rpc_api::RpcError::GarbageArguments)?;
1028         let mut out = ::core::option::Option::None;
1029         let mut decode = |reply: &[u8]| -> ::core::result::Result<(), ::thruput_rpc_api::RpcError> {
1030             out = ::core::option::Option::Some(xdrs::txs::decode(reply).map_err(|_| ::thruput_rpc_api::RpcError::SystemError)?);
1031             Ok(())
1032         };
1033         // SAFETY: the call future is awaited right here, so it lives in
1034         // this method's future along with `out` and `decode`. Once that
1035         // is polled it is pinned, so neither can be freed without the
1036         // call future being dropped first. Decoding never blocks.
1037         unsafe { self.handle.send_call_decoded(Self::prog_vers(), 101, call, &mut decode) }.await?;
1038         out.ok_or(::thruput_rpc_api::RpcError::SystemError)
1039    }
1040}
1041
1042impl From<::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>> for SchedulerCoord_SchedulerCoord1_Client {
1043    fn from(handle: ::std::sync::Arc<dyn ::thruput_rpc_api::RpcSender>) -> Self {
1044        Self::new(handle)
1045    }
1046}
1047
1048
1049
1050//
1051// XDR internals below this point
1052//
1053
1054impl SchedulerProposalResult {
1055    #[allow(clippy::match_single_binding)]
1056    pub fn outcome(&self) -> SchedulerProposalOutcome {
1057        match self {
1058            
1059            _ => (unsafe { *(self as *const Self as *const i32) }).into(),
1060        }
1061    }
1062}
1063
1064impl SchedulerValidationResult {
1065    #[allow(clippy::match_single_binding)]
1066    pub fn outcome(&self) -> SchedulerValidationOutcome {
1067        match self {
1068            
1069            _ => (unsafe { *(self as *const Self as *const i32) }).into(),
1070        }
1071    }
1072}
1073
1074impl SchedulerGetTipResult {
1075    #[allow(clippy::match_single_binding)]
1076    pub fn outcome(&self) -> SchedulerGetTipOutcome {
1077        match self {
1078            
1079            _ => (unsafe { *(self as *const Self as *const i32) }).into(),
1080        }
1081    }
1082}
1083
1084impl GenesisCeremonyResult {
1085    #[allow(clippy::match_single_binding)]
1086    pub fn outcome(&self) -> GenesisCeremonyOutcome {
1087        match self {
1088            GenesisCeremonyResult::Default{ outcome } => (*outcome).into(),
1089
1090            _ => (unsafe { *(self as *const Self as *const i32) }).into(),
1091        }
1092    }
1093}
1094
1095