scale.rb 0.2.17 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -228,7 +228,7 @@
228
228
  ]
229
229
  ]
230
230
  },
231
- "RefCount": "u8",
231
+ "RefCount": "u32",
232
232
  "Moment": "u64",
233
233
  "AccountData": {
234
234
  "type": "struct",
@@ -259,7 +259,7 @@
259
259
  "Index"
260
260
  ],
261
261
  [
262
- "refcount",
262
+ "c",
263
263
  "RefCount"
264
264
  ],
265
265
  [
@@ -0,0 +1,332 @@
1
+ {
2
+ "types": {
3
+ "BalanceLock": {
4
+ "type": "struct",
5
+ "type_mapping": [
6
+ ["id", "LockIdentifier"],
7
+ ["lock_for", "LockFor"],
8
+ ["lock_reasons", "LockReasons"],
9
+ ["amount", "Balance"],
10
+ ["reasons", "Reasons"]
11
+ ]
12
+ },
13
+ "LockFor": {
14
+ "type": "enum",
15
+ "type_mapping": [
16
+ ["Common", "Common"],
17
+ ["Staking", "StakingLock"]
18
+ ]
19
+ },
20
+ "Common": {
21
+ "type": "struct",
22
+ "type_mapping": [
23
+ ["amount", "Balance"]
24
+ ]
25
+ },
26
+ "StakingLock": {
27
+ "type": "struct",
28
+ "type_mapping": [
29
+ ["staking_amount", "Balance"],
30
+ ["unbondings", "Vec<Unbonding>"]
31
+ ]
32
+ },
33
+ "LockReasons": {
34
+ "type": "enum",
35
+ "type_mapping": [
36
+ ["Fee", "Null"],
37
+ ["Misc", "Null"],
38
+ ["All", "Null"]
39
+ ]
40
+ },
41
+ "Unbonding": {
42
+ "type": "struct",
43
+ "type_mapping": [
44
+ ["amount", "Balance"],
45
+ ["until", "BlockNumber"]
46
+ ]
47
+ },
48
+ "AccountData": {
49
+ "type": "struct",
50
+ "type_mapping": [
51
+ ["free", "Balance"],
52
+ ["reserved", "Balance"],
53
+ ["free_kton", "Balance"],
54
+ ["reserved_kton", "Balance"],
55
+ ["misc_frozen", "Balance"],
56
+ ["fee_frozen", "Balance"]
57
+ ]
58
+ },
59
+ "RingBalance": "Balance",
60
+ "KtonBalance": "Balance",
61
+ "TsInMs": "u64",
62
+ "Power": "u32",
63
+ "DepositId": "U256",
64
+ "StakingBalanceT": {
65
+ "type": "enum",
66
+ "type_mapping": [
67
+ ["RingBalance", "Balance"],
68
+ ["KtonBalance", "Balance"]
69
+ ]
70
+ },
71
+ "StakingLedgerT": {
72
+ "type": "struct",
73
+ "type_mapping": [
74
+ ["stash", "AccountId"],
75
+ ["active_ring", "Compact<Balance>"],
76
+ ["active_deposit_ring", "Compact<Balance>"],
77
+ ["active_kton", "Compact<Balance>"],
78
+ ["deposit_items", "Vec<TimeDepositItem>"],
79
+ ["ring_staking_lock", "StakingLock"],
80
+ ["kton_staking_lock", "StakingLock"],
81
+ ["claimed_rewards", "Vec<EraIndex>"],
82
+ ["total", "Compact<Balance>"],
83
+ ["active", "Compact<Balance>"],
84
+ ["unlocking", "Vec<UnlockChunk>"]
85
+ ]
86
+ },
87
+ "TimeDepositItem": {
88
+ "type": "struct",
89
+ "type_mapping": [
90
+ ["value", "Compact<Balance>"],
91
+ ["start_time", "Compact<TsInMs>"],
92
+ ["expire_time", "Compact<TsInMs>"]
93
+ ]
94
+ },
95
+ "ExposureT": {
96
+ "type": "struct",
97
+ "type_mapping": [
98
+ ["own_ring_balance", "Compact<Balance>"],
99
+ ["own_kton_balance", "Compact<Balance>"],
100
+ ["own_power", "Power"],
101
+ ["total_power", "Power"],
102
+ ["others", "Vec<IndividualExposure>"]
103
+ ]
104
+ },
105
+ "IndividualExposure": {
106
+ "type": "struct",
107
+ "type_mapping": [
108
+ ["who", "AccountId"],
109
+ ["ring_balance", "Compact<Balance>"],
110
+ ["kton_balance", "Compact<Balance>"],
111
+ ["power", "Power"],
112
+ ["value", "Compact<Balance>"]
113
+ ]
114
+ },
115
+ "ElectionResultT": {
116
+ "type": "struct",
117
+ "type_mapping": [
118
+ ["elected_stashes", "Vec<AccountId>"],
119
+ ["exposures", "Vec<(AccountId, ExposureT)>"],
120
+ ["compute", "ElectionCompute"]
121
+ ]
122
+ },
123
+ "RKT": {
124
+ "type": "struct",
125
+ "type_mapping": [
126
+ ["r", "Balance"],
127
+ ["k", "Balance"]
128
+ ]
129
+ },
130
+ "SpanRecord": {
131
+ "type": "struct",
132
+ "type_mapping": [
133
+ ["slashed", "RKT"],
134
+ ["paid_out", "RKT"]
135
+ ]
136
+ },
137
+ "UnappliedSlash": {
138
+ "type": "struct",
139
+ "type_mapping": [
140
+ ["validator", "AccountId"],
141
+ ["own", "RKT"],
142
+ ["others", "Vec<(AccountId, RKT)>"],
143
+ ["reporters", "Vec<AccountId>"],
144
+ ["payout", "RKT"]
145
+ ]
146
+ },
147
+ "TreasuryProposal": {
148
+ "type": "struct",
149
+ "type_mapping": [
150
+ ["proposer", "AccountId"],
151
+ ["beneficiary", "AccountId"],
152
+ ["ring_value", "Balance"],
153
+ ["kton_value", "Balance"],
154
+ ["ring_bond", "Balance"],
155
+ ["kton_bond", "Balance"]
156
+ ]
157
+ },
158
+ "MappedRing": "u128",
159
+ "EthereumTransactionIndex": "(H256, u64)",
160
+ "EthereumBlockNumber": "u64",
161
+ "EthereumHeader": {
162
+ "type": "struct",
163
+ "type_mapping": [
164
+ ["parent_hash", "H256"],
165
+ ["timestamp", "u64"],
166
+ ["number", "EthereumBlockNumber"],
167
+ ["author", "EthereumAddress"],
168
+ ["transactions_root", "H256"],
169
+ ["uncles_hash", "H256"],
170
+ ["extra_data", "Bytes"],
171
+ ["state_root", "H256"],
172
+ ["receipts_root", "H256"],
173
+ ["log_bloom", "Bloom"],
174
+ ["gas_used", "U256"],
175
+ ["gas_limit", "U256"],
176
+ ["difficulty", "U256"],
177
+ ["seal", "Vec<Bytes>"],
178
+ ["hash", "Option<H256>"]
179
+ ]
180
+ },
181
+ "EthereumAddress": "H160",
182
+ "EcdsaMessage": "[u8; 32]",
183
+ "Bloom": "[u8; 256]",
184
+ "H128": "[u8; 16]",
185
+ "EthashProof": {
186
+ "type": "struct",
187
+ "type_mapping": [
188
+ ["dag_nodes", "(H512, H512)"],
189
+ ["proof", "Vec<H128>"]
190
+ ]
191
+ },
192
+ "EthereumReceipt": {
193
+ "type": "struct",
194
+ "type_mapping": [
195
+ ["gas_used", "U256"],
196
+ ["log_bloom", "Bloom"],
197
+ ["logs", "Vec<LogEntry>"],
198
+ ["outcome", "TransactionOutcome"]
199
+ ]
200
+ },
201
+ "EthereumNetworkType": {
202
+ "type": "enum",
203
+ "type_mapping": [
204
+ ["Mainnet", "Null"],
205
+ ["Ropsten", "Null"]
206
+ ]
207
+ },
208
+ "RedeemFor": {
209
+ "type": "enum",
210
+ "type_mapping": [
211
+ ["Token", "Null"],
212
+ ["Deposit", "Null"]
213
+ ]
214
+ },
215
+ "EthereumReceiptProof": {
216
+ "type": "struct",
217
+ "type_mapping": [
218
+ ["index", "u64"],
219
+ ["proof", "Bytes"],
220
+ ["header_hash", "H256"]
221
+ ]
222
+ },
223
+ "EthereumReceiptProofThing": "(EthereumHeader, EthereumReceiptProof, MMRProof)",
224
+ "MMRProof": {
225
+ "type": "struct",
226
+ "type_mapping": [
227
+ ["member_leaf_index", "u64"],
228
+ ["last_leaf_index", "u64"],
229
+ ["proof", "Vec<H256>"]
230
+ ]
231
+ },
232
+ "EthereumRelayHeaderParcel": {
233
+ "type": "struct",
234
+ "type_mapping": [
235
+ ["header", "EthereumHeader"],
236
+ ["parent_mmr_root", "H256"]
237
+ ]
238
+ },
239
+ "EthereumRelayProofs": {
240
+ "type": "struct",
241
+ "type_mapping": [
242
+ ["ethash_proof", "Vec<EthashProof>"],
243
+ ["mmr_proof", "Vec<H256>"]
244
+ ]
245
+ },
246
+ "RelayAuthoritySigner": "EthereumAddress",
247
+ "RelayAuthorityMessage": "EcdsaMessage",
248
+ "RelayAuthoritySignature": "EcdsaSignature",
249
+ "OtherSignature": {
250
+ "type": "enum",
251
+ "type_mapping": [
252
+ ["Eth", "EcdsaSignature"],
253
+ ["Tron", "EcdsaSignature"]
254
+ ]
255
+ },
256
+ "EcdsaSignature": "[u8; 65]",
257
+ "OtherAddress": {
258
+ "type": "enum",
259
+ "type_mapping": [
260
+ ["Eth", "[u8; 20]"],
261
+ ["Tron", "[u8; 20]"]
262
+ ]
263
+ },
264
+ "AddressT": "[u8; 20]",
265
+ "MerkleMountainRangeRootLog": {
266
+ "type": "struct",
267
+ "type_mapping": [
268
+ ["prefix", "[u8; 4]"],
269
+ ["parent_mmr_root", "Hash"]
270
+ ]
271
+ },
272
+ "OpCode": "[u8; 4]",
273
+ "Term": "u32",
274
+ "RelayHeaderId": "EthereumBlockNumber",
275
+ "RelayHeaderParcel": "EthereumRelayHeaderParcel",
276
+ "RelayProofs": "EthereumRelayProofs",
277
+ "RelayAffirmationId": {
278
+ "type": "struct",
279
+ "type_mapping": [
280
+ ["game_id", "EthereumBlockNumber"],
281
+ ["round", "u32"],
282
+ ["index", "u32"]
283
+ ]
284
+ },
285
+ "RelayAffirmationT": {
286
+ "type": "struct",
287
+ "type_mapping": [
288
+ ["relayer", "AccountId"],
289
+ ["relay_header_parcels", "EthereumRelayHeaderParcel"],
290
+ ["bond", "Balance"],
291
+ ["maybe_extended_relay_affirmation_id", "Option<RelayAffirmationId>"],
292
+ ["verified", "bool"]
293
+ ]
294
+ },
295
+ "RelayVotingState": {
296
+ "type": "struct",
297
+ "type_mapping": [
298
+ ["ayes", "Vec<AccountId>"],
299
+ ["nays", "Vec<AccountId>"]
300
+ ]
301
+ },
302
+ "RelayAuthorityT": {
303
+ "type": "struct",
304
+ "type_mapping": [
305
+ ["account_id", "AccountId"],
306
+ ["signer", "Signer"],
307
+ ["stake", "Balance"],
308
+ ["term", "BlockNumber"]
309
+ ]
310
+ },
311
+ "ScheduledAuthoritiesChangeT": {
312
+ "type": "struct",
313
+ "type_mapping": [
314
+ ["next_authorities", "Vec<RelayAuthorityT>"],
315
+ ["deadline", "BlockNumber"]
316
+ ]
317
+ },
318
+ "MMRRoot": "Hash",
319
+ "BalancesRuntimeDispatchInfo": {
320
+ "type": "struct",
321
+ "type_mapping": [
322
+ ["usable_balance", "Balance"]
323
+ ]
324
+ },
325
+ "StakingRuntimeDispatchInfo": {
326
+ "type": "struct",
327
+ "type_mapping": [
328
+ ["power", "Power"]
329
+ ]
330
+ }
331
+ }
332
+ }
data/scale.gemspec CHANGED
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency "base58"
39
39
  spec.add_dependency "json", "~> 2.3.0"
40
40
  spec.add_dependency "faye-websocket"
41
+ spec.add_dependency "thor", '~> 1.0'
41
42
 
42
43
  spec.add_development_dependency "bundler"
43
44
  spec.add_development_dependency "pry"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scale.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wu Minzhe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-22 00:00:00.000000000 Z
11
+ date: 2021-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blake2b_rs
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: thor
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: bundler
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -153,7 +167,8 @@ dependencies:
153
167
  description: Ruby implementation of the parity SCALE data format
154
168
  email:
155
169
  - wuminzhe@gmail.com
156
- executables: []
170
+ executables:
171
+ - scale
157
172
  extensions: []
158
173
  extra_rdoc_files: []
159
174
  files:
@@ -170,6 +185,7 @@ files:
170
185
  - Rakefile
171
186
  - bin/console
172
187
  - bin/setup
188
+ - exe/scale
173
189
  - grants_badge.png
174
190
  - lib/address.rb
175
191
  - lib/common.rb
@@ -198,15 +214,10 @@ files:
198
214
  - lib/type_registry/crab.json
199
215
  - lib/type_registry/darwinia.json
200
216
  - lib/type_registry/default.json
201
- - lib/type_registry/edgeware.json
202
- - lib/type_registry/joystream.json
203
- - lib/type_registry/kulupu.json
204
217
  - lib/type_registry/kusama.json
205
- - lib/type_registry/plasm.json
218
+ - lib/type_registry/pangolin.json
206
219
  - lib/type_registry/polkadot.json
207
- - lib/type_registry/robonomics.json
208
220
  - lib/type_registry/test.json
209
- - lib/type_registry/westend.json
210
221
  - scale.gemspec
211
222
  - scripts/block_events.rb
212
223
  - scripts/example.rb
@@ -1,124 +0,0 @@
1
- {
2
- "runtime_id": 27,
3
- "types": {
4
- "Keys": {
5
- "type": "struct",
6
- "type_mapping": [
7
- ["grandpa", "AccountId"],
8
- ["babe", "AccountId"],
9
- ["im_online", "AccountId"],
10
- ["authority_discovery", "AccountId"]
11
- ]
12
- },
13
- "BlockNumber": "U32",
14
- "SessionIndex": "U32",
15
- "AuctionIndex": "U32",
16
- "AuthIndex": "U32",
17
- "BalanceUpload": "(AccountId, u64)",
18
- "EgressQueueRoot": "(ParaId, Hash)",
19
- "EventIndex": "u32",
20
- "LeasePeriodOf": "LeasePeriod",
21
- "LeasePeriod": "BlockNumber",
22
- "MemberCount": "u32",
23
- "MomentOf": "Moment",
24
- "Offender": "(ValidatorId, Exposure)",
25
- "ReportIdOf": "Hash",
26
- "SubId": "u32",
27
- "Weight": "u32",
28
- "WeightMultiplier": "u64",
29
- "WinningData": "Vec<WinningDataEntry>",
30
- "Index": "U32",
31
- "Kind": "[u8; 16]",
32
- "OpaqueTimeSlot": "Bytes",
33
- "Box<<T as Trait<I>>::Proposal>": "BoxProposal",
34
- "Forcing": {
35
- "type": "enum",
36
- "value_list": [
37
- "NotForcing",
38
- "ForceNew",
39
- "ForceNone"
40
- ]
41
- },
42
- "VoteData": {
43
- "type": "struct",
44
- "type_mapping": [
45
- ["initiator", "AccountId"],
46
- ["stage", "VoteStage"],
47
- ["vote_type", "VoteType"],
48
- ["tally_type", "TallyType"],
49
- ["is_commit_reveal", "Bool"]
50
- ]
51
- },
52
- "VoteRecord": {
53
- "type": "struct",
54
- "type_mapping": [
55
- ["id", "u64"],
56
- ["commitments", "Vec<(AccountId, VoteOutcome)>"],
57
- ["reveals", "Vec<(AccountId, VoteOutcome)>"],
58
- ["data", "VoteData"],
59
- ["outcomes", "Vec<(VoteOutcome)>"]
60
- ]
61
- },
62
- "VoteType": {
63
- "type": "enum",
64
- "value_list": ["Binary", "MultiOption"]
65
- },
66
- "IdentityStage": {
67
- "type": "enum",
68
- "value_list": ["Registered", "Attested", "Verified"]
69
- },
70
- "IdentityRecord": {
71
- "type": "struct",
72
- "type_mapping": [
73
- ["account", "AccountId"],
74
- ["identity_type", "String"],
75
- ["identity", "Bytes"],
76
- ["stage", "IdentityStage"],
77
- ["expiration_time", "BlockNumber"],
78
- ["proof", "Bytes"],
79
- ["metadata", "Bytes"]
80
- ]
81
- },
82
- "MetadataRecord": {
83
- "type": "struct",
84
- "type_mapping": [
85
- ["avatar", "String"],
86
- ["display_name", "String"],
87
- ["tagline", "String"]
88
- ]
89
- },
90
- "ProposalCategory": {
91
- "type": "enum",
92
- "value_list": ["Signaling"]
93
- },
94
- "ProposalStage": {
95
- "type": "enum",
96
- "value_list": ["PreVoting", "Voting", "Completed"]
97
- },
98
- "ProposalRecord": {
99
- "type": "struct",
100
- "type_mapping": [
101
- ["index", "u32"],
102
- ["author", "AccountId"],
103
- ["stage", "ProposalStage"],
104
- ["transition_time", "BlockNumber"],
105
- ["category", "ProposalCategory"],
106
- ["title", "Vec<u8>"],
107
- ["contents", "Vec<u8>"],
108
- ["vote_id", "u64"],
109
- ["ProposalTitle", "Vec<u8>"],
110
- ["ProposalContents", "Vec<u8>"]
111
- ]
112
- },
113
- "Balance2": "Balance",
114
- "ReferendumInfo<BlockNumber, Proposal>": {
115
- "type": "struct",
116
- "type_mapping": [
117
- ["end", "BlockNumber"],
118
- ["proposal", "Proposal"],
119
- ["threshold", "VoteThreshold"],
120
- ["delay", "BlockNumber"]
121
- ]
122
- }
123
- }
124
- }