1#![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#[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 SchedulerProposalOK { proposed_block: SchedulerProposedBlock } = SchedulerProposalOutcome::SchedulerProposalOK.0 as i32,
137 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 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 SchedulerValidationOK { block: SchedulerValidationBlock } = SchedulerValidationOutcome::SchedulerValidationOK.0 as i32,
227 SchedulerValidationMissingTxs { missing_signed_tx_hashes: VecM<SignedTransactionHash> } = SchedulerValidationOutcome::SchedulerValidationMissingTxs.0 as i32,
232 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 SchedulerGetTipOK { db_tip: DbTip } = SchedulerGetTipOutcome::SchedulerGetTipOK.0 as i32,
338 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 pub const SchedulerTransactionNotFound: Self = Self(0);
429
430 pub const SchedulerTransactionPending: Self = Self(1);
432
433 pub const SchedulerTransactionSucceeded: Self = Self(2);
437
438 pub const SchedulerTransactionRetry: Self = Self(3);
442
443 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 pub const SchedulerTransactionErrorNone: Self = Self(0);
492
493 pub const SchedulerTransactionErrorAuth: Self = Self(1);
495
496 pub const SchedulerTransactionErrorScheduler: Self = Self(2);
498
499 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 pub const SchedulerErrorCapacity: Self = Self(1);
543
544 pub const SchedulerErrorNativeTokenAgeUnavailable: Self = Self(2);
546
547 pub const SchedulerErrorExpired: Self = Self(3);
549
550 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 pub status: SchedulerTransactionStatus,
592 pub error_source: SchedulerTransactionErrorSource,
600 pub error_code: i32,
602 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 GenesisCeremonyCommitted { commit: GenesisCeremonyCommit } = GenesisCeremonyOutcome::GenesisCeremonyCommitted.0 as i32,
624 #[xdr(default_variant)] Default { outcome: i32 },
627}
628
629
630#[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 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 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 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 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 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 fn schedcoord_lookup_transactions(&self, arg0 : SignedTransactionHashBatch) -> impl ::core::future::Future<Output = Result<impl xdrs::EncodesAs<OptSignedTransactionBatch>, ::thruput_rpc_api::ProgramError>> + Send;
674 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
1050impl 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