scale.rb 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/scale/version.rb +1 -1
- data/lib/type_registry/darwinia.json +246 -65
- metadata +2 -3
- data/lib/type_registry/certifybook-chain.json +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a2cf612b6cd7c832ee28aec4da8fcec7ebeac8dc393ba1af41b1aecd96aa484
|
4
|
+
data.tar.gz: 2035bde19211e78f604fcdd51a95cb3b653fc278024326787545655fa09b88da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1e10fd308c6f38525a2150e2bba0da42966e3c67dd9ca5f299133fd16a1c59e4988fb33841b194b3437bdae71f3dbea43cd2e4102e39f24b0bb7de9fd54f6dd
|
7
|
+
data.tar.gz: fadad4fd7fd8ba14f02574bc594e2cc815b905fc75008f0735f38ba2381b87aff8ec7e2f5fa1b878e9d7658b88e34d861ccb8481fa82e5369c0bfb68af154d5a
|
data/.DS_Store
CHANGED
Binary file
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@ This is a SCALE codec library implemented in ruby language for general use. It c
|
|
10
10
|
|
11
11
|
This work is the prerequisite of our subsequent series of projects. We hope to familiarize and quickly access Polkadot and Substrate through ruby. We plan to develop the back end of our applications in ruby language, and then interact with nodes or synchronize data through this library.
|
12
12
|
|
13
|
-
Please refer to the [official doc](https://substrate.dev/docs/en/
|
13
|
+
Please refer to the [official doc](https://substrate.dev/docs/en/knowledgebase/advanced/codec) for more details about SCALE low-level data format.
|
14
14
|
|
15
15
|
Because the feature of ruby 2.6 is used, the ruby version is required to be >= 2.6. it will be compatible with older ruby versions when released.
|
16
16
|
|
data/lib/scale/version.rb
CHANGED
@@ -1,119 +1,300 @@
|
|
1
1
|
{
|
2
2
|
"types": {
|
3
|
-
"
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"RingBalanceOf": "u128",
|
7
|
-
"KtonBalanceOf": "u128",
|
8
|
-
"ExtendedBalance": "u128",
|
9
|
-
"Keys": {
|
3
|
+
"Address": "AccountId",
|
4
|
+
"LookupSource": "AccountId",
|
5
|
+
"BalanceLock": {
|
10
6
|
"type": "struct",
|
11
7
|
"type_mapping": [
|
12
|
-
|
13
|
-
|
8
|
+
["id", "LockIdentifier"],
|
9
|
+
["lock_for", "LockFor"],
|
10
|
+
["lock_reasons", "LockReasons"]
|
14
11
|
]
|
15
12
|
},
|
16
|
-
"
|
17
|
-
"StakingBalance": {
|
13
|
+
"LockFor": {
|
18
14
|
"type": "enum",
|
19
15
|
"type_mapping": [
|
20
|
-
|
21
|
-
|
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
|
+
]
|
56
|
+
},
|
57
|
+
"RingBalance": "Balance",
|
58
|
+
"KtonBalance": "Balance",
|
59
|
+
"TsInMs": "u64",
|
60
|
+
"Power": "u32",
|
61
|
+
"DepositId": "U256",
|
62
|
+
"StakingBalanceT": {
|
63
|
+
"type": "enum",
|
64
|
+
"type_mapping": [
|
65
|
+
["RingBalance", "Balance"],
|
66
|
+
["KtonBalance", "Balance"]
|
67
|
+
]
|
68
|
+
},
|
69
|
+
"StakingLedgerT": {
|
70
|
+
"type": "struct",
|
71
|
+
"type_mapping": [
|
72
|
+
["stash", "AccountId"],
|
73
|
+
["active_ring", "Compact<Balance>"],
|
74
|
+
["active_deposit_ring", "Compact<Balance>"],
|
75
|
+
["active_kton", "Compact<Balance>"],
|
76
|
+
["deposit_items", "Vec<TimeDepositItem>"],
|
77
|
+
["ring_staking_lock", "StakingLock"],
|
78
|
+
["kton_staking_lock", "StakingLock"],
|
79
|
+
["claimed_rewards", "Vec<EraIndex>"]
|
22
80
|
]
|
23
81
|
},
|
24
82
|
"TimeDepositItem": {
|
25
83
|
"type": "struct",
|
26
84
|
"type_mapping": [
|
27
|
-
|
28
|
-
|
29
|
-
|
85
|
+
["value", "Compact<Balance>"],
|
86
|
+
["start_time", "Compact<TsInMs>"],
|
87
|
+
["expire_time", "Compact<TsInMs>"]
|
88
|
+
]
|
89
|
+
},
|
90
|
+
"ExposureT": {
|
91
|
+
"type": "struct",
|
92
|
+
"type_mapping": [
|
93
|
+
["own_ring_balance", "Compact<Balance>"],
|
94
|
+
["own_kton_balance", "Compact<Balance>"],
|
95
|
+
["own_power", "Power"],
|
96
|
+
["total_power", "Power"],
|
97
|
+
["others", "Vec<IndividualExposure>"]
|
30
98
|
]
|
31
99
|
},
|
32
|
-
"
|
100
|
+
"IndividualExposure": {
|
33
101
|
"type": "struct",
|
34
102
|
"type_mapping": [
|
35
|
-
|
36
|
-
|
37
|
-
|
103
|
+
["who", "AccountId"],
|
104
|
+
["ring_balance", "Compact<Balance>"],
|
105
|
+
["kton_balance", "Compact<Balance>"],
|
106
|
+
["power", "Power"]
|
38
107
|
]
|
39
108
|
},
|
40
|
-
"
|
109
|
+
"ElectionResultT": {
|
41
110
|
"type": "struct",
|
42
111
|
"type_mapping": [
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
["active_ring", "Compact<RingBalanceOf>"],
|
47
|
-
["active_deposit_ring", "Compact<RingBalanceOf>"],
|
48
|
-
["total_kton", "Compact<KtonBalanceOf>"],
|
49
|
-
["active_kton", "Compact<KtonBalanceOf>"],
|
50
|
-
["deposit_items", "Vec<TimeDepositItem>"],
|
51
|
-
["unlocking", "Vec<UnlockChunk>"]
|
112
|
+
["elected_stashes", "Vec<AccountId>"],
|
113
|
+
["exposures", "Vec<(AccountId, ExposureT)>"],
|
114
|
+
["compute", "ElectionCompute"]
|
52
115
|
]
|
53
116
|
},
|
54
|
-
"
|
117
|
+
"RKT": {
|
55
118
|
"type": "struct",
|
56
119
|
"type_mapping": [
|
57
|
-
|
58
|
-
|
120
|
+
["r", "Balance"],
|
121
|
+
["k", "Balance"]
|
59
122
|
]
|
60
123
|
},
|
61
|
-
"
|
124
|
+
"SpanRecord": {
|
62
125
|
"type": "struct",
|
63
126
|
"type_mapping": [
|
64
|
-
|
65
|
-
|
66
|
-
["others", "Vec<IndividualExpo>"]
|
127
|
+
["slashed", "RKT"],
|
128
|
+
["paid_out", "RKT"]
|
67
129
|
]
|
68
130
|
},
|
69
|
-
"
|
70
|
-
"Currency": "u128",
|
71
|
-
"CurrencyOf": "u128",
|
72
|
-
"Auction": {
|
131
|
+
"UnappliedSlash": {
|
73
132
|
"type": "struct",
|
74
133
|
"type_mapping": [
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
["lastRecord", "TokenBalance"],
|
81
|
-
["lastBidder", "AccountId"],
|
82
|
-
["lastBidStartAt", "Moment"]
|
134
|
+
["validator", "AccountId"],
|
135
|
+
["own", "RKT"],
|
136
|
+
["others", "Vec<(AccountId, RKT)>"],
|
137
|
+
["reporters", "Vec<AccountId>"],
|
138
|
+
["payout", "RKT"]
|
83
139
|
]
|
84
140
|
},
|
85
|
-
"
|
141
|
+
"TreasuryProposal": {
|
86
142
|
"type": "struct",
|
87
143
|
"type_mapping": [
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
144
|
+
["proposer", "AccountId"],
|
145
|
+
["beneficiary", "AccountId"],
|
146
|
+
["ring_value", "Balance"],
|
147
|
+
["kton_value", "Balance"],
|
148
|
+
["ring_bond", "Balance"],
|
149
|
+
["kton_bond", "Balance"]
|
93
150
|
]
|
94
151
|
},
|
95
|
-
"
|
152
|
+
"MappedRing": "u128",
|
153
|
+
"EthereumTransactionIndex": "(H256, u64)",
|
154
|
+
"EthereumHeaderBrief": {
|
96
155
|
"type": "struct",
|
97
156
|
"type_mapping": [
|
98
|
-
|
99
|
-
|
157
|
+
["total_difficulty", "U256"],
|
158
|
+
["parent_hash", "H256"],
|
159
|
+
["number", "EthereumBlockNumber"],
|
160
|
+
["relayer", "AccountId"]
|
100
161
|
]
|
101
162
|
},
|
102
|
-
"
|
163
|
+
"EthereumBlockNumber": "u64",
|
164
|
+
"EthereumHeaderThingWithProof": {
|
103
165
|
"type": "struct",
|
104
166
|
"type_mapping": [
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
167
|
+
["header", "EthereumHeader"],
|
168
|
+
["ethash_proof", "Vec<EthashProof>"],
|
169
|
+
["mmr_root", "H256"],
|
170
|
+
["mmr_proof", "Vec<H256>"]
|
109
171
|
]
|
110
172
|
},
|
111
|
-
"
|
173
|
+
"EthereumHeaderThing": {
|
112
174
|
"type": "struct",
|
113
175
|
"type_mapping": [
|
114
|
-
["
|
176
|
+
["header", "EthereumHeader"],
|
177
|
+
["mmr_root", "H256"]
|
178
|
+
]
|
179
|
+
},
|
180
|
+
"EthereumHeader": {
|
181
|
+
"type": "struct",
|
182
|
+
"type_mapping": [
|
183
|
+
["parent_hash", "H256"],
|
184
|
+
["timestamp", "u64"],
|
185
|
+
["number", "EthereumBlockNumber"],
|
186
|
+
["author", "EthereumAddress"],
|
187
|
+
["transactions_root", "H256"],
|
188
|
+
["uncles_hash", "H256"],
|
189
|
+
["extra_data", "Bytes"],
|
190
|
+
["state_root", "H256"],
|
191
|
+
["receipts_root", "H256"],
|
192
|
+
["log_bloom", "Bloom"],
|
193
|
+
["gas_used", "U256"],
|
194
|
+
["gas_limit", "U256"],
|
195
|
+
["difficulty", "U256"],
|
196
|
+
["seal", "Vec<Bytes>"],
|
197
|
+
["hash", "Option<H256>"]
|
198
|
+
]
|
199
|
+
},
|
200
|
+
"EthereumAddress": "H160",
|
201
|
+
"Bloom": "[u8; 256]",
|
202
|
+
"H128": "[u8; 16]",
|
203
|
+
"EthashProof": {
|
204
|
+
"type": "struct",
|
205
|
+
"type_mapping": [
|
206
|
+
["dag_nodes", "(H512, H512)"],
|
115
207
|
["proof", "Vec<H128>"]
|
116
208
|
]
|
209
|
+
},
|
210
|
+
"EthereumReceipt": {
|
211
|
+
"type": "struct",
|
212
|
+
"type_mapping": [
|
213
|
+
["gas_used", "U256"],
|
214
|
+
["log_bloom", "Bloom"],
|
215
|
+
["logs", "Vec<LogEntry>"],
|
216
|
+
["outcome", "TransactionOutcome"]
|
217
|
+
]
|
218
|
+
},
|
219
|
+
"EthereumNetworkType": {
|
220
|
+
"type": "enum",
|
221
|
+
"type_mapping": [
|
222
|
+
["Mainnet", "Null"],
|
223
|
+
["Ropsten", "Null"]
|
224
|
+
]
|
225
|
+
},
|
226
|
+
"RedeemFor": {
|
227
|
+
"type": "enum",
|
228
|
+
"type_mapping": [
|
229
|
+
["Token", "Null"],
|
230
|
+
["Deposit", "Null"]
|
231
|
+
]
|
232
|
+
},
|
233
|
+
"EthereumReceiptProof": {
|
234
|
+
"type": "struct",
|
235
|
+
"type_mapping": [
|
236
|
+
["index", "u64"],
|
237
|
+
["proof", "Bytes"],
|
238
|
+
["header_hash", "H256"]
|
239
|
+
]
|
240
|
+
},
|
241
|
+
"EthereumReceiptProofThing": "(EthereumHeader, EthereumReceiptProof, MMRProof)",
|
242
|
+
"MMRProof": {
|
243
|
+
"type": "struct",
|
244
|
+
"type_mapping": [
|
245
|
+
["member_leaf_index", "u64"],
|
246
|
+
["last_leaf_index", "u64"],
|
247
|
+
["proof", "Vec<H256>"]
|
248
|
+
]
|
249
|
+
},
|
250
|
+
"OtherSignature": {
|
251
|
+
"type": "enum",
|
252
|
+
"type_mapping": [
|
253
|
+
["Eth", "EcdsaSignature"],
|
254
|
+
["Tron", "EcdsaSignature"]
|
255
|
+
]
|
256
|
+
},
|
257
|
+
"EcdsaSignature": "[u8; 65]",
|
258
|
+
"OtherAddress": {
|
259
|
+
"type": "enum",
|
260
|
+
"type_mapping": [
|
261
|
+
["Eth", "[u8; 20]"],
|
262
|
+
["Tron", "[u8; 20]"]
|
263
|
+
]
|
264
|
+
},
|
265
|
+
"AddressT": "[u8; 20]",
|
266
|
+
"MerkleMountainRangeRootLog": {
|
267
|
+
"type": "struct",
|
268
|
+
"type_mapping": [
|
269
|
+
["prefix", "[u8; 4]"],
|
270
|
+
["mmr_root", "Hash"]
|
271
|
+
]
|
272
|
+
},
|
273
|
+
"Round": "u64",
|
274
|
+
"TcHeaderThingWithProof": "EthereumHeaderThingWithProof",
|
275
|
+
"TcHeaderThing": "EthereumHeaderThing",
|
276
|
+
"TcBlockNumber": "u64",
|
277
|
+
"TcHeaderHash": "H256",
|
278
|
+
"GameId": "TcBlockNumber",
|
279
|
+
"RelayProposalT": {
|
280
|
+
"type": "struct",
|
281
|
+
"type_mapping": [
|
282
|
+
["relayer", "AccountId"],
|
283
|
+
["bonded_proposal", "Vec<(Balance, TcHeaderThing)>"],
|
284
|
+
["extend_from_header_hash", "Option<TcHeaderHash>"]
|
285
|
+
]
|
286
|
+
},
|
287
|
+
"BalancesRuntimeDispatchInfo": {
|
288
|
+
"type": "struct",
|
289
|
+
"type_mapping": [
|
290
|
+
["usable_balance", "Balance"]
|
291
|
+
]
|
292
|
+
},
|
293
|
+
"StakingRuntimeDispatchInfo": {
|
294
|
+
"type": "struct",
|
295
|
+
"type_mapping": [
|
296
|
+
["power", "Power"]
|
297
|
+
]
|
117
298
|
}
|
118
299
|
}
|
119
300
|
}
|
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.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wu Minzhe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: substrate_common.rb
|
@@ -179,7 +179,6 @@ files:
|
|
179
179
|
- lib/scale/block.rb
|
180
180
|
- lib/scale/types.rb
|
181
181
|
- lib/scale/version.rb
|
182
|
-
- lib/type_registry/certifybook-chain.json
|
183
182
|
- lib/type_registry/darwinia.json
|
184
183
|
- lib/type_registry/default.json
|
185
184
|
- lib/type_registry/edgeware.json
|