scale.rb 0.2.12 → 0.2.17

Sign up to get free protection for your applications and to get access to all the features.
data/lib/scale/types.rb CHANGED
@@ -570,34 +570,52 @@ module Scale
570
570
 
571
571
  class VecU8Length2
572
572
  include VecU8FixedLength
573
+ BYTE_LENGTH = 2
573
574
  end
574
575
 
575
576
  class VecU8Length3
576
577
  include VecU8FixedLength
578
+ BYTE_LENGTH = 3
577
579
  end
578
580
 
579
581
  class VecU8Length4
580
582
  include VecU8FixedLength
583
+ BYTE_LENGTH = 4
581
584
  end
582
585
 
583
586
  class VecU8Length8
584
587
  include VecU8FixedLength
588
+ BYTE_LENGTH = 8
585
589
  end
586
590
 
587
591
  class VecU8Length16
588
592
  include VecU8FixedLength
593
+ BYTE_LENGTH = 16
589
594
  end
590
595
 
591
596
  class VecU8Length20
592
597
  include VecU8FixedLength
598
+ BYTE_LENGTH = 20
593
599
  end
594
600
 
595
601
  class VecU8Length32
596
602
  include VecU8FixedLength
603
+ BYTE_LENGTH = 32
597
604
  end
598
605
 
599
606
  class VecU8Length64
600
607
  include VecU8FixedLength
608
+ BYTE_LENGTH = 64
609
+ end
610
+
611
+ class VecU8Length128
612
+ include VecU8FixedLength
613
+ BYTE_LENGTH = 128
614
+ end
615
+
616
+ class VecU8Length256
617
+ include VecU8FixedLength
618
+ BYTE_LENGTH = 256
601
619
  end
602
620
 
603
621
  class BalanceLock
data/lib/scale/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Scale
2
- VERSION = "0.2.12".freeze
2
+ VERSION = "0.2.17".freeze
3
3
  end
@@ -0,0 +1,170 @@
1
+ require "faye/websocket"
2
+ require "eventmachine"
3
+
4
+ def ws_request(url, payload)
5
+ result = nil
6
+
7
+ EM.run do
8
+ ws = Faye::WebSocket::Client.new(url)
9
+
10
+ ws.on :open do |event|
11
+ ws.send(payload.to_json)
12
+ end
13
+
14
+ ws.on :message do |event|
15
+ if event.data.include?("jsonrpc")
16
+ result = JSON.parse event.data
17
+ ws.close(3001, "data received")
18
+ EM.stop
19
+ end
20
+ end
21
+
22
+ ws.on :close do |event|
23
+ ws = nil
24
+ end
25
+ end
26
+
27
+ result
28
+ end
29
+
30
+ class SubstrateClient
31
+ class WebsocketError < StandardError; end
32
+ class RpcError < StandardError; end
33
+ class RpcTimeout < StandardError; end
34
+
35
+ attr_reader :metadata
36
+ attr_reader :spec_name, :spec_version
37
+
38
+ def initialize(url)
39
+ @url = url
40
+ @request_id = 1
41
+ @metadata_cache = {}
42
+ end
43
+
44
+ def request(method, params)
45
+ payload = {
46
+ "jsonrpc" => "2.0",
47
+ "method" => method,
48
+ "params" => params,
49
+ "id" => @request_id
50
+ }
51
+
52
+ data = ws_request(@url, payload)
53
+ if data["error"]
54
+ raise RpcError, data["error"]
55
+ else
56
+ data["result"]
57
+ end
58
+ end
59
+
60
+ def init_types_and_metadata(block_hash=nil)
61
+ runtime_version = self.state_getRuntimeVersion(block_hash)
62
+ spec_name = runtime_version["specName"].downcase
63
+ spec_version = runtime_version["specVersion"]
64
+
65
+ registry = Scale::TypeRegistry.instance
66
+
67
+ # load types
68
+ if registry.types == nil
69
+ registry.load(spec_name: spec_name)
70
+ end
71
+ registry.spec_version = spec_version
72
+
73
+ # set current metadata
74
+ metadata = @metadata_cache[spec_version]
75
+ if metadata.nil?
76
+ hex = self.state_getMetadata(block_hash)
77
+ metadata = Scale::Types::Metadata.decode(Scale::Bytes.new(hex))
78
+ @metadata_cache[spec_version] = metadata
79
+ end
80
+
81
+ @metadata = metadata
82
+ registry.metadata = metadata
83
+
84
+ true
85
+ end
86
+
87
+ def get_metadata_from_cache(spec_version)
88
+
89
+ end
90
+
91
+ def invoke(method, *params)
92
+ request(method, params)
93
+ end
94
+
95
+ # ################################################
96
+ # origin rpc methods
97
+ # ################################################
98
+ def method_missing(method, *args)
99
+ invoke method, *args
100
+ end
101
+
102
+ # ################################################
103
+ # custom methods based on origin rpc methods
104
+ # ################################################
105
+ def methods
106
+ invoke("rpc_methods")["methods"]
107
+ end
108
+
109
+ def get_block_number(block_hash)
110
+ header = self.chain_getHeader(block_hash)
111
+ header["number"].to_i(16)
112
+ end
113
+
114
+ def get_metadata(block_hash=nil)
115
+ self.init_types_and_metadata(block_hash)
116
+ @metadata
117
+ end
118
+
119
+ def get_block(block_hash=nil)
120
+ self.init_types_and_metadata(block_hash)
121
+ block = self.chain_getBlock(block_hash)
122
+ SubstrateClient::Helper.decode_block(block)
123
+ rescue => ex
124
+ puts ex.message
125
+ puts ex.backtrace.join("\n\t")
126
+ end
127
+
128
+ def get_block_events(block_hash=nil)
129
+ self.init_types_and_metadata(block_hash)
130
+
131
+ storage_key = "0x26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7"
132
+ events_data = state_getStorage storage_key, block_hash
133
+
134
+ scale_bytes = Scale::Bytes.new(events_data)
135
+ decoded = Scale::Types.get("Vec<EventRecord>").decode(scale_bytes).to_human
136
+ [events_data, decoded]
137
+ end
138
+
139
+ # Plain: client.get_storage("Sudo", "Key")
140
+ # Plain: client.get_storage("Balances", "TotalIssuance")
141
+ # Map: client.get_storage("System", "Account", ["0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"])
142
+ # DoubleMap: client.get_storage("ImOnline", "AuthoredBlocks", [2818, "0x749ddc93a65dfec3af27cc7478212cb7d4b0c0357fef35a0163966ab5333b757"])
143
+ def get_storage(module_name, storage_name, params = nil, block_hash = nil)
144
+ self.init_types_and_metadata(block_hash)
145
+
146
+ storage_key, return_type = SubstrateClient::Helper.generate_storage_key_from_metadata(@metadata, module_name, storage_name, params)
147
+ data = self.state_getStorage(storage_key, block_hash)
148
+ return unless data
149
+
150
+ bytes = Scale::Bytes.new(data)
151
+ type = Scale::Types.get(return_type)
152
+ type.decode(bytes)
153
+ end
154
+
155
+ def generate_storage_key(module_name, storage_name, params = nil, block_hash = nil)
156
+ self.init_types_and_metadata(block_hash)
157
+ SubstrateClient::Helper.generate_storage_key_from_metadata(@metadata, module_name, storage_name, params)
158
+ end
159
+
160
+ # compose_call "Balances", "Transfer", { dest: "0x586cb27c291c813ce74e86a60dad270609abf2fc8bee107e44a80ac00225c409", value: 1_000_000_000_000 }
161
+ def compose_call(module_name, call_name, params, block_hash=nil)
162
+ self.init_types_and_metadata(block_hash)
163
+ SubstrateClient::Helper.compose_call_from_metadata(@metadata, module_name, call_name, params)
164
+ end
165
+
166
+ def generate_storage_hash_from_data(storage_hex_data)
167
+ "0x" + Crypto.blake2_256(Scale::Bytes.new(storage_hex_data).bytes)
168
+ end
169
+
170
+ end
@@ -0,0 +1,929 @@
1
+ {
2
+ "types": {
3
+ "Address": "AccountId",
4
+ "LookupSource": "AccountId",
5
+ "BalanceLock": {
6
+ "type": "struct",
7
+ "type_mapping": [
8
+ [
9
+ "id",
10
+ "LockIdentifier"
11
+ ],
12
+ [
13
+ "lock_for",
14
+ "LockFor"
15
+ ],
16
+ [
17
+ "lock_reasons",
18
+ "LockReasons"
19
+ ]
20
+ ]
21
+ },
22
+ "LockFor": {
23
+ "type": "enum",
24
+ "type_mapping": [
25
+ [
26
+ "Common",
27
+ "Common"
28
+ ],
29
+ [
30
+ "Staking",
31
+ "StakingLock"
32
+ ]
33
+ ]
34
+ },
35
+ "Common": {
36
+ "type": "struct",
37
+ "type_mapping": [
38
+ [
39
+ "amount",
40
+ "Balance"
41
+ ]
42
+ ]
43
+ },
44
+ "StakingLock": {
45
+ "type": "struct",
46
+ "type_mapping": [
47
+ [
48
+ "staking_amount",
49
+ "Balance"
50
+ ],
51
+ [
52
+ "unbondings",
53
+ "Vec<Unbonding>"
54
+ ]
55
+ ]
56
+ },
57
+ "LockReasons": {
58
+ "type": "enum",
59
+ "type_mapping": [
60
+ [
61
+ "Fee",
62
+ "Null"
63
+ ],
64
+ [
65
+ "Misc",
66
+ "Null"
67
+ ],
68
+ [
69
+ "All",
70
+ "Null"
71
+ ]
72
+ ]
73
+ },
74
+ "Unbonding": {
75
+ "type": "struct",
76
+ "type_mapping": [
77
+ [
78
+ "amount",
79
+ "Balance"
80
+ ],
81
+ [
82
+ "until",
83
+ "BlockNumber"
84
+ ]
85
+ ]
86
+ },
87
+ "AccountData": {
88
+ "type": "struct",
89
+ "type_mapping": [
90
+ [
91
+ "free",
92
+ "Balance"
93
+ ],
94
+ [
95
+ "reserved",
96
+ "Balance"
97
+ ],
98
+ [
99
+ "free_kton",
100
+ "Balance"
101
+ ],
102
+ [
103
+ "reserved_kton",
104
+ "Balance"
105
+ ]
106
+ ]
107
+ },
108
+ "RingBalance": "Balance",
109
+ "KtonBalance": "Balance",
110
+ "TsInMs": "u64",
111
+ "Power": "u32",
112
+ "DepositId": "U256",
113
+ "StakingBalanceT": {
114
+ "type": "enum",
115
+ "type_mapping": [
116
+ [
117
+ "RingBalance",
118
+ "Balance"
119
+ ],
120
+ [
121
+ "KtonBalance",
122
+ "Balance"
123
+ ]
124
+ ]
125
+ },
126
+ "StakingLedgerT": {
127
+ "type": "struct",
128
+ "type_mapping": [
129
+ [
130
+ "stash",
131
+ "AccountId"
132
+ ],
133
+ [
134
+ "active_ring",
135
+ "Compact<Balance>"
136
+ ],
137
+ [
138
+ "active_deposit_ring",
139
+ "Compact<Balance>"
140
+ ],
141
+ [
142
+ "active_kton",
143
+ "Compact<Balance>"
144
+ ],
145
+ [
146
+ "deposit_items",
147
+ "Vec<TimeDepositItem>"
148
+ ],
149
+ [
150
+ "ring_staking_lock",
151
+ "StakingLock"
152
+ ],
153
+ [
154
+ "kton_staking_lock",
155
+ "StakingLock"
156
+ ],
157
+ [
158
+ "claimed_rewards",
159
+ "Vec<EraIndex>"
160
+ ]
161
+ ]
162
+ },
163
+ "TimeDepositItem": {
164
+ "type": "struct",
165
+ "type_mapping": [
166
+ [
167
+ "value",
168
+ "Compact<Balance>"
169
+ ],
170
+ [
171
+ "start_time",
172
+ "Compact<TsInMs>"
173
+ ],
174
+ [
175
+ "expire_time",
176
+ "Compact<TsInMs>"
177
+ ]
178
+ ]
179
+ },
180
+ "ExposureT": {
181
+ "type": "struct",
182
+ "type_mapping": [
183
+ [
184
+ "own_ring_balance",
185
+ "Compact<Balance>"
186
+ ],
187
+ [
188
+ "own_kton_balance",
189
+ "Compact<Balance>"
190
+ ],
191
+ [
192
+ "own_power",
193
+ "Power"
194
+ ],
195
+ [
196
+ "total_power",
197
+ "Power"
198
+ ],
199
+ [
200
+ "others",
201
+ "Vec<IndividualExposure>"
202
+ ]
203
+ ]
204
+ },
205
+ "IndividualExposure": {
206
+ "type": "struct",
207
+ "type_mapping": [
208
+ [
209
+ "who",
210
+ "AccountId"
211
+ ],
212
+ [
213
+ "ring_balance",
214
+ "Compact<Balance>"
215
+ ],
216
+ [
217
+ "kton_balance",
218
+ "Compact<Balance>"
219
+ ],
220
+ [
221
+ "power",
222
+ "Power"
223
+ ]
224
+ ]
225
+ },
226
+ "ElectionResultT": {
227
+ "type": "struct",
228
+ "type_mapping": [
229
+ [
230
+ "elected_stashes",
231
+ "Vec<AccountId>"
232
+ ],
233
+ [
234
+ "exposures",
235
+ "Vec<(AccountId, ExposureT)>"
236
+ ],
237
+ [
238
+ "compute",
239
+ "ElectionCompute"
240
+ ]
241
+ ]
242
+ },
243
+ "RKT": {
244
+ "type": "struct",
245
+ "type_mapping": [
246
+ [
247
+ "r",
248
+ "Balance"
249
+ ],
250
+ [
251
+ "k",
252
+ "Balance"
253
+ ]
254
+ ]
255
+ },
256
+ "SpanRecord": {
257
+ "type": "struct",
258
+ "type_mapping": [
259
+ [
260
+ "slashed",
261
+ "RKT"
262
+ ],
263
+ [
264
+ "paid_out",
265
+ "RKT"
266
+ ]
267
+ ]
268
+ },
269
+ "UnappliedSlash": {
270
+ "type": "struct",
271
+ "type_mapping": [
272
+ [
273
+ "validator",
274
+ "AccountId"
275
+ ],
276
+ [
277
+ "own",
278
+ "RKT"
279
+ ],
280
+ [
281
+ "others",
282
+ "Vec<(AccountId, RKT)>"
283
+ ],
284
+ [
285
+ "reporters",
286
+ "Vec<AccountId>"
287
+ ],
288
+ [
289
+ "payout",
290
+ "RKT"
291
+ ]
292
+ ]
293
+ },
294
+ "TreasuryProposal": {
295
+ "type": "struct",
296
+ "type_mapping": [
297
+ [
298
+ "proposer",
299
+ "AccountId"
300
+ ],
301
+ [
302
+ "beneficiary",
303
+ "AccountId"
304
+ ],
305
+ [
306
+ "ring_value",
307
+ "Balance"
308
+ ],
309
+ [
310
+ "kton_value",
311
+ "Balance"
312
+ ],
313
+ [
314
+ "ring_bond",
315
+ "Balance"
316
+ ],
317
+ [
318
+ "kton_bond",
319
+ "Balance"
320
+ ]
321
+ ]
322
+ },
323
+ "MappedRing": "u128",
324
+ "EthereumTransactionIndex": "(H256, u64)",
325
+ "EthereumBlockNumber": "u64",
326
+ "EthereumHeader": {
327
+ "type": "struct",
328
+ "type_mapping": [
329
+ [
330
+ "parent_hash",
331
+ "H256"
332
+ ],
333
+ [
334
+ "timestamp",
335
+ "u64"
336
+ ],
337
+ [
338
+ "number",
339
+ "EthereumBlockNumber"
340
+ ],
341
+ [
342
+ "author",
343
+ "EthereumAddress"
344
+ ],
345
+ [
346
+ "transactions_root",
347
+ "H256"
348
+ ],
349
+ [
350
+ "uncles_hash",
351
+ "H256"
352
+ ],
353
+ [
354
+ "extra_data",
355
+ "Bytes"
356
+ ],
357
+ [
358
+ "state_root",
359
+ "H256"
360
+ ],
361
+ [
362
+ "receipts_root",
363
+ "H256"
364
+ ],
365
+ [
366
+ "log_bloom",
367
+ "Bloom"
368
+ ],
369
+ [
370
+ "gas_used",
371
+ "U256"
372
+ ],
373
+ [
374
+ "gas_limit",
375
+ "U256"
376
+ ],
377
+ [
378
+ "difficulty",
379
+ "U256"
380
+ ],
381
+ [
382
+ "seal",
383
+ "Vec<Bytes>"
384
+ ],
385
+ [
386
+ "hash",
387
+ "Option<H256>"
388
+ ]
389
+ ]
390
+ },
391
+ "EthereumAddress": "H160",
392
+ "Bloom": "[u8; 256]",
393
+ "H128": "[u8; 16]",
394
+ "EthashProof": {
395
+ "type": "struct",
396
+ "type_mapping": [
397
+ [
398
+ "dag_nodes",
399
+ "(H512, H512)"
400
+ ],
401
+ [
402
+ "proof",
403
+ "Vec<H128>"
404
+ ]
405
+ ]
406
+ },
407
+ "EthereumReceipt": {
408
+ "type": "struct",
409
+ "type_mapping": [
410
+ [
411
+ "gas_used",
412
+ "U256"
413
+ ],
414
+ [
415
+ "log_bloom",
416
+ "Bloom"
417
+ ],
418
+ [
419
+ "logs",
420
+ "Vec<LogEntry>"
421
+ ],
422
+ [
423
+ "outcome",
424
+ "TransactionOutcome"
425
+ ]
426
+ ]
427
+ },
428
+ "EthereumNetworkType": {
429
+ "type": "enum",
430
+ "type_mapping": [
431
+ [
432
+ "Mainnet",
433
+ "Null"
434
+ ],
435
+ [
436
+ "Ropsten",
437
+ "Null"
438
+ ]
439
+ ]
440
+ },
441
+ "RedeemFor": {
442
+ "type": "enum",
443
+ "type_mapping": [
444
+ [
445
+ "Token",
446
+ "Null"
447
+ ],
448
+ [
449
+ "Deposit",
450
+ "Null"
451
+ ]
452
+ ]
453
+ },
454
+ "EthereumReceiptProof": {
455
+ "type": "struct",
456
+ "type_mapping": [
457
+ [
458
+ "index",
459
+ "u64"
460
+ ],
461
+ [
462
+ "proof",
463
+ "Bytes"
464
+ ],
465
+ [
466
+ "header_hash",
467
+ "H256"
468
+ ]
469
+ ]
470
+ },
471
+ "EthereumReceiptProofThing": "(EthereumHeader, EthereumReceiptProof, MMRProof)",
472
+ "MMRProof": {
473
+ "type": "struct",
474
+ "type_mapping": [
475
+ [
476
+ "member_leaf_index",
477
+ "u64"
478
+ ],
479
+ [
480
+ "last_leaf_index",
481
+ "u64"
482
+ ],
483
+ [
484
+ "proof",
485
+ "Vec<H256>"
486
+ ]
487
+ ]
488
+ },
489
+ "OtherSignature": {
490
+ "type": "enum",
491
+ "type_mapping": [
492
+ [
493
+ "Eth",
494
+ "EcdsaSignature"
495
+ ],
496
+ [
497
+ "Tron",
498
+ "EcdsaSignature"
499
+ ]
500
+ ]
501
+ },
502
+ "EcdsaSignature": "[u8; 65]",
503
+ "OtherAddress": {
504
+ "type": "enum",
505
+ "type_mapping": [
506
+ [
507
+ "Eth",
508
+ "[u8; 20]"
509
+ ],
510
+ [
511
+ "Tron",
512
+ "[u8; 20]"
513
+ ]
514
+ ]
515
+ },
516
+ "AddressT": "[u8; 20]",
517
+ "BalancesRuntimeDispatchInfo": {
518
+ "type": "struct",
519
+ "type_mapping": [
520
+ [
521
+ "usable_balance",
522
+ "Balance"
523
+ ]
524
+ ]
525
+ },
526
+ "StakingRuntimeDispatchInfo": {
527
+ "type": "struct",
528
+ "type_mapping": [
529
+ [
530
+ "power",
531
+ "Power"
532
+ ]
533
+ ]
534
+ }
535
+ },
536
+ "versioning": [
537
+ {
538
+ "runtime_range": [
539
+ 20,
540
+ 28
541
+ ],
542
+ "types": {
543
+ "MerkleMountainRangeRootLog": {
544
+ "type": "struct",
545
+ "type_mapping": [
546
+ [
547
+ "prefix",
548
+ "[u8; 4]"
549
+ ],
550
+ [
551
+ "mmr_root",
552
+ "Hash"
553
+ ]
554
+ ]
555
+ }
556
+ }
557
+ },
558
+ {
559
+ "runtime_range": [
560
+ 29,
561
+ 30
562
+ ],
563
+ "types": {
564
+ "EcdsaMessage": "[u8; 32]",
565
+ "RelayAuthoritySigner": "EthereumAddress",
566
+ "RelayAuthorityMessage": "EcdsaMessage",
567
+ "RelayAuthoritySignature": "EcdsaSignature",
568
+ "Term": "u32",
569
+ "RelayAuthorityT": {
570
+ "type": "struct",
571
+ "type_mapping": [
572
+ [
573
+ "account_id",
574
+ "AccountId"
575
+ ],
576
+ [
577
+ "signer",
578
+ "Signer"
579
+ ],
580
+ [
581
+ "stake",
582
+ "Balance"
583
+ ],
584
+ [
585
+ "term",
586
+ "BlockNumber"
587
+ ]
588
+ ]
589
+ },
590
+ "MMRRoot": "Hash",
591
+ "MerkleMountainRangeRootLog": {
592
+ "type": "struct",
593
+ "type_mapping": [
594
+ [
595
+ "prefix",
596
+ "[u8; 4]"
597
+ ],
598
+ [
599
+ "parent_mmr_root",
600
+ "Hash"
601
+ ]
602
+ ]
603
+ },
604
+ "EthereumRelayHeaderParcel": {
605
+ "type": "struct",
606
+ "type_mapping": [
607
+ [
608
+ "header",
609
+ "EthereumHeader"
610
+ ],
611
+ [
612
+ "parent_mmr_root",
613
+ "H256"
614
+ ]
615
+ ]
616
+ }
617
+ }
618
+ },
619
+ {
620
+ "runtime_range": [
621
+ 25,
622
+ 30
623
+ ],
624
+ "types": {
625
+ "RelayProofs": "EthereumRelayProofs"
626
+ }
627
+ },
628
+ {
629
+ "runtime_range": [
630
+ 24,
631
+ 30
632
+ ],
633
+ "types": {
634
+ "RelayVotingState": {
635
+ "type": "struct",
636
+ "type_mapping": [
637
+ [
638
+ "ayes",
639
+ "Vec<AccountId>"
640
+ ],
641
+ [
642
+ "nays",
643
+ "Vec<AccountId>"
644
+ ]
645
+ ]
646
+ },
647
+ "ProxyType": {
648
+ "type": "enum",
649
+ "type_mapping": [
650
+ [
651
+ "Any",
652
+ "Null"
653
+ ],
654
+ [
655
+ "NonTransfer",
656
+ "Null"
657
+ ],
658
+ [
659
+ "Governance",
660
+ "Null"
661
+ ],
662
+ [
663
+ "Staking",
664
+ "Null"
665
+ ],
666
+ [
667
+ "IdentityJudgement",
668
+ "Null"
669
+ ],
670
+ [
671
+ "EthereumBridge",
672
+ "Null"
673
+ ]
674
+ ]
675
+ },
676
+ "RelayHeaderId": "EthereumBlockNumber",
677
+ "RelayHeaderParcel": "EthereumRelayHeaderParcel",
678
+ "RelayAffirmationId": {
679
+ "type": "struct",
680
+ "type_mapping": [
681
+ [
682
+ "game_id",
683
+ "EthereumBlockNumber"
684
+ ],
685
+ [
686
+ "round",
687
+ "u32"
688
+ ],
689
+ [
690
+ "index",
691
+ "u32"
692
+ ]
693
+ ]
694
+ },
695
+ "RelayAffirmationT": {
696
+ "type": "struct",
697
+ "type_mapping": [
698
+ [
699
+ "relayer",
700
+ "AccountId"
701
+ ],
702
+ [
703
+ "relay_header_parcels",
704
+ "EthereumRelayHeaderParcel"
705
+ ],
706
+ [
707
+ "bond",
708
+ "Balance"
709
+ ],
710
+ [
711
+ "maybe_extended_relay_affirmation_id",
712
+ "Option<RelayAffirmationId>"
713
+ ],
714
+ [
715
+ "verified",
716
+ "bool"
717
+ ]
718
+ ]
719
+ }
720
+ }
721
+ },
722
+ {
723
+ "runtime_range": [
724
+ 24,
725
+ 24
726
+ ],
727
+ "types": {
728
+ "RelayProofs": "EthereumRelayProof"
729
+ }
730
+ },
731
+ {
732
+ "runtime_range": [
733
+ 20,
734
+ 22
735
+ ],
736
+ "types": {
737
+ "EthereumHeaderBrief": {
738
+ "type": "struct",
739
+ "type_mapping": [
740
+ [
741
+ "total_difficulty",
742
+ "U256"
743
+ ],
744
+ [
745
+ "parent_hash",
746
+ "H256"
747
+ ],
748
+ [
749
+ "number",
750
+ "EthereumBlockNumber"
751
+ ],
752
+ [
753
+ "relayer",
754
+ "AccountId"
755
+ ]
756
+ ]
757
+ },
758
+ "EthereumHeaderThingWithProof": {
759
+ "type": "struct",
760
+ "type_mapping": [
761
+ [
762
+ "header",
763
+ "EthereumHeader"
764
+ ],
765
+ [
766
+ "ethash_proof",
767
+ "Vec<EthashProof>"
768
+ ],
769
+ [
770
+ "mmr_root",
771
+ "H256"
772
+ ],
773
+ [
774
+ "mmr_proof",
775
+ "Vec<H256>"
776
+ ]
777
+ ]
778
+ },
779
+ "ConfirmedEthereumHeaderInfo": {
780
+ "type": "struct",
781
+ "type_mapping": [
782
+ [
783
+ "header",
784
+ "EthereumHeader"
785
+ ],
786
+ [
787
+ "mmr_root",
788
+ "H256"
789
+ ]
790
+ ]
791
+ },
792
+ "EthereumHeaderThing": {
793
+ "type": "struct",
794
+ "type_mapping": [
795
+ [
796
+ "header",
797
+ "EthereumHeader"
798
+ ],
799
+ [
800
+ "mmr_root",
801
+ "H256"
802
+ ]
803
+ ]
804
+ },
805
+ "Round": "u64",
806
+ "TcHeaderThingWithProof": "EthereumHeaderThingWithProof",
807
+ "TcHeaderThing": "EthereumHeaderThing",
808
+ "TcBlockNumber": "u64",
809
+ "TcHeaderHash": "H256",
810
+ "GameId": "TcBlockNumber",
811
+ "RelayProposalT": {
812
+ "type": "struct",
813
+ "type_mapping": [
814
+ [
815
+ "relayer",
816
+ "AccountId"
817
+ ],
818
+ [
819
+ "bonded_proposal",
820
+ "Vec<(Balance, TcHeaderThing)>"
821
+ ],
822
+ [
823
+ "extend_from_header_hash",
824
+ "Option<TcHeaderHash>"
825
+ ]
826
+ ]
827
+ }
828
+ }
829
+ },
830
+
831
+ {
832
+ "runtime_range": [
833
+ 23,
834
+ 30
835
+ ],
836
+ "types": {
837
+ "EthereumRelayProofs": {
838
+ "type": "struct",
839
+ "type_mapping": [
840
+ [
841
+ "ethash_proof",
842
+ "Vec<EthashProof>"
843
+ ],
844
+ [
845
+ "mmr_proof",
846
+ "Vec<H256>"
847
+ ]
848
+ ]
849
+ }
850
+ }
851
+ },
852
+
853
+ {
854
+ "runtime_range": [
855
+ 23,
856
+ 28
857
+ ],
858
+ "types": {
859
+ "EthereumRelayHeaderParcel": {
860
+ "type": "struct",
861
+ "type_mapping": [
862
+ [
863
+ "header",
864
+ "EthereumHeader"
865
+ ],
866
+ [
867
+ "mmr_root",
868
+ "H256"
869
+ ]
870
+ ]
871
+ }
872
+ }
873
+ },
874
+
875
+ {
876
+ "runtime_range": [
877
+ 23,
878
+ 23
879
+ ],
880
+ "types": {
881
+ "RelayHeaderId": "Vec<u8>",
882
+ "RelayHeaderParcel": "Vec<u8>",
883
+ "RelayAffirmationId": {
884
+ "type": "struct",
885
+ "type_mapping": [
886
+ [
887
+ "relay_header_id",
888
+ "Vec<u8>"
889
+ ],
890
+ [
891
+ "round",
892
+ "u32"
893
+ ],
894
+ [
895
+ "index",
896
+ "u32"
897
+ ]
898
+ ]
899
+ },
900
+ "RelayAffirmationT": {
901
+ "type": "struct",
902
+ "type_mapping": [
903
+ [
904
+ "relayer",
905
+ "AccountId"
906
+ ],
907
+ [
908
+ "relay_header_parcels",
909
+ "Vec<u8>"
910
+ ],
911
+ [
912
+ "bond",
913
+ "Balance"
914
+ ],
915
+ [
916
+ "maybe_extended_relay_affirmation_id",
917
+ "Option<Vec<u8>>"
918
+ ],
919
+ [
920
+ "verified",
921
+ "bool"
922
+ ]
923
+ ]
924
+ },
925
+ "RelayProofs": "Vec<u8>"
926
+ }
927
+ }
928
+ ]
929
+ }