-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathsolomachine.ts
2088 lines (2088 loc) · 72.9 KB
/
solomachine.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any";
import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType } from "../../../core/connection/v1/connection";
import { Channel, ChannelAmino, ChannelSDKType } from "../../../core/channel/v1/channel";
import { BinaryReader, BinaryWriter } from "../../../../binary";
import { bytesFromBase64, base64FromBytes } from "../../../../helpers";
/**
* DataType defines the type of solo machine proof being created. This is done
* to preserve uniqueness of different data sign byte encodings.
*/
export enum DataType {
/** DATA_TYPE_UNINITIALIZED_UNSPECIFIED - Default State */
DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0,
/** DATA_TYPE_CLIENT_STATE - Data type for client state verification */
DATA_TYPE_CLIENT_STATE = 1,
/** DATA_TYPE_CONSENSUS_STATE - Data type for consensus state verification */
DATA_TYPE_CONSENSUS_STATE = 2,
/** DATA_TYPE_CONNECTION_STATE - Data type for connection state verification */
DATA_TYPE_CONNECTION_STATE = 3,
/** DATA_TYPE_CHANNEL_STATE - Data type for channel state verification */
DATA_TYPE_CHANNEL_STATE = 4,
/** DATA_TYPE_PACKET_COMMITMENT - Data type for packet commitment verification */
DATA_TYPE_PACKET_COMMITMENT = 5,
/** DATA_TYPE_PACKET_ACKNOWLEDGEMENT - Data type for packet acknowledgement verification */
DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6,
/** DATA_TYPE_PACKET_RECEIPT_ABSENCE - Data type for packet receipt absence verification */
DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7,
/** DATA_TYPE_NEXT_SEQUENCE_RECV - Data type for next sequence recv verification */
DATA_TYPE_NEXT_SEQUENCE_RECV = 8,
/** DATA_TYPE_HEADER - Data type for header verification */
DATA_TYPE_HEADER = 9,
UNRECOGNIZED = -1,
}
export const DataTypeSDKType = DataType;
export const DataTypeAmino = DataType;
export function dataTypeFromJSON(object: any): DataType {
switch (object) {
case 0:
case "DATA_TYPE_UNINITIALIZED_UNSPECIFIED":
return DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED;
case 1:
case "DATA_TYPE_CLIENT_STATE":
return DataType.DATA_TYPE_CLIENT_STATE;
case 2:
case "DATA_TYPE_CONSENSUS_STATE":
return DataType.DATA_TYPE_CONSENSUS_STATE;
case 3:
case "DATA_TYPE_CONNECTION_STATE":
return DataType.DATA_TYPE_CONNECTION_STATE;
case 4:
case "DATA_TYPE_CHANNEL_STATE":
return DataType.DATA_TYPE_CHANNEL_STATE;
case 5:
case "DATA_TYPE_PACKET_COMMITMENT":
return DataType.DATA_TYPE_PACKET_COMMITMENT;
case 6:
case "DATA_TYPE_PACKET_ACKNOWLEDGEMENT":
return DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT;
case 7:
case "DATA_TYPE_PACKET_RECEIPT_ABSENCE":
return DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE;
case 8:
case "DATA_TYPE_NEXT_SEQUENCE_RECV":
return DataType.DATA_TYPE_NEXT_SEQUENCE_RECV;
case 9:
case "DATA_TYPE_HEADER":
return DataType.DATA_TYPE_HEADER;
case -1:
case "UNRECOGNIZED":
default:
return DataType.UNRECOGNIZED;
}
}
export function dataTypeToJSON(object: DataType): string {
switch (object) {
case DataType.DATA_TYPE_UNINITIALIZED_UNSPECIFIED:
return "DATA_TYPE_UNINITIALIZED_UNSPECIFIED";
case DataType.DATA_TYPE_CLIENT_STATE:
return "DATA_TYPE_CLIENT_STATE";
case DataType.DATA_TYPE_CONSENSUS_STATE:
return "DATA_TYPE_CONSENSUS_STATE";
case DataType.DATA_TYPE_CONNECTION_STATE:
return "DATA_TYPE_CONNECTION_STATE";
case DataType.DATA_TYPE_CHANNEL_STATE:
return "DATA_TYPE_CHANNEL_STATE";
case DataType.DATA_TYPE_PACKET_COMMITMENT:
return "DATA_TYPE_PACKET_COMMITMENT";
case DataType.DATA_TYPE_PACKET_ACKNOWLEDGEMENT:
return "DATA_TYPE_PACKET_ACKNOWLEDGEMENT";
case DataType.DATA_TYPE_PACKET_RECEIPT_ABSENCE:
return "DATA_TYPE_PACKET_RECEIPT_ABSENCE";
case DataType.DATA_TYPE_NEXT_SEQUENCE_RECV:
return "DATA_TYPE_NEXT_SEQUENCE_RECV";
case DataType.DATA_TYPE_HEADER:
return "DATA_TYPE_HEADER";
case DataType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
/**
* ClientState defines a solo machine client that tracks the current consensus
* state and if the client is frozen.
*/
export interface ClientState {
/** latest sequence of the client state */
sequence: bigint;
/** frozen sequence of the solo machine */
frozenSequence: bigint;
consensusState?: ConsensusState | undefined;
/**
* when set to true, will allow governance to update a solo machine client.
* The client will be unfrozen if it is frozen.
*/
allowUpdateAfterProposal: boolean;
}
export interface ClientStateProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.ClientState";
value: Uint8Array;
}
/**
* ClientState defines a solo machine client that tracks the current consensus
* state and if the client is frozen.
*/
export interface ClientStateAmino {
/** latest sequence of the client state */
sequence?: string;
/** frozen sequence of the solo machine */
frozen_sequence?: string;
consensus_state?: ConsensusStateAmino | undefined;
/**
* when set to true, will allow governance to update a solo machine client.
* The client will be unfrozen if it is frozen.
*/
allow_update_after_proposal?: boolean;
}
export interface ClientStateAminoMsg {
type: "cosmos-sdk/ClientState";
value: ClientStateAmino;
}
/**
* ClientState defines a solo machine client that tracks the current consensus
* state and if the client is frozen.
*/
export interface ClientStateSDKType {
sequence: bigint;
frozen_sequence: bigint;
consensus_state?: ConsensusStateSDKType | undefined;
allow_update_after_proposal: boolean;
}
/**
* ConsensusState defines a solo machine consensus state. The sequence of a
* consensus state is contained in the "height" key used in storing the
* consensus state.
*/
export interface ConsensusState {
/** public key of the solo machine */
publicKey?: Any | undefined;
/**
* diversifier allows the same public key to be re-used across different solo
* machine clients (potentially on different chains) without being considered
* misbehaviour.
*/
diversifier: string;
timestamp: bigint;
}
export interface ConsensusStateProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusState";
value: Uint8Array;
}
/**
* ConsensusState defines a solo machine consensus state. The sequence of a
* consensus state is contained in the "height" key used in storing the
* consensus state.
*/
export interface ConsensusStateAmino {
/** public key of the solo machine */
public_key?: AnyAmino | undefined;
/**
* diversifier allows the same public key to be re-used across different solo
* machine clients (potentially on different chains) without being considered
* misbehaviour.
*/
diversifier?: string;
timestamp?: string;
}
export interface ConsensusStateAminoMsg {
type: "cosmos-sdk/ConsensusState";
value: ConsensusStateAmino;
}
/**
* ConsensusState defines a solo machine consensus state. The sequence of a
* consensus state is contained in the "height" key used in storing the
* consensus state.
*/
export interface ConsensusStateSDKType {
public_key?: AnySDKType | undefined;
diversifier: string;
timestamp: bigint;
}
/** Header defines a solo machine consensus header */
export interface Header {
/** sequence to update solo machine public key at */
sequence: bigint;
timestamp: bigint;
signature: Uint8Array;
newPublicKey?: Any | undefined;
newDiversifier: string;
}
export interface HeaderProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.Header";
value: Uint8Array;
}
/** Header defines a solo machine consensus header */
export interface HeaderAmino {
/** sequence to update solo machine public key at */
sequence?: string;
timestamp?: string;
signature?: string;
new_public_key?: AnyAmino | undefined;
new_diversifier?: string;
}
export interface HeaderAminoMsg {
type: "cosmos-sdk/Header";
value: HeaderAmino;
}
/** Header defines a solo machine consensus header */
export interface HeaderSDKType {
sequence: bigint;
timestamp: bigint;
signature: Uint8Array;
new_public_key?: AnySDKType | undefined;
new_diversifier: string;
}
/**
* Misbehaviour defines misbehaviour for a solo machine which consists
* of a sequence and two signatures over different messages at that sequence.
*/
export interface Misbehaviour {
clientId: string;
sequence: bigint;
signatureOne?: SignatureAndData | undefined;
signatureTwo?: SignatureAndData | undefined;
}
export interface MisbehaviourProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.Misbehaviour";
value: Uint8Array;
}
/**
* Misbehaviour defines misbehaviour for a solo machine which consists
* of a sequence and two signatures over different messages at that sequence.
*/
export interface MisbehaviourAmino {
client_id?: string;
sequence?: string;
signature_one?: SignatureAndDataAmino | undefined;
signature_two?: SignatureAndDataAmino | undefined;
}
export interface MisbehaviourAminoMsg {
type: "cosmos-sdk/Misbehaviour";
value: MisbehaviourAmino;
}
/**
* Misbehaviour defines misbehaviour for a solo machine which consists
* of a sequence and two signatures over different messages at that sequence.
*/
export interface MisbehaviourSDKType {
client_id: string;
sequence: bigint;
signature_one?: SignatureAndDataSDKType | undefined;
signature_two?: SignatureAndDataSDKType | undefined;
}
/**
* SignatureAndData contains a signature and the data signed over to create that
* signature.
*/
export interface SignatureAndData {
signature: Uint8Array;
dataType: DataType;
data: Uint8Array;
timestamp: bigint;
}
export interface SignatureAndDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.SignatureAndData";
value: Uint8Array;
}
/**
* SignatureAndData contains a signature and the data signed over to create that
* signature.
*/
export interface SignatureAndDataAmino {
signature?: string;
data_type?: DataType;
data?: string;
timestamp?: string;
}
export interface SignatureAndDataAminoMsg {
type: "cosmos-sdk/SignatureAndData";
value: SignatureAndDataAmino;
}
/**
* SignatureAndData contains a signature and the data signed over to create that
* signature.
*/
export interface SignatureAndDataSDKType {
signature: Uint8Array;
data_type: DataType;
data: Uint8Array;
timestamp: bigint;
}
/**
* TimestampedSignatureData contains the signature data and the timestamp of the
* signature.
*/
export interface TimestampedSignatureData {
signatureData: Uint8Array;
timestamp: bigint;
}
export interface TimestampedSignatureDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.TimestampedSignatureData";
value: Uint8Array;
}
/**
* TimestampedSignatureData contains the signature data and the timestamp of the
* signature.
*/
export interface TimestampedSignatureDataAmino {
signature_data?: string;
timestamp?: string;
}
export interface TimestampedSignatureDataAminoMsg {
type: "cosmos-sdk/TimestampedSignatureData";
value: TimestampedSignatureDataAmino;
}
/**
* TimestampedSignatureData contains the signature data and the timestamp of the
* signature.
*/
export interface TimestampedSignatureDataSDKType {
signature_data: Uint8Array;
timestamp: bigint;
}
/** SignBytes defines the signed bytes used for signature verification. */
export interface SignBytes {
sequence: bigint;
timestamp: bigint;
diversifier: string;
/** type of the data used */
dataType: DataType;
/** marshaled data */
data: Uint8Array;
}
export interface SignBytesProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.SignBytes";
value: Uint8Array;
}
/** SignBytes defines the signed bytes used for signature verification. */
export interface SignBytesAmino {
sequence?: string;
timestamp?: string;
diversifier?: string;
/** type of the data used */
data_type?: DataType;
/** marshaled data */
data?: string;
}
export interface SignBytesAminoMsg {
type: "cosmos-sdk/SignBytes";
value: SignBytesAmino;
}
/** SignBytes defines the signed bytes used for signature verification. */
export interface SignBytesSDKType {
sequence: bigint;
timestamp: bigint;
diversifier: string;
data_type: DataType;
data: Uint8Array;
}
/** HeaderData returns the SignBytes data for update verification. */
export interface HeaderData {
/** header public key */
newPubKey?: Any | undefined;
/** header diversifier */
newDiversifier: string;
}
export interface HeaderDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.HeaderData";
value: Uint8Array;
}
/** HeaderData returns the SignBytes data for update verification. */
export interface HeaderDataAmino {
/** header public key */
new_pub_key?: AnyAmino | undefined;
/** header diversifier */
new_diversifier?: string;
}
export interface HeaderDataAminoMsg {
type: "cosmos-sdk/HeaderData";
value: HeaderDataAmino;
}
/** HeaderData returns the SignBytes data for update verification. */
export interface HeaderDataSDKType {
new_pub_key?: AnySDKType | undefined;
new_diversifier: string;
}
/** ClientStateData returns the SignBytes data for client state verification. */
export interface ClientStateData {
path: Uint8Array;
clientState?: Any | undefined;
}
export interface ClientStateDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.ClientStateData";
value: Uint8Array;
}
/** ClientStateData returns the SignBytes data for client state verification. */
export interface ClientStateDataAmino {
path?: string;
client_state?: AnyAmino | undefined;
}
export interface ClientStateDataAminoMsg {
type: "cosmos-sdk/ClientStateData";
value: ClientStateDataAmino;
}
/** ClientStateData returns the SignBytes data for client state verification. */
export interface ClientStateDataSDKType {
path: Uint8Array;
client_state?: AnySDKType | undefined;
}
/**
* ConsensusStateData returns the SignBytes data for consensus state
* verification.
*/
export interface ConsensusStateData {
path: Uint8Array;
consensusState?: Any | undefined;
}
export interface ConsensusStateDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusStateData";
value: Uint8Array;
}
/**
* ConsensusStateData returns the SignBytes data for consensus state
* verification.
*/
export interface ConsensusStateDataAmino {
path?: string;
consensus_state?: AnyAmino | undefined;
}
export interface ConsensusStateDataAminoMsg {
type: "cosmos-sdk/ConsensusStateData";
value: ConsensusStateDataAmino;
}
/**
* ConsensusStateData returns the SignBytes data for consensus state
* verification.
*/
export interface ConsensusStateDataSDKType {
path: Uint8Array;
consensus_state?: AnySDKType | undefined;
}
/**
* ConnectionStateData returns the SignBytes data for connection state
* verification.
*/
export interface ConnectionStateData {
path: Uint8Array;
connection?: ConnectionEnd | undefined;
}
export interface ConnectionStateDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.ConnectionStateData";
value: Uint8Array;
}
/**
* ConnectionStateData returns the SignBytes data for connection state
* verification.
*/
export interface ConnectionStateDataAmino {
path?: string;
connection?: ConnectionEndAmino | undefined;
}
export interface ConnectionStateDataAminoMsg {
type: "cosmos-sdk/ConnectionStateData";
value: ConnectionStateDataAmino;
}
/**
* ConnectionStateData returns the SignBytes data for connection state
* verification.
*/
export interface ConnectionStateDataSDKType {
path: Uint8Array;
connection?: ConnectionEndSDKType | undefined;
}
/**
* ChannelStateData returns the SignBytes data for channel state
* verification.
*/
export interface ChannelStateData {
path: Uint8Array;
channel?: Channel | undefined;
}
export interface ChannelStateDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.ChannelStateData";
value: Uint8Array;
}
/**
* ChannelStateData returns the SignBytes data for channel state
* verification.
*/
export interface ChannelStateDataAmino {
path?: string;
channel?: ChannelAmino | undefined;
}
export interface ChannelStateDataAminoMsg {
type: "cosmos-sdk/ChannelStateData";
value: ChannelStateDataAmino;
}
/**
* ChannelStateData returns the SignBytes data for channel state
* verification.
*/
export interface ChannelStateDataSDKType {
path: Uint8Array;
channel?: ChannelSDKType | undefined;
}
/**
* PacketCommitmentData returns the SignBytes data for packet commitment
* verification.
*/
export interface PacketCommitmentData {
path: Uint8Array;
commitment: Uint8Array;
}
export interface PacketCommitmentDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.PacketCommitmentData";
value: Uint8Array;
}
/**
* PacketCommitmentData returns the SignBytes data for packet commitment
* verification.
*/
export interface PacketCommitmentDataAmino {
path?: string;
commitment?: string;
}
export interface PacketCommitmentDataAminoMsg {
type: "cosmos-sdk/PacketCommitmentData";
value: PacketCommitmentDataAmino;
}
/**
* PacketCommitmentData returns the SignBytes data for packet commitment
* verification.
*/
export interface PacketCommitmentDataSDKType {
path: Uint8Array;
commitment: Uint8Array;
}
/**
* PacketAcknowledgementData returns the SignBytes data for acknowledgement
* verification.
*/
export interface PacketAcknowledgementData {
path: Uint8Array;
acknowledgement: Uint8Array;
}
export interface PacketAcknowledgementDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData";
value: Uint8Array;
}
/**
* PacketAcknowledgementData returns the SignBytes data for acknowledgement
* verification.
*/
export interface PacketAcknowledgementDataAmino {
path?: string;
acknowledgement?: string;
}
export interface PacketAcknowledgementDataAminoMsg {
type: "cosmos-sdk/PacketAcknowledgementData";
value: PacketAcknowledgementDataAmino;
}
/**
* PacketAcknowledgementData returns the SignBytes data for acknowledgement
* verification.
*/
export interface PacketAcknowledgementDataSDKType {
path: Uint8Array;
acknowledgement: Uint8Array;
}
/**
* PacketReceiptAbsenceData returns the SignBytes data for
* packet receipt absence verification.
*/
export interface PacketReceiptAbsenceData {
path: Uint8Array;
}
export interface PacketReceiptAbsenceDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData";
value: Uint8Array;
}
/**
* PacketReceiptAbsenceData returns the SignBytes data for
* packet receipt absence verification.
*/
export interface PacketReceiptAbsenceDataAmino {
path?: string;
}
export interface PacketReceiptAbsenceDataAminoMsg {
type: "cosmos-sdk/PacketReceiptAbsenceData";
value: PacketReceiptAbsenceDataAmino;
}
/**
* PacketReceiptAbsenceData returns the SignBytes data for
* packet receipt absence verification.
*/
export interface PacketReceiptAbsenceDataSDKType {
path: Uint8Array;
}
/**
* NextSequenceRecvData returns the SignBytes data for verification of the next
* sequence to be received.
*/
export interface NextSequenceRecvData {
path: Uint8Array;
nextSeqRecv: bigint;
}
export interface NextSequenceRecvDataProtoMsg {
typeUrl: "/ibc.lightclients.solomachine.v1.NextSequenceRecvData";
value: Uint8Array;
}
/**
* NextSequenceRecvData returns the SignBytes data for verification of the next
* sequence to be received.
*/
export interface NextSequenceRecvDataAmino {
path?: string;
next_seq_recv?: string;
}
export interface NextSequenceRecvDataAminoMsg {
type: "cosmos-sdk/NextSequenceRecvData";
value: NextSequenceRecvDataAmino;
}
/**
* NextSequenceRecvData returns the SignBytes data for verification of the next
* sequence to be received.
*/
export interface NextSequenceRecvDataSDKType {
path: Uint8Array;
next_seq_recv: bigint;
}
function createBaseClientState(): ClientState {
return {
sequence: BigInt(0),
frozenSequence: BigInt(0),
consensusState: undefined,
allowUpdateAfterProposal: false
};
}
export const ClientState = {
typeUrl: "/ibc.lightclients.solomachine.v1.ClientState",
encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.sequence !== BigInt(0)) {
writer.uint32(8).uint64(message.sequence);
}
if (message.frozenSequence !== BigInt(0)) {
writer.uint32(16).uint64(message.frozenSequence);
}
if (message.consensusState !== undefined) {
ConsensusState.encode(message.consensusState, writer.uint32(26).fork()).ldelim();
}
if (message.allowUpdateAfterProposal === true) {
writer.uint32(32).bool(message.allowUpdateAfterProposal);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ClientState {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseClientState();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.sequence = reader.uint64();
break;
case 2:
message.frozenSequence = reader.uint64();
break;
case 3:
message.consensusState = ConsensusState.decode(reader, reader.uint32());
break;
case 4:
message.allowUpdateAfterProposal = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<ClientState>): ClientState {
const message = createBaseClientState();
message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0);
message.frozenSequence = object.frozenSequence !== undefined && object.frozenSequence !== null ? BigInt(object.frozenSequence.toString()) : BigInt(0);
message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? ConsensusState.fromPartial(object.consensusState) : undefined;
message.allowUpdateAfterProposal = object.allowUpdateAfterProposal ?? false;
return message;
},
fromAmino(object: ClientStateAmino): ClientState {
const message = createBaseClientState();
if (object.sequence !== undefined && object.sequence !== null) {
message.sequence = BigInt(object.sequence);
}
if (object.frozen_sequence !== undefined && object.frozen_sequence !== null) {
message.frozenSequence = BigInt(object.frozen_sequence);
}
if (object.consensus_state !== undefined && object.consensus_state !== null) {
message.consensusState = ConsensusState.fromAmino(object.consensus_state);
}
if (object.allow_update_after_proposal !== undefined && object.allow_update_after_proposal !== null) {
message.allowUpdateAfterProposal = object.allow_update_after_proposal;
}
return message;
},
toAmino(message: ClientState): ClientStateAmino {
const obj: any = {};
obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined;
obj.frozen_sequence = message.frozenSequence !== BigInt(0) ? message.frozenSequence.toString() : undefined;
obj.consensus_state = message.consensusState ? ConsensusState.toAmino(message.consensusState) : undefined;
obj.allow_update_after_proposal = message.allowUpdateAfterProposal === false ? undefined : message.allowUpdateAfterProposal;
return obj;
},
fromAminoMsg(object: ClientStateAminoMsg): ClientState {
return ClientState.fromAmino(object.value);
},
toAminoMsg(message: ClientState): ClientStateAminoMsg {
return {
type: "cosmos-sdk/ClientState",
value: ClientState.toAmino(message)
};
},
fromProtoMsg(message: ClientStateProtoMsg): ClientState {
return ClientState.decode(message.value);
},
toProto(message: ClientState): Uint8Array {
return ClientState.encode(message).finish();
},
toProtoMsg(message: ClientState): ClientStateProtoMsg {
return {
typeUrl: "/ibc.lightclients.solomachine.v1.ClientState",
value: ClientState.encode(message).finish()
};
}
};
function createBaseConsensusState(): ConsensusState {
return {
publicKey: undefined,
diversifier: "",
timestamp: BigInt(0)
};
}
export const ConsensusState = {
typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusState",
encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.publicKey !== undefined) {
Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim();
}
if (message.diversifier !== "") {
writer.uint32(18).string(message.diversifier);
}
if (message.timestamp !== BigInt(0)) {
writer.uint32(24).uint64(message.timestamp);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConsensusState();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.publicKey = Any.decode(reader, reader.uint32());
break;
case 2:
message.diversifier = reader.string();
break;
case 3:
message.timestamp = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<ConsensusState>): ConsensusState {
const message = createBaseConsensusState();
message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined;
message.diversifier = object.diversifier ?? "";
message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0);
return message;
},
fromAmino(object: ConsensusStateAmino): ConsensusState {
const message = createBaseConsensusState();
if (object.public_key !== undefined && object.public_key !== null) {
message.publicKey = Any.fromAmino(object.public_key);
}
if (object.diversifier !== undefined && object.diversifier !== null) {
message.diversifier = object.diversifier;
}
if (object.timestamp !== undefined && object.timestamp !== null) {
message.timestamp = BigInt(object.timestamp);
}
return message;
},
toAmino(message: ConsensusState): ConsensusStateAmino {
const obj: any = {};
obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined;
obj.diversifier = message.diversifier === "" ? undefined : message.diversifier;
obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined;
return obj;
},
fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState {
return ConsensusState.fromAmino(object.value);
},
toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg {
return {
type: "cosmos-sdk/ConsensusState",
value: ConsensusState.toAmino(message)
};
},
fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState {
return ConsensusState.decode(message.value);
},
toProto(message: ConsensusState): Uint8Array {
return ConsensusState.encode(message).finish();
},
toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg {
return {
typeUrl: "/ibc.lightclients.solomachine.v1.ConsensusState",
value: ConsensusState.encode(message).finish()
};
}
};
function createBaseHeader(): Header {
return {
sequence: BigInt(0),
timestamp: BigInt(0),
signature: new Uint8Array(),
newPublicKey: undefined,
newDiversifier: ""
};
}
export const Header = {
typeUrl: "/ibc.lightclients.solomachine.v1.Header",
encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.sequence !== BigInt(0)) {
writer.uint32(8).uint64(message.sequence);
}
if (message.timestamp !== BigInt(0)) {
writer.uint32(16).uint64(message.timestamp);
}
if (message.signature.length !== 0) {
writer.uint32(26).bytes(message.signature);
}
if (message.newPublicKey !== undefined) {
Any.encode(message.newPublicKey, writer.uint32(34).fork()).ldelim();
}
if (message.newDiversifier !== "") {
writer.uint32(42).string(message.newDiversifier);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Header {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseHeader();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.sequence = reader.uint64();
break;
case 2:
message.timestamp = reader.uint64();
break;
case 3:
message.signature = reader.bytes();
break;
case 4:
message.newPublicKey = Any.decode(reader, reader.uint32());
break;
case 5:
message.newDiversifier = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromPartial(object: Partial<Header>): Header {
const message = createBaseHeader();
message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0);
message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0);
message.signature = object.signature ?? new Uint8Array();
message.newPublicKey = object.newPublicKey !== undefined && object.newPublicKey !== null ? Any.fromPartial(object.newPublicKey) : undefined;
message.newDiversifier = object.newDiversifier ?? "";
return message;
},
fromAmino(object: HeaderAmino): Header {
const message = createBaseHeader();
if (object.sequence !== undefined && object.sequence !== null) {
message.sequence = BigInt(object.sequence);
}
if (object.timestamp !== undefined && object.timestamp !== null) {
message.timestamp = BigInt(object.timestamp);
}
if (object.signature !== undefined && object.signature !== null) {
message.signature = bytesFromBase64(object.signature);
}
if (object.new_public_key !== undefined && object.new_public_key !== null) {
message.newPublicKey = Any.fromAmino(object.new_public_key);
}
if (object.new_diversifier !== undefined && object.new_diversifier !== null) {
message.newDiversifier = object.new_diversifier;
}
return message;
},
toAmino(message: Header): HeaderAmino {
const obj: any = {};
obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined;
obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined;
obj.signature = message.signature ? base64FromBytes(message.signature) : undefined;
obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined;
obj.new_diversifier = message.newDiversifier === "" ? undefined : message.newDiversifier;
return obj;
},
fromAminoMsg(object: HeaderAminoMsg): Header {
return Header.fromAmino(object.value);
},
toAminoMsg(message: Header): HeaderAminoMsg {
return {
type: "cosmos-sdk/Header",
value: Header.toAmino(message)
};
},
fromProtoMsg(message: HeaderProtoMsg): Header {
return Header.decode(message.value);
},
toProto(message: Header): Uint8Array {
return Header.encode(message).finish();
},
toProtoMsg(message: Header): HeaderProtoMsg {
return {
typeUrl: "/ibc.lightclients.solomachine.v1.Header",
value: Header.encode(message).finish()
};
}
};
function createBaseMisbehaviour(): Misbehaviour {
return {
clientId: "",
sequence: BigInt(0),
signatureOne: undefined,
signatureTwo: undefined
};
}
export const Misbehaviour = {
typeUrl: "/ibc.lightclients.solomachine.v1.Misbehaviour",
encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.clientId !== "") {
writer.uint32(10).string(message.clientId);
}
if (message.sequence !== BigInt(0)) {
writer.uint32(16).uint64(message.sequence);
}
if (message.signatureOne !== undefined) {
SignatureAndData.encode(message.signatureOne, writer.uint32(26).fork()).ldelim();
}
if (message.signatureTwo !== undefined) {
SignatureAndData.encode(message.signatureTwo, writer.uint32(34).fork()).ldelim();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMisbehaviour();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.clientId = reader.string();
break;
case 2:
message.sequence = reader.uint64();