1use crate::{
2 AccountId, HasEventEmittedIndex, HasTxDispatchIndex, MultiAddress, StorageHasher, StorageMap, TransactionCall,
3};
4use codec::{Compact, Decode, Encode};
5use primitive_types::H256;
6use scale_decode::DecodeAsType;
7use scale_encode::EncodeAsType;
8
9pub mod data_availability {
10 use super::*;
11 pub const PALLET_ID: u8 = 29;
12
13 pub mod storage {
14 use super::*;
15
16 pub struct AppKeys;
17 impl StorageMap for AppKeys {
18 const PALLET_NAME: &str = "DataAvailability";
19 const STORAGE_NAME: &str = "AppKeys";
20 const KEY_HASHER: StorageHasher = StorageHasher::Blake2_128Concat;
21 type KEY = Vec<u8>;
22 type VALUE = super::types::AppKey;
23 }
24 }
25
26 pub mod types {
27 use super::*;
28
29 #[derive(Debug, Clone, codec::Decode)]
30 pub struct AppKey {
31 pub owner: AccountId,
32 #[codec(compact)]
33 pub id: u32,
34 }
35 }
36
37 pub mod events {
38 use super::*;
39
40 #[derive(Debug, Clone, Decode)]
41 pub struct ApplicationKeyCreated {
42 pub key: Vec<u8>,
43 pub owner: AccountId,
44 pub id: u32,
45 }
46 impl HasEventEmittedIndex for ApplicationKeyCreated {
47 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 0);
48 }
49
50 #[derive(Debug, Clone, Decode)]
51 pub struct DataSubmitted {
52 pub who: AccountId,
53 pub data_hash: H256,
54 }
55 impl HasEventEmittedIndex for DataSubmitted {
56 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 1);
57 }
58 }
59
60 pub mod tx {
61 use super::*;
62
63 #[derive(Debug, Clone)]
64 pub struct CreateApplicationKey {
65 pub key: Vec<u8>,
66 }
67 impl Encode for CreateApplicationKey {
68 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
69 self.key.encode_to(dest);
70 }
71 }
72 impl Decode for CreateApplicationKey {
73 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
74 let key = Decode::decode(input)?;
75 Ok(Self { key })
76 }
77 }
78 impl HasTxDispatchIndex for CreateApplicationKey {
79 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 0);
80 }
81
82 #[derive(Debug, Clone)]
83 pub struct SubmitData {
84 pub data: Vec<u8>,
85 }
86 impl Encode for SubmitData {
87 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
88 self.data.encode_to(dest);
89 }
90 }
91 impl Decode for SubmitData {
92 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
93 let data = Decode::decode(input)?;
94 Ok(Self { data })
95 }
96 }
97 impl HasTxDispatchIndex for SubmitData {
98 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 1);
99 }
100 }
101}
102
103pub mod balances {
104 use super::*;
105 pub const PALLET_ID: u8 = 6;
106
107 pub mod types {
108 use super::*;
109
110 #[derive(Debug, Default, Clone, DecodeAsType, EncodeAsType)]
111 pub struct AccountData {
112 pub free: u128,
113 pub reserved: u128,
114 pub frozen: u128,
115 pub flags: u128,
116 }
117
118 impl Encode for AccountData {
119 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
120 self.free.encode_to(dest);
121 self.reserved.encode_to(dest);
122 self.frozen.encode_to(dest);
123 self.flags.encode_to(dest);
124 }
125 }
126 impl Decode for AccountData {
127 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
128 let free = Decode::decode(input)?;
129 let reserved = Decode::decode(input)?;
130 let frozen = Decode::decode(input)?;
131 let flags = Decode::decode(input)?;
132 Ok(Self {
133 free,
134 reserved,
135 frozen,
136 flags,
137 })
138 }
139 }
140
141 #[derive(Debug, Clone)]
142 #[repr(u8)]
143 pub enum BalanceStatus {
144 Free = 0,
146 Reserved = 1,
148 }
149 impl Encode for BalanceStatus {
150 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
151 let variant: u8 = unsafe { *<*const _>::from(self).cast::<u8>() };
152 variant.encode_to(dest);
153 }
154 }
155 impl Decode for BalanceStatus {
156 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
157 let variant = u8::decode(input)?;
158 match variant {
159 0 => Ok(BalanceStatus::Free),
160 1 => Ok(BalanceStatus::Reserved),
161 _ => Err("Failed to decode BalanceStatus Call. Unknown variant".into()),
162 }
163 }
164 }
165 }
166
167 pub mod events {
168 use super::*;
169
170 #[derive(Debug, Clone)]
172 pub struct Endowed {
173 pub account: AccountId,
174 pub free_balance: u128,
175 }
176 impl HasEventEmittedIndex for Endowed {
177 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 0);
178 }
179 impl Decode for Endowed {
180 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
181 let account = Decode::decode(input)?;
182 let free_balance = Decode::decode(input)?;
183 Ok(Self { account, free_balance })
184 }
185 }
186
187 #[derive(Debug, Clone)]
190 pub struct DustLost {
191 pub account: AccountId,
192 pub amount: u128,
193 }
194 impl HasEventEmittedIndex for DustLost {
195 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 1);
196 }
197 impl Decode for DustLost {
198 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
199 let account = Decode::decode(input)?;
200 let amount = Decode::decode(input)?;
201 Ok(Self { account, amount })
202 }
203 }
204
205 #[derive(Debug, Clone)]
207 pub struct Transfer {
208 pub from: AccountId,
209 pub to: AccountId,
210 pub amount: u128,
211 }
212 impl HasEventEmittedIndex for Transfer {
213 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 2);
214 }
215 impl Decode for Transfer {
216 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
217 let from = Decode::decode(input)?;
218 let to = Decode::decode(input)?;
219 let amount = Decode::decode(input)?;
220 Ok(Self { from, to, amount })
221 }
222 }
223
224 #[derive(Debug, Clone)]
226 pub struct Reserved {
227 pub who: AccountId,
228 pub amount: u128,
229 }
230 impl HasEventEmittedIndex for Reserved {
231 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 4);
232 }
233 impl Decode for Reserved {
234 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
235 let who = Decode::decode(input)?;
236 let amount = Decode::decode(input)?;
237 Ok(Self { who, amount })
238 }
239 }
240
241 #[derive(Debug, Clone)]
243 pub struct Unreserved {
244 pub who: AccountId,
245 pub amount: u128,
246 }
247 impl HasEventEmittedIndex for Unreserved {
248 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 5);
249 }
250 impl Decode for Unreserved {
251 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
252 let who = Decode::decode(input)?;
253 let amount = Decode::decode(input)?;
254 Ok(Self { who, amount })
255 }
256 }
257
258 #[derive(Debug, Clone)]
260 pub struct Deposit {
261 pub who: AccountId,
262 pub amount: u128,
263 }
264 impl HasEventEmittedIndex for Deposit {
265 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 7);
266 }
267 impl Decode for Deposit {
268 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
269 let who = Decode::decode(input)?;
270 let amount = Decode::decode(input)?;
271 Ok(Self { who, amount })
272 }
273 }
274
275 #[derive(Debug, Clone)]
277 pub struct Withdraw {
278 pub who: AccountId,
279 pub amount: u128,
280 }
281 impl HasEventEmittedIndex for Withdraw {
282 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 8);
283 }
284 impl Decode for Withdraw {
285 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
286 let who = Decode::decode(input)?;
287 let amount = Decode::decode(input)?;
288 Ok(Self { who, amount })
289 }
290 }
291
292 #[derive(Debug, Clone)]
294 pub struct Slashed {
295 pub who: AccountId,
296 pub amount: u128,
297 }
298 impl HasEventEmittedIndex for Slashed {
299 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 9);
300 }
301 impl Decode for Slashed {
302 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
303 let who = Decode::decode(input)?;
304 let amount = Decode::decode(input)?;
305 Ok(Self { who, amount })
306 }
307 }
308
309 #[derive(Debug, Clone)]
311 pub struct Locked {
312 pub who: AccountId,
313 pub amount: u128,
314 }
315 impl HasEventEmittedIndex for Locked {
316 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 17);
317 }
318 impl Decode for Locked {
319 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
320 let who = Decode::decode(input)?;
321 let amount = Decode::decode(input)?;
322 Ok(Self { who, amount })
323 }
324 }
325
326 #[derive(Debug, Clone)]
328 pub struct Unlocked {
329 pub who: AccountId,
330 pub amount: u128,
331 }
332 impl HasEventEmittedIndex for Unlocked {
333 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 18);
334 }
335 impl Decode for Unlocked {
336 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
337 let who = Decode::decode(input)?;
338 let amount = Decode::decode(input)?;
339 Ok(Self { who, amount })
340 }
341 }
342
343 #[derive(Debug, Clone)]
345 pub struct Frozen {
346 pub who: AccountId,
347 pub amount: u128,
348 }
349 impl HasEventEmittedIndex for Frozen {
350 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 19);
351 }
352 impl Decode for Frozen {
353 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
354 let who = Decode::decode(input)?;
355 let amount = Decode::decode(input)?;
356 Ok(Self { who, amount })
357 }
358 }
359
360 #[derive(Debug, Clone)]
362 pub struct Thawed {
363 pub who: AccountId,
364 pub amount: u128,
365 }
366 impl HasEventEmittedIndex for Thawed {
367 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 20);
368 }
369 impl Decode for Thawed {
370 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
371 let who = Decode::decode(input)?;
372 let amount = Decode::decode(input)?;
373 Ok(Self { who, amount })
374 }
375 }
376 }
377
378 pub mod tx {
379 use super::*;
380
381 #[derive(Debug, Clone)]
382 pub struct TransferAllowDeath {
383 pub dest: MultiAddress,
384 pub amount: Compact<u128>,
385 }
386 impl Encode for TransferAllowDeath {
387 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
388 dest.write(&self.dest.encode());
389 dest.write(&self.amount.encode());
390 }
391 }
392 impl Decode for TransferAllowDeath {
393 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
394 let dest = Decode::decode(input)?;
395 let amount = Decode::decode(input)?;
396 Ok(Self { dest, amount })
397 }
398 }
399 impl HasTxDispatchIndex for TransferAllowDeath {
400 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 0);
401 }
402
403 #[derive(Debug, Clone)]
404 pub struct TransferKeepAlive {
405 pub dest: MultiAddress,
406 pub amount: Compact<u128>,
407 }
408 impl Encode for TransferKeepAlive {
409 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
410 dest.write(&self.dest.encode());
411 dest.write(&self.amount.encode());
412 }
413 }
414 impl Decode for TransferKeepAlive {
415 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
416 let dest = Decode::decode(input)?;
417 let amount = Decode::decode(input)?;
418 Ok(Self { dest, amount })
419 }
420 }
421 impl HasTxDispatchIndex for TransferKeepAlive {
422 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 3);
423 }
424
425 #[derive(Debug, Clone)]
426 pub struct TransferAll {
427 pub dest: MultiAddress,
428 pub keep_alive: bool,
429 }
430 impl Encode for TransferAll {
431 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
432 dest.write(&self.dest.encode());
433 dest.write(&self.keep_alive.encode());
434 }
435 }
436 impl Decode for TransferAll {
437 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
438 let dest = Decode::decode(input)?;
439 let keep_alive = Decode::decode(input)?;
440 Ok(Self { dest, keep_alive })
441 }
442 }
443 impl HasTxDispatchIndex for TransferAll {
444 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 4);
445 }
446 }
447}
448
449pub mod utility {
450 use super::*;
451 pub const PALLET_ID: u8 = 1;
452
453 pub mod events {
454 use super::*;
455
456 #[derive(Debug, Clone)]
459 pub struct BatchInterrupted {
460 pub index: u32,
461 pub error: super::system::types::DispatchError,
462 }
463 impl HasEventEmittedIndex for BatchInterrupted {
464 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 0);
465 }
466 impl Decode for BatchInterrupted {
467 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
468 let index = Decode::decode(input)?;
469 let error = Decode::decode(input)?;
470 Ok(Self { index, error })
471 }
472 }
473
474 #[derive(Debug, Clone)]
476 pub struct BatchCompleted;
477 impl HasEventEmittedIndex for BatchCompleted {
478 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 1);
479 }
480 impl Decode for BatchCompleted {
481 fn decode<I: codec::Input>(_input: &mut I) -> Result<Self, codec::Error> {
482 Ok(Self)
483 }
484 }
485
486 #[derive(Debug, Clone)]
488 pub struct BatchCompletedWithErrors;
489 impl HasEventEmittedIndex for BatchCompletedWithErrors {
490 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 2);
491 }
492 impl Decode for BatchCompletedWithErrors {
493 fn decode<I: codec::Input>(_input: &mut I) -> Result<Self, codec::Error> {
494 Ok(Self)
495 }
496 }
497
498 #[derive(Debug, Clone)]
500 pub struct ItemCompleted;
501 impl HasEventEmittedIndex for ItemCompleted {
502 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 3);
503 }
504 impl Decode for ItemCompleted {
505 fn decode<I: codec::Input>(_input: &mut I) -> Result<Self, codec::Error> {
506 Ok(Self)
507 }
508 }
509
510 #[derive(Debug, Clone)]
512 pub struct ItemFailed {
513 pub error: super::system::types::DispatchError,
514 }
515 impl HasEventEmittedIndex for ItemFailed {
516 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 4);
517 }
518 impl Decode for ItemFailed {
519 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
520 let error = Decode::decode(input)?;
521 Ok(Self { error })
522 }
523 }
524
525 #[derive(Debug, Clone)]
527 pub struct DispatchedAs {
528 pub result: Result<(), super::system::types::DispatchError>,
529 }
530 impl HasEventEmittedIndex for DispatchedAs {
531 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 5);
532 }
533 impl Decode for DispatchedAs {
534 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
535 let result = Decode::decode(input)?;
536 Ok(Self { result })
537 }
538 }
539 }
540
541 pub mod tx {
542 use super::*;
543
544 #[derive(Debug, Clone)]
545 pub struct Batch {
546 pub calls: Vec<TransactionCall>,
547 }
548 impl Encode for Batch {
549 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
550 dest.write(&self.calls.encode());
551 }
552 }
553 impl Decode for Batch {
554 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
555 let calls = Decode::decode(input)?;
556 Ok(Self { calls })
557 }
558 }
559 impl HasTxDispatchIndex for Batch {
560 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 0);
561 }
562
563 #[derive(Debug, Clone)]
564 pub struct BatchAll {
565 pub calls: Vec<TransactionCall>,
566 }
567 impl Encode for BatchAll {
568 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
569 dest.write(&self.calls.encode());
570 }
571 }
572 impl Decode for BatchAll {
573 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
574 let calls = Decode::decode(input)?;
575 Ok(Self { calls })
576 }
577 }
578 impl HasTxDispatchIndex for BatchAll {
579 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 2);
580 }
581
582 #[derive(Debug, Clone)]
583 pub struct ForceBatch {
584 pub calls: Vec<TransactionCall>,
585 }
586 impl Encode for ForceBatch {
587 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
588 dest.write(&self.calls.encode());
589 }
590 }
591 impl Decode for ForceBatch {
592 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
593 let calls = Decode::decode(input)?;
594 Ok(Self { calls })
595 }
596 }
597 impl HasTxDispatchIndex for ForceBatch {
598 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 4);
599 }
600 }
601}
602
603pub mod proxy {
604 use super::*;
605 pub const PALLET_ID: u8 = 40;
606
607 pub mod types {
608 use super::*;
609
610 #[derive(Debug, Clone, Copy)]
611 #[repr(u8)]
612 pub enum ProxyType {
613 Any = 0,
614 NonTransfer = 1,
615 Governance = 2,
616 Staking = 3,
617 IdentityJudgement = 4,
618 NominationPools = 5,
619 }
620 impl Encode for ProxyType {
621 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
622 let variant: u8 = *self as u8;
623 variant.encode_to(dest);
624 }
625 }
626 impl Decode for ProxyType {
627 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
628 let variant = u8::decode(input)?;
629 match variant {
630 0 => Ok(Self::Any),
631 1 => Ok(Self::NonTransfer),
632 2 => Ok(Self::Governance),
633 3 => Ok(Self::Staking),
634 4 => Ok(Self::IdentityJudgement),
635 5 => Ok(Self::NominationPools),
636 _ => Err("Failed to decode ProxyType. Unknown variant".into()),
637 }
638 }
639 }
640 }
641
642 pub mod events {
643 use super::*;
644
645 #[derive(Debug, Clone)]
647 pub struct ProxyExecuted {
648 pub result: Result<(), super::system::types::DispatchError>,
649 }
650 impl HasEventEmittedIndex for ProxyExecuted {
651 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 0);
652 }
653 impl Decode for ProxyExecuted {
654 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
655 let result = Decode::decode(input)?;
656 Ok(Self { result })
657 }
658 }
659
660 #[derive(Debug, Clone)]
663 pub struct PureCreated {
664 pub pure: AccountId,
665 pub who: AccountId,
666 pub proxy_type: super::types::ProxyType,
667 pub disambiguation_index: u16,
668 }
669 impl HasEventEmittedIndex for PureCreated {
670 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 1);
671 }
672 impl Decode for PureCreated {
673 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
674 let pure = Decode::decode(input)?;
675 let who = Decode::decode(input)?;
676 let proxy_type = Decode::decode(input)?;
677 let disambiguation_index = Decode::decode(input)?;
678 Ok(Self {
679 pure,
680 who,
681 proxy_type,
682 disambiguation_index,
683 })
684 }
685 }
686
687 #[derive(Debug, Clone)]
689 pub struct Announced {
690 pub real: AccountId,
691 pub proxy: AccountId,
692 pub call_hash: H256,
693 }
694 impl HasEventEmittedIndex for Announced {
695 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 2);
696 }
697 impl Decode for Announced {
698 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
699 let real = Decode::decode(input)?;
700 let proxy = Decode::decode(input)?;
701 let call_hash = Decode::decode(input)?;
702 Ok(Self { real, proxy, call_hash })
703 }
704 }
705
706 #[derive(Debug, Clone)]
708 pub struct ProxyAdded {
709 pub delegator: AccountId,
710 pub delegatee: AccountId,
711 pub proxy_type: super::types::ProxyType,
712 pub delay: u32,
713 }
714 impl HasEventEmittedIndex for ProxyAdded {
715 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 3);
716 }
717 impl Decode for ProxyAdded {
718 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
719 let delegator = Decode::decode(input)?;
720 let delegatee = Decode::decode(input)?;
721 let proxy_type = Decode::decode(input)?;
722 let delay = Decode::decode(input)?;
723 Ok(Self {
724 delegator,
725 delegatee,
726 proxy_type,
727 delay,
728 })
729 }
730 }
731
732 #[derive(Debug, Clone)]
734 pub struct ProxyRemoved {
735 pub delegator: AccountId,
736 pub delegatee: AccountId,
737 pub proxy_type: super::types::ProxyType,
738 pub delay: u32,
739 }
740 impl HasEventEmittedIndex for ProxyRemoved {
741 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 4);
742 }
743 impl Decode for ProxyRemoved {
744 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
745 let delegator = Decode::decode(input)?;
746 let delegatee = Decode::decode(input)?;
747 let proxy_type = Decode::decode(input)?;
748 let delay = Decode::decode(input)?;
749 Ok(Self {
750 delegator,
751 delegatee,
752 proxy_type,
753 delay,
754 })
755 }
756 }
757 }
758
759 pub mod tx {
760 use super::*;
761
762 #[derive(Debug, Clone)]
763 pub struct Proxy {
764 pub id: MultiAddress,
765 pub force_proxy_type: Option<super::types::ProxyType>,
766 pub call: TransactionCall,
767 }
768 impl Encode for Proxy {
769 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
770 dest.write(&self.id.encode());
771 dest.write(&self.force_proxy_type.encode());
772 dest.write(&self.call.encode());
773 }
774 }
775 impl Decode for Proxy {
776 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
777 let id = Decode::decode(input)?;
778 let force_proxy_type = Decode::decode(input)?;
779 let call = Decode::decode(input)?;
780 Ok(Self {
781 id,
782 force_proxy_type,
783 call,
784 })
785 }
786 }
787 impl HasTxDispatchIndex for Proxy {
788 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 0);
789 }
790
791 #[derive(Debug, Clone)]
792 pub struct AddProxy {
793 pub id: MultiAddress,
794 pub proxy_type: super::types::ProxyType,
795 pub delay: u32,
796 }
797 impl Encode for AddProxy {
798 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
799 dest.write(&self.id.encode());
800 dest.write(&self.proxy_type.encode());
801 dest.write(&self.delay.encode());
802 }
803 }
804 impl Decode for AddProxy {
805 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
806 let id = Decode::decode(input)?;
807 let proxy_type = Decode::decode(input)?;
808 let delay = Decode::decode(input)?;
809 Ok(Self { id, proxy_type, delay })
810 }
811 }
812 impl HasTxDispatchIndex for AddProxy {
813 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 1);
814 }
815
816 #[derive(Debug, Clone)]
817 pub struct RemoveProxy {
818 pub delegate: MultiAddress,
819 pub proxy_type: super::types::ProxyType,
820 pub delay: u32,
821 }
822 impl Encode for RemoveProxy {
823 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
824 dest.write(&self.delegate.encode());
825 dest.write(&self.proxy_type.encode());
826 dest.write(&self.delay.encode());
827 }
828 }
829 impl Decode for RemoveProxy {
830 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
831 let delegate = Decode::decode(input)?;
832 let proxy_type = Decode::decode(input)?;
833 let delay = Decode::decode(input)?;
834 Ok(Self {
835 delegate,
836 proxy_type,
837 delay,
838 })
839 }
840 }
841 impl HasTxDispatchIndex for RemoveProxy {
842 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 2);
843 }
844
845 #[derive(Debug, Clone)]
846 pub struct RemoveProxies;
847 impl Encode for RemoveProxies {
848 fn encode_to<T: codec::Output + ?Sized>(&self, _dest: &mut T) {}
849 }
850 impl Decode for RemoveProxies {
851 fn decode<I: codec::Input>(_input: &mut I) -> Result<Self, codec::Error> {
852 Ok(Self)
853 }
854 }
855 impl HasTxDispatchIndex for RemoveProxies {
856 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 3);
857 }
858
859 #[derive(Debug, Clone)]
860 pub struct CreatePure {
861 pub proxy_type: super::types::ProxyType,
862 pub delay: u32,
863 pub index: u16,
864 }
865 impl Encode for CreatePure {
866 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
867 dest.write(&self.proxy_type.encode());
868 dest.write(&self.delay.encode());
869 dest.write(&self.index.encode());
870 }
871 }
872 impl Decode for CreatePure {
873 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
874 let proxy_type = Decode::decode(input)?;
875 let delay = Decode::decode(input)?;
876 let index = Decode::decode(input)?;
877 Ok(Self {
878 proxy_type,
879 delay,
880 index,
881 })
882 }
883 }
884 impl HasTxDispatchIndex for CreatePure {
885 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 4);
886 }
887
888 #[derive(Debug, Clone)]
889 pub struct KillPure {
890 pub spawner: MultiAddress,
891 pub proxy_type: super::types::ProxyType,
892 pub index: u16,
893 pub height: Compact<u32>,
894 pub ext_index: Compact<u32>,
895 }
896 impl Encode for KillPure {
897 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
898 dest.write(&self.spawner.encode());
899 dest.write(&self.proxy_type.encode());
900 dest.write(&self.index.encode());
901 dest.write(&self.height.encode());
902 dest.write(&self.ext_index.encode());
903 }
904 }
905 impl Decode for KillPure {
906 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
907 let spawner = Decode::decode(input)?;
908 let proxy_type = Decode::decode(input)?;
909 let index = Decode::decode(input)?;
910 let height = Decode::decode(input)?;
911 let ext_index = Decode::decode(input)?;
912 Ok(Self {
913 spawner,
914 proxy_type,
915 index,
916 height,
917 ext_index,
918 })
919 }
920 }
921 impl HasTxDispatchIndex for KillPure {
922 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 5);
923 }
924 }
925}
926
927pub mod multisig {
928 use super::*;
929 pub const PALLET_ID: u8 = 34;
930
931 pub mod types {
932 use super::*;
933 pub use crate::from_substrate::Weight;
934
935 #[derive(Debug, Clone, Copy)]
936 pub struct Timepoint {
937 height: u32,
938 index: u32,
939 }
940 impl Encode for Timepoint {
941 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
942 dest.write(&self.height.encode());
943 dest.write(&self.index.encode());
944 }
945 }
946 impl Decode for Timepoint {
947 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
948 let height = Decode::decode(input)?;
949 let index = Decode::decode(input)?;
950 Ok(Self { height, index })
951 }
952 }
953 }
954
955 pub mod events {
956 use super::*;
957
958 #[derive(Debug, Clone)]
960 pub struct NewMultisig {
961 pub approving: AccountId,
962 pub multisig: AccountId,
963 pub call_hash: H256,
964 }
965 impl HasEventEmittedIndex for NewMultisig {
966 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 0);
967 }
968 impl Decode for NewMultisig {
969 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
970 let approving = Decode::decode(input)?;
971 let multisig = Decode::decode(input)?;
972 let call_hash = Decode::decode(input)?;
973 Ok(Self {
974 approving,
975 multisig,
976 call_hash,
977 })
978 }
979 }
980
981 #[derive(Debug, Clone)]
983 pub struct MultisigApproval {
984 pub approving: AccountId,
985 pub timepoint: super::types::Timepoint,
986 pub multisig: AccountId,
987 pub call_hash: H256,
988 }
989 impl HasEventEmittedIndex for MultisigApproval {
990 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 1);
991 }
992 impl Decode for MultisigApproval {
993 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
994 let approving = Decode::decode(input)?;
995 let timepoint = Decode::decode(input)?;
996 let multisig = Decode::decode(input)?;
997 let call_hash = Decode::decode(input)?;
998 Ok(Self {
999 approving,
1000 timepoint,
1001 multisig,
1002 call_hash,
1003 })
1004 }
1005 }
1006
1007 #[derive(Debug, Clone)]
1009 pub struct MultisigExecuted {
1010 pub approving: AccountId,
1011 pub timepoint: super::types::Timepoint,
1012 pub multisig: AccountId,
1013 pub call_hash: H256,
1014 pub result: Result<(), super::system::types::DispatchError>,
1015 }
1016 impl HasEventEmittedIndex for MultisigExecuted {
1017 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 2);
1018 }
1019 impl Decode for MultisigExecuted {
1020 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1021 let approving = Decode::decode(input)?;
1022 let timepoint = Decode::decode(input)?;
1023 let multisig = Decode::decode(input)?;
1024 let call_hash = Decode::decode(input)?;
1025 let result = Decode::decode(input)?;
1026 Ok(Self {
1027 approving,
1028 timepoint,
1029 multisig,
1030 call_hash,
1031 result,
1032 })
1033 }
1034 }
1035
1036 #[derive(Debug, Clone)]
1038 pub struct MultisigCancelled {
1039 pub cancelling: AccountId,
1040 pub timepoint: super::types::Timepoint,
1041 pub multisig: AccountId,
1042 pub call_hash: H256,
1043 }
1044 impl HasEventEmittedIndex for MultisigCancelled {
1045 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 3);
1046 }
1047 impl Decode for MultisigCancelled {
1048 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1049 let cancelling = Decode::decode(input)?;
1050 let timepoint = Decode::decode(input)?;
1051 let multisig = Decode::decode(input)?;
1052 let call_hash = Decode::decode(input)?;
1053 Ok(Self {
1054 cancelling,
1055 timepoint,
1056 multisig,
1057 call_hash,
1058 })
1059 }
1060 }
1061 }
1062
1063 pub mod tx {
1064 use super::*;
1065
1066 #[derive(Debug, Clone)]
1067 pub struct AsMultiThreshold1 {
1068 pub other_signatories: Vec<AccountId>,
1069 pub call: TransactionCall,
1070 }
1071 impl Encode for AsMultiThreshold1 {
1072 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1073 dest.write(&self.other_signatories.encode());
1074 dest.write(&self.call.encode());
1075 }
1076 }
1077 impl Decode for AsMultiThreshold1 {
1078 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1079 let other_signatories = Decode::decode(input)?;
1080 let call = Decode::decode(input)?;
1081 Ok(Self {
1082 other_signatories,
1083 call,
1084 })
1085 }
1086 }
1087 impl HasTxDispatchIndex for AsMultiThreshold1 {
1088 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 0);
1089 }
1090
1091 #[derive(Debug, Clone)]
1092 pub struct AsMulti {
1093 pub threshold: u16,
1094 pub other_signatories: Vec<AccountId>,
1095 pub maybe_timepoint: Option<super::types::Timepoint>,
1096 pub call: TransactionCall,
1097 pub max_weight: super::types::Weight,
1098 }
1099 impl Encode for AsMulti {
1100 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1101 dest.write(&self.threshold.encode());
1102 dest.write(&self.other_signatories.encode());
1103 dest.write(&self.maybe_timepoint.encode());
1104 dest.write(&self.call.encode());
1105 dest.write(&self.max_weight.encode());
1106 }
1107 }
1108 impl Decode for AsMulti {
1109 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1110 let threshold = Decode::decode(input)?;
1111 let other_signatories = Decode::decode(input)?;
1112 let maybe_timepoint = Decode::decode(input)?;
1113 let call = Decode::decode(input)?;
1114 let max_weight = Decode::decode(input)?;
1115 Ok(Self {
1116 threshold,
1117 other_signatories,
1118 maybe_timepoint,
1119 call,
1120 max_weight,
1121 })
1122 }
1123 }
1124 impl HasTxDispatchIndex for AsMulti {
1125 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 1);
1126 }
1127
1128 #[derive(Debug, Clone)]
1129 pub struct ApproveAsMulti {
1130 pub threshold: u16,
1131 pub other_signatories: Vec<AccountId>,
1132 pub maybe_timepoint: Option<super::types::Timepoint>,
1133 pub call_hash: H256,
1134 pub max_weight: super::types::Weight,
1135 }
1136 impl Encode for ApproveAsMulti {
1137 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1138 dest.write(&self.threshold.encode());
1139 dest.write(&self.other_signatories.encode());
1140 dest.write(&self.maybe_timepoint.encode());
1141 dest.write(&self.call_hash.encode());
1142 dest.write(&self.max_weight.encode());
1143 }
1144 }
1145 impl Decode for ApproveAsMulti {
1146 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1147 let threshold = Decode::decode(input)?;
1148 let other_signatories = Decode::decode(input)?;
1149 let maybe_timepoint = Decode::decode(input)?;
1150 let call_hash = Decode::decode(input)?;
1151 let max_weight = Decode::decode(input)?;
1152 Ok(Self {
1153 threshold,
1154 other_signatories,
1155 maybe_timepoint,
1156 call_hash,
1157 max_weight,
1158 })
1159 }
1160 }
1161 impl HasTxDispatchIndex for ApproveAsMulti {
1162 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 2);
1163 }
1164
1165 #[derive(Debug, Clone)]
1166 pub struct CancelAsMulti {
1167 pub threshold: u16,
1168 pub other_signatories: Vec<AccountId>,
1169 pub maybe_timepoint: super::types::Timepoint,
1170 pub call_hash: H256,
1171 }
1172 impl Encode for CancelAsMulti {
1173 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1174 dest.write(&self.threshold.encode());
1175 dest.write(&self.other_signatories.encode());
1176 dest.write(&self.maybe_timepoint.encode());
1177 dest.write(&self.call_hash.encode());
1178 }
1179 }
1180 impl Decode for CancelAsMulti {
1181 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1182 let threshold = Decode::decode(input)?;
1183 let other_signatories = Decode::decode(input)?;
1184 let maybe_timepoint = Decode::decode(input)?;
1185 let call_hash = Decode::decode(input)?;
1186 Ok(Self {
1187 threshold,
1188 other_signatories,
1189 maybe_timepoint,
1190 call_hash,
1191 })
1192 }
1193 }
1194 impl HasTxDispatchIndex for CancelAsMulti {
1195 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 3);
1196 }
1197 }
1198}
1199
1200pub mod vector {
1201 use super::*;
1202 pub const PALLET_ID: u8 = 39;
1203
1204 pub mod types {
1205 use super::*;
1206 pub use crate::from_substrate::Weight;
1207 use serde::Deserialize;
1208
1209 #[derive(Debug, Clone, Deserialize)]
1211 #[serde(rename_all = "camelCase")]
1212 pub struct AddressedMessage {
1213 pub message: Message,
1214 pub from: H256,
1215 pub to: H256,
1216 pub origin_domain: Compact<u32>,
1217 pub destination_domain: Compact<u32>,
1218 pub id: Compact<u64>,
1220 }
1221 impl Encode for AddressedMessage {
1222 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1223 dest.write(&self.message.encode());
1224 dest.write(&self.from.encode());
1225 dest.write(&self.to.encode());
1226 dest.write(&self.origin_domain.encode());
1227 dest.write(&self.destination_domain.encode());
1228 dest.write(&self.id.encode());
1229 }
1230 }
1231 impl Decode for AddressedMessage {
1232 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1233 let message = Decode::decode(input)?;
1234 let from = Decode::decode(input)?;
1235 let to = Decode::decode(input)?;
1236 let origin_domain = Decode::decode(input)?;
1237 let destination_domain = Decode::decode(input)?;
1238 let id = Decode::decode(input)?;
1239 Ok(Self {
1240 message,
1241 from,
1242 to,
1243 origin_domain,
1244 destination_domain,
1245 id,
1246 })
1247 }
1248 }
1249
1250 #[derive(Debug, Clone, Deserialize)]
1252 #[repr(u8)]
1253 pub enum Message {
1254 ArbitraryMessage(Vec<u8>) = 0,
1255 FungibleToken { asset_id: H256, amount: Compact<u128> } = 1,
1256 }
1257 impl Encode for Message {
1258 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1259 let variant: u8 = unsafe { *<*const _>::from(self).cast::<u8>() };
1260 variant.encode_to(dest);
1261 match self {
1262 Message::ArbitraryMessage(items) => {
1263 items.encode_to(dest);
1264 },
1265 Message::FungibleToken { asset_id, amount } => {
1266 asset_id.encode_to(dest);
1267 amount.encode_to(dest);
1268 },
1269 }
1270 }
1271 }
1272 impl Decode for Message {
1273 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1274 let variant = u8::decode(input)?;
1275 match variant {
1276 0 => {
1277 let items = Decode::decode(input)?;
1278 Ok(Self::ArbitraryMessage(items))
1279 },
1280 1 => {
1281 let asset_id = Decode::decode(input)?;
1282 let amount = Decode::decode(input)?;
1283 Ok(Self::FungibleToken { asset_id, amount })
1284 },
1285 _ => Err("Failed to decode Message. Unknown Message variant".into()),
1286 }
1287 }
1288 }
1289
1290 #[derive(Debug, Clone)]
1291 pub struct Configuration {
1292 pub slots_per_period: Compact<u64>,
1293 pub finality_threshold: Compact<u16>,
1294 }
1295 impl Encode for Configuration {
1296 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1297 dest.write(&self.slots_per_period.encode());
1298 dest.write(&self.finality_threshold.encode());
1299 }
1300 }
1301 impl Decode for Configuration {
1302 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1303 let slots_per_period = Decode::decode(input)?;
1304 let finality_threshold = Decode::decode(input)?;
1305 Ok(Self {
1306 slots_per_period,
1307 finality_threshold,
1308 })
1309 }
1310 }
1311 }
1312
1313 pub mod tx {
1314 use super::*;
1315
1316 #[derive(Debug, Clone)]
1317 pub struct FulfillCall {
1318 pub function_id: H256,
1319 pub input: Vec<u8>,
1320 pub output: Vec<u8>,
1321 pub proof: Vec<u8>,
1322 pub slot: Compact<u64>,
1323 }
1324 impl Encode for FulfillCall {
1325 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1326 dest.write(&self.function_id.encode());
1327 dest.write(&self.input.encode());
1328 dest.write(&self.output.encode());
1329 dest.write(&self.proof.encode());
1330 dest.write(&self.slot.encode());
1331 }
1332 }
1333 impl Decode for FulfillCall {
1334 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1335 let function_id = Decode::decode(input)?;
1336 let inputt = Decode::decode(input)?;
1337 let output = Decode::decode(input)?;
1338 let proof = Decode::decode(input)?;
1339 let slot = Decode::decode(input)?;
1340 Ok(Self {
1341 function_id,
1342 input: inputt,
1343 output,
1344 proof,
1345 slot,
1346 })
1347 }
1348 }
1349 impl HasTxDispatchIndex for FulfillCall {
1350 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 0);
1351 }
1352
1353 #[derive(Debug, Clone)]
1354 pub struct Execute {
1355 pub slot: Compact<u64>,
1356 pub addr_message: super::types::AddressedMessage,
1357 pub account_proof: Vec<Vec<u8>>,
1358 pub storage_proof: Vec<Vec<u8>>,
1359 }
1360 impl Encode for Execute {
1361 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1362 dest.write(&self.slot.encode());
1363 dest.write(&self.addr_message.encode());
1364 dest.write(&self.account_proof.encode());
1365 dest.write(&self.storage_proof.encode());
1366 }
1367 }
1368 impl Decode for Execute {
1369 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1370 let slot = Decode::decode(input)?;
1371 let addr_message = Decode::decode(input)?;
1372 let account_proof = Decode::decode(input)?;
1373 let storage_proof = Decode::decode(input)?;
1374 Ok(Self {
1375 slot,
1376 addr_message,
1377 account_proof,
1378 storage_proof,
1379 })
1380 }
1381 }
1382 impl HasTxDispatchIndex for Execute {
1383 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 1);
1384 }
1385
1386 #[derive(Debug, Clone)]
1387 pub struct SourceChainFroze {
1388 pub source_chain_id: Compact<u32>,
1389 pub frozen: bool,
1390 }
1391 impl Encode for SourceChainFroze {
1392 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1393 dest.write(&self.source_chain_id.encode());
1394 dest.write(&self.frozen.encode());
1395 }
1396 }
1397 impl Decode for SourceChainFroze {
1398 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1399 let source_chain_id = Decode::decode(input)?;
1400 let frozen = Decode::decode(input)?;
1401 Ok(Self {
1402 source_chain_id,
1403 frozen,
1404 })
1405 }
1406 }
1407 impl HasTxDispatchIndex for SourceChainFroze {
1408 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 2);
1409 }
1410
1411 #[derive(Debug, Clone)]
1412 pub struct SendMessage {
1413 pub slot: Compact<u64>,
1414 pub message: super::types::Message,
1415 pub to: H256,
1416 pub domain: Compact<u32>,
1417 }
1418 impl Encode for SendMessage {
1419 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1420 dest.write(&self.slot.encode());
1421 dest.write(&self.message.encode());
1422 dest.write(&self.to.encode());
1423 dest.write(&self.domain.encode());
1424 }
1425 }
1426 impl Decode for SendMessage {
1427 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1428 let slot = Decode::decode(input)?;
1429 let message = Decode::decode(input)?;
1430 let to = Decode::decode(input)?;
1431 let domain = Decode::decode(input)?;
1432 Ok(Self {
1433 slot,
1434 message,
1435 to,
1436 domain,
1437 })
1438 }
1439 }
1440 impl HasTxDispatchIndex for SendMessage {
1441 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 3);
1442 }
1443
1444 #[derive(Debug, Clone)]
1445 pub struct SetPoseidonHash {
1446 pub period: Compact<u64>,
1447 pub poseidon_hash: Vec<u8>,
1448 }
1449 impl Encode for SetPoseidonHash {
1450 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1451 dest.write(&self.period.encode());
1452 dest.write(&self.poseidon_hash.encode());
1453 }
1454 }
1455 impl Decode for SetPoseidonHash {
1456 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1457 let period = Decode::decode(input)?;
1458 let poseidon_hash = Decode::decode(input)?;
1459 Ok(Self { period, poseidon_hash })
1460 }
1461 }
1462 impl HasTxDispatchIndex for SetPoseidonHash {
1463 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 4);
1464 }
1465
1466 #[derive(Debug, Clone)]
1467 pub struct SetBroadcaster {
1468 pub broadcaster_domain: Compact<u32>,
1469 pub broadcaster: H256,
1470 }
1471 impl Encode for SetBroadcaster {
1472 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1473 dest.write(&self.broadcaster_domain.encode());
1474 dest.write(&self.broadcaster.encode());
1475 }
1476 }
1477 impl Decode for SetBroadcaster {
1478 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1479 let broadcaster_domain = Decode::decode(input)?;
1480 let broadcaster = Decode::decode(input)?;
1481 Ok(Self {
1482 broadcaster_domain,
1483 broadcaster,
1484 })
1485 }
1486 }
1487 impl HasTxDispatchIndex for SetBroadcaster {
1488 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 5);
1489 }
1490
1491 #[derive(Debug, Clone)]
1492 pub struct SetWhitelistedDomains {
1493 pub value: Vec<u32>,
1494 }
1495 impl Encode for SetWhitelistedDomains {
1496 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1497 dest.write(&self.value.encode());
1498 }
1499 }
1500 impl Decode for SetWhitelistedDomains {
1501 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1502 let value = Decode::decode(input)?;
1503 Ok(Self { value })
1504 }
1505 }
1506 impl HasTxDispatchIndex for SetWhitelistedDomains {
1507 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 6);
1508 }
1509
1510 #[derive(Debug, Clone)]
1511 pub struct SetConfiguration {
1512 pub value: super::types::Configuration,
1513 }
1514 impl Encode for SetConfiguration {
1515 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1516 dest.write(&self.value.encode());
1517 }
1518 }
1519 impl Decode for SetConfiguration {
1520 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1521 let value = Decode::decode(input)?;
1522 Ok(Self { value })
1523 }
1524 }
1525 impl HasTxDispatchIndex for SetConfiguration {
1526 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 7);
1527 }
1528
1529 #[derive(Debug, Clone)]
1530 pub struct SetFunctionIds {
1531 pub value: Option<(H256, H256)>,
1532 }
1533 impl Encode for SetFunctionIds {
1534 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1535 dest.write(&self.value.encode());
1536 }
1537 }
1538 impl Decode for SetFunctionIds {
1539 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1540 let value = Decode::decode(input)?;
1541 Ok(Self { value })
1542 }
1543 }
1544 impl HasTxDispatchIndex for SetFunctionIds {
1545 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 8);
1546 }
1547
1548 #[derive(Debug, Clone)]
1549 pub struct SetStepVerificationKey {
1550 pub value: Option<Vec<u8>>,
1551 }
1552 impl Encode for SetStepVerificationKey {
1553 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1554 dest.write(&self.value.encode());
1555 }
1556 }
1557 impl Decode for SetStepVerificationKey {
1558 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1559 let value = Decode::decode(input)?;
1560 Ok(Self { value })
1561 }
1562 }
1563 impl HasTxDispatchIndex for SetStepVerificationKey {
1564 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 9);
1565 }
1566
1567 #[derive(Debug, Clone)]
1568 pub struct SetRotateVerificationKey {
1569 pub value: Option<Vec<u8>>,
1570 }
1571 impl Encode for SetRotateVerificationKey {
1572 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1573 dest.write(&self.value.encode());
1574 }
1575 }
1576 impl Decode for SetRotateVerificationKey {
1577 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1578 let value = Decode::decode(input)?;
1579 Ok(Self { value })
1580 }
1581 }
1582 impl HasTxDispatchIndex for SetRotateVerificationKey {
1583 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 10);
1584 }
1585
1586 #[derive(Debug, Clone)]
1587 pub struct SetUpdater {
1588 pub updater: H256,
1589 }
1590 impl Encode for SetUpdater {
1591 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1592 dest.write(&self.updater.encode());
1593 }
1594 }
1595 impl Decode for SetUpdater {
1596 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1597 let updater = Decode::decode(input)?;
1598 Ok(Self { updater })
1599 }
1600 }
1601 impl HasTxDispatchIndex for SetUpdater {
1602 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 12);
1603 }
1604
1605 #[derive(Debug, Clone)]
1606 pub struct Fulfill {
1607 pub proof: Vec<u8>,
1608 pub public_values: Vec<u8>,
1609 }
1610 impl Encode for Fulfill {
1611 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1612 dest.write(&self.proof.encode());
1613 dest.write(&self.public_values.encode());
1614 }
1615 }
1616 impl Decode for Fulfill {
1617 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1618 let proof = Decode::decode(input)?;
1619 let public_values = Decode::decode(input)?;
1620 Ok(Self { proof, public_values })
1621 }
1622 }
1623 impl HasTxDispatchIndex for Fulfill {
1624 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 13);
1625 }
1626
1627 #[derive(Debug, Clone)]
1628 pub struct SetSp1VerificationKey {
1629 pub sp1_vk: H256,
1630 }
1631 impl Encode for SetSp1VerificationKey {
1632 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1633 dest.write(&self.sp1_vk.encode());
1634 }
1635 }
1636 impl Decode for SetSp1VerificationKey {
1637 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1638 let sp1_vk = Decode::decode(input)?;
1639 Ok(Self { sp1_vk })
1640 }
1641 }
1642 impl HasTxDispatchIndex for SetSp1VerificationKey {
1643 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 14);
1644 }
1645
1646 #[derive(Debug, Clone)]
1647 pub struct SetSyncCommitteeHash {
1648 pub period: u64,
1649 pub hash: H256,
1650 }
1651 impl Encode for SetSyncCommitteeHash {
1652 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1653 dest.write(&self.period.encode());
1654 dest.write(&self.hash.encode());
1655 }
1656 }
1657 impl Decode for SetSyncCommitteeHash {
1658 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1659 let period = Decode::decode(input)?;
1660 let hash = Decode::decode(input)?;
1661 Ok(Self { period, hash })
1662 }
1663 }
1664 impl HasTxDispatchIndex for SetSyncCommitteeHash {
1665 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 15);
1666 }
1667
1668 #[derive(Debug, Clone)]
1669 pub struct EnableMock {
1670 pub value: bool,
1671 }
1672 impl Encode for EnableMock {
1673 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1674 dest.write(&self.value.encode());
1675 }
1676 }
1677 impl Decode for EnableMock {
1678 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1679 let value = Decode::decode(input)?;
1680 Ok(Self { value })
1681 }
1682 }
1683 impl HasTxDispatchIndex for EnableMock {
1684 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 16);
1685 }
1686
1687 #[derive(Debug, Clone)]
1688 pub struct MockFulfill {
1689 pub public_values: Vec<u8>,
1690 }
1691 impl Encode for MockFulfill {
1692 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1693 dest.write(&self.public_values.encode());
1694 }
1695 }
1696 impl Decode for MockFulfill {
1697 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1698 let public_values = Decode::decode(input)?;
1699 Ok(Self { public_values })
1700 }
1701 }
1702 impl HasTxDispatchIndex for MockFulfill {
1703 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 17);
1704 }
1705 }
1706}
1707
1708pub mod system {
1709 use super::*;
1710 pub const PALLET_ID: u8 = 0;
1711
1712 pub mod types {
1713 use crate::from_substrate::{DispatchClass, Weight};
1714
1715 use super::*;
1716 #[derive(Debug, Clone, Default, DecodeAsType, EncodeAsType)]
1717 pub struct AccountInfo {
1718 pub nonce: u32,
1719 pub consumers: u32,
1720 pub providers: u32,
1721 pub sufficients: u32,
1722 pub data: super::balances::types::AccountData,
1723 }
1724 impl Encode for AccountInfo {
1725 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1726 self.nonce.encode_to(dest);
1727 self.consumers.encode_to(dest);
1728 self.providers.encode_to(dest);
1729 self.sufficients.encode_to(dest);
1730 self.data.encode_to(dest);
1731 }
1732 }
1733 impl Decode for AccountInfo {
1734 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1735 let nonce = Decode::decode(input)?;
1736 let consumers = Decode::decode(input)?;
1737 let providers = Decode::decode(input)?;
1738 let sufficients = Decode::decode(input)?;
1739 let data = Decode::decode(input)?;
1740 Ok(Self {
1741 nonce,
1742 consumers,
1743 providers,
1744 sufficients,
1745 data,
1746 })
1747 }
1748 }
1749
1750 #[derive(Debug, Clone)]
1751 pub struct DispatchInfo {
1752 pub weight: Weight,
1754 pub class: DispatchClass,
1756 pub pays_fee: Pays,
1758 pub fee_modifier: DispatchFeeModifier,
1760 }
1761 impl Encode for DispatchInfo {
1762 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1763 self.weight.encode_to(dest);
1764 self.class.encode_to(dest);
1765 self.pays_fee.encode_to(dest);
1766 self.fee_modifier.encode_to(dest);
1767 }
1768 }
1769 impl Decode for DispatchInfo {
1770 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1771 let weight = Decode::decode(input)?;
1772 let class = Decode::decode(input)?;
1773 let pays_fee = Decode::decode(input)?;
1774 let fee_modifier = Decode::decode(input)?;
1775 Ok(Self {
1776 weight,
1777 class,
1778 pays_fee,
1779 fee_modifier,
1780 })
1781 }
1782 }
1783
1784 #[derive(Debug, Clone, Copy)]
1785 #[repr(u8)]
1786 pub enum Pays {
1787 Yes = 0,
1789 No = 1,
1791 }
1792 impl Encode for Pays {
1793 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1794 let variant: u8 = *self as u8;
1795 variant.encode_to(dest);
1796 }
1797 }
1798 impl Decode for Pays {
1799 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1800 let variant = u8::decode(input)?;
1801 match variant {
1802 0 => Ok(Self::Yes),
1803 1 => Ok(Self::No),
1804 _ => Err("Failed to decode Pays. Unknown variant".into()),
1805 }
1806 }
1807 }
1808
1809 #[derive(Debug, Clone)]
1810 pub struct DispatchFeeModifier {
1811 pub weight_maximum_fee: Option<u128>,
1812 pub weight_fee_divider: Option<u32>,
1813 pub weight_fee_multiplier: Option<u32>,
1814 }
1815 impl Encode for DispatchFeeModifier {
1816 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1817 self.weight_maximum_fee.encode_to(dest);
1818 self.weight_fee_divider.encode_to(dest);
1819 self.weight_fee_multiplier.encode_to(dest);
1820 }
1821 }
1822 impl Decode for DispatchFeeModifier {
1823 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1824 let weight_maximum_fee = Decode::decode(input)?;
1825 let weight_fee_divider = Decode::decode(input)?;
1826 let weight_fee_multiplier = Decode::decode(input)?;
1827 Ok(Self {
1828 weight_maximum_fee,
1829 weight_fee_divider,
1830 weight_fee_multiplier,
1831 })
1832 }
1833 }
1834
1835 #[derive(Debug, Clone)]
1836 #[repr(u8)]
1837 pub enum DispatchError {
1838 Other = 0,
1839 CannotLookup = 1,
1841 BadOrigin = 2,
1843 Module(ModuleError) = 3,
1845 ConsumerRemaining = 4,
1847 NoProviders = 5,
1849 TooManyConsumers = 6,
1851 Token(TokenError) = 7,
1853 Arithmetic(ArithmeticError) = 8,
1855 Transactional(TransactionalError) = 9,
1857 Exhausted = 10,
1859 Corruption = 11,
1861 Unavailable = 12,
1863 RootNotAllowed = 13,
1865 }
1866 impl Encode for DispatchError {
1867 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1868 let variant: u8 = unsafe { *<*const _>::from(self).cast::<u8>() };
1869 variant.encode_to(dest);
1870 match self {
1871 Self::Module(x) => x.encode_to(dest),
1872 Self::Token(x) => x.encode_to(dest),
1873 Self::Arithmetic(x) => x.encode_to(dest),
1874 Self::Transactional(x) => x.encode_to(dest),
1875 _ => (),
1876 }
1877 }
1878 }
1879 impl Decode for DispatchError {
1880 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1881 let variant = u8::decode(input)?;
1882 match variant {
1883 0 => Ok(Self::Other),
1884 1 => Ok(Self::CannotLookup),
1885 2 => Ok(Self::BadOrigin),
1886 3 => Ok(Self::Module(ModuleError::decode(input)?)),
1887 4 => Ok(Self::ConsumerRemaining),
1888 5 => Ok(Self::NoProviders),
1889 6 => Ok(Self::TooManyConsumers),
1890 7 => Ok(Self::Token(TokenError::decode(input)?)),
1891 8 => Ok(Self::Arithmetic(ArithmeticError::decode(input)?)),
1892 9 => Ok(Self::Transactional(TransactionalError::decode(input)?)),
1893 10 => Ok(Self::Exhausted),
1894 11 => Ok(Self::Corruption),
1895 12 => Ok(Self::Unavailable),
1896 13 => Ok(Self::RootNotAllowed),
1897 _ => Err("Failed to decode Runtime Call. Unknown variant".into()),
1898 }
1899 }
1900 }
1901
1902 #[derive(Debug, Clone)]
1903 pub struct ModuleError {
1904 pub index: u8,
1906 pub error: [u8; 4],
1908 }
1909 impl Encode for ModuleError {
1910 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1911 self.index.encode_to(dest);
1912 self.error.encode_to(dest);
1913 }
1914 }
1915 impl Decode for ModuleError {
1916 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1917 let index = Decode::decode(input)?;
1918 let error = Decode::decode(input)?;
1919 Ok(Self { index, error })
1920 }
1921 }
1922
1923 #[derive(Debug, Clone, Copy)]
1924 #[repr(u8)]
1925 pub enum TokenError {
1926 FundsUnavailable = 0,
1928 OnlyProvider = 1,
1931 BelowMinimum = 2,
1933 CannotCreate = 3,
1935 UnknownAsset = 4,
1937 Frozen = 5,
1939 Unsupported = 6,
1941 CannotCreateHold = 7,
1943 NotExpendable = 8,
1945 Blocked = 9,
1947 }
1948 impl Encode for TokenError {
1949 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1950 let variant: u8 = *self as u8;
1951 variant.encode_to(dest);
1952 }
1953 }
1954 impl Decode for TokenError {
1955 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1956 let variant = u8::decode(input)?;
1957 match variant {
1958 0 => Ok(Self::FundsUnavailable),
1959 1 => Ok(Self::OnlyProvider),
1960 2 => Ok(Self::BelowMinimum),
1961 3 => Ok(Self::CannotCreate),
1962 4 => Ok(Self::UnknownAsset),
1963 5 => Ok(Self::Frozen),
1964 6 => Ok(Self::Unsupported),
1965 7 => Ok(Self::CannotCreateHold),
1966 8 => Ok(Self::NotExpendable),
1967 9 => Ok(Self::Blocked),
1968 _ => Err("Failed to decode TokenError. Unknown variant".into()),
1969 }
1970 }
1971 }
1972
1973 #[derive(Debug, Clone, Copy)]
1974 #[repr(u8)]
1975 pub enum ArithmeticError {
1976 Underflow = 0,
1978 Overflow = 1,
1980 DivisionByZero = 2,
1982 }
1983 impl Encode for ArithmeticError {
1984 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
1985 let variant: u8 = *self as u8;
1986 variant.encode_to(dest);
1987 }
1988 }
1989 impl Decode for ArithmeticError {
1990 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
1991 let variant = u8::decode(input)?;
1992 match variant {
1993 0 => Ok(Self::Underflow),
1994 1 => Ok(Self::Overflow),
1995 2 => Ok(Self::DivisionByZero),
1996 _ => Err("Failed to decode ArithmeticError. Unknown variant".into()),
1997 }
1998 }
1999 }
2000
2001 #[derive(Debug, Clone, Copy)]
2002 #[repr(u8)]
2003 pub enum TransactionalError {
2004 LimitReached = 0,
2005 NoLayer = 1,
2006 }
2007 impl Encode for TransactionalError {
2008 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
2009 let variant: u8 = *self as u8;
2010 variant.encode_to(dest);
2011 }
2012 }
2013 impl Decode for TransactionalError {
2014 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
2015 let variant = u8::decode(input)?;
2016 match variant {
2017 0 => Ok(Self::LimitReached),
2018 1 => Ok(Self::NoLayer),
2019 _ => Err("Failed to decode TransactionalError. Unknown variant".into()),
2020 }
2021 }
2022 }
2023 }
2024
2025 pub mod storage {
2026 use crate::chain_types::system::types::AccountInfo;
2027
2028 use super::*;
2029
2030 pub struct Account;
2031 impl StorageMap for Account {
2032 const PALLET_NAME: &str = "System";
2033 const STORAGE_NAME: &str = "Account";
2034 const KEY_HASHER: StorageHasher = StorageHasher::Blake2_128Concat;
2035 type KEY = AccountId;
2036 type VALUE = AccountInfo;
2037 }
2038 }
2039
2040 pub mod events {
2041 use super::*;
2042
2043 #[derive(Debug, Clone)]
2044 pub struct ExtrinsicSuccess {
2045 pub dispatch_info: super::types::DispatchInfo,
2046 }
2047 impl HasEventEmittedIndex for ExtrinsicSuccess {
2048 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 0);
2049 }
2050 impl Decode for ExtrinsicSuccess {
2051 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
2052 let dispatch_info = Decode::decode(input)?;
2053 Ok(Self { dispatch_info })
2054 }
2055 }
2056
2057 #[derive(Debug, Clone)]
2058 pub struct ExtrinsicFailed {
2059 pub dispatch_error: super::types::DispatchError,
2060 pub dispatch_info: super::types::DispatchInfo,
2061 }
2062 impl HasEventEmittedIndex for ExtrinsicFailed {
2063 const EMITTED_INDEX: (u8, u8) = (PALLET_ID, 1);
2064 }
2065 impl Decode for ExtrinsicFailed {
2066 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
2067 let dispatch_error = Decode::decode(input)?;
2068 let dispatch_info = Decode::decode(input)?;
2069 Ok(Self {
2070 dispatch_error,
2071 dispatch_info,
2072 })
2073 }
2074 }
2075 }
2076
2077 pub mod tx {
2078 use super::*;
2079
2080 #[derive(Debug, Clone)]
2081 pub struct Remark {
2082 pub remark: Vec<u8>,
2083 }
2084 impl Encode for Remark {
2085 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
2086 self.remark.encode_to(dest);
2087 }
2088 }
2089 impl Decode for Remark {
2090 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
2091 let remark = Vec::<u8>::decode(input)?;
2092 Ok(Self { remark })
2093 }
2094 }
2095 impl HasTxDispatchIndex for Remark {
2096 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 0);
2097 }
2098
2099 #[derive(Debug, Clone)]
2100 pub struct SetCode {
2101 pub code: Vec<u8>,
2102 }
2103 impl Encode for SetCode {
2104 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
2105 self.code.encode_to(dest);
2106 }
2107 }
2108 impl Decode for SetCode {
2109 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
2110 let code = Vec::<u8>::decode(input)?;
2111 Ok(Self { code })
2112 }
2113 }
2114 impl HasTxDispatchIndex for SetCode {
2115 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 2);
2116 }
2117
2118 #[derive(Debug, Clone)]
2119 pub struct SetCodeWithoutChecks {
2120 pub code: Vec<u8>,
2121 }
2122 impl Encode for SetCodeWithoutChecks {
2123 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
2124 self.code.encode_to(dest);
2125 }
2126 }
2127 impl Decode for SetCodeWithoutChecks {
2128 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
2129 let code = Vec::<u8>::decode(input)?;
2130 Ok(Self { code })
2131 }
2132 }
2133 impl HasTxDispatchIndex for SetCodeWithoutChecks {
2134 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 3);
2135 }
2136
2137 #[derive(Debug, Clone)]
2138 pub struct RemarkWithEvent {
2139 pub remark: Vec<u8>,
2140 }
2141 impl Encode for RemarkWithEvent {
2142 fn encode_to<T: codec::Output + ?Sized>(&self, dest: &mut T) {
2143 self.remark.encode_to(dest);
2144 }
2145 }
2146 impl Decode for RemarkWithEvent {
2147 fn decode<I: codec::Input>(input: &mut I) -> Result<Self, codec::Error> {
2148 let remark = Vec::<u8>::decode(input)?;
2149 Ok(Self { remark })
2150 }
2151 }
2152 impl HasTxDispatchIndex for RemarkWithEvent {
2153 const DISPATCH_INDEX: (u8, u8) = (PALLET_ID, 7);
2154 }
2155 }
2156}