scale.rb 0.2.14 → 0.2.15
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Cargo.lock +2007 -11
- data/Cargo.toml +9 -2
- data/Gemfile.lock +15 -9
- data/exe/scale +9 -0
- data/lib/helper.rb +126 -0
- data/lib/metadata/metadata.rb +14 -0
- data/lib/scale.rb +25 -9
- data/lib/scale/base.rb +5 -8
- data/lib/scale/block.rb +11 -25
- data/lib/scale/types.rb +18 -0
- data/lib/scale/version.rb +1 -1
- data/lib/substrate_client.rb +159 -0
- data/lib/type_registry/{crab-28.json → crab.json} +394 -127
- data/lib/type_registry/darwinia.json +701 -136
- data/scale.gemspec +3 -2
- data/scripts/block_events.rb +2 -3
- data/src/lib.rs +42 -1
- data/src/storage_key.rs +41 -0
- metadata +30 -15
- data/.DS_Store +0 -0
- data/lib/type_registry/darwinia-8.json +0 -662
data/scale.gemspec
CHANGED
|
@@ -33,10 +33,11 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
34
34
|
spec.require_paths = ["lib"]
|
|
35
35
|
|
|
36
|
-
spec.add_dependency "substrate_common.rb", "~> 0.1.
|
|
36
|
+
spec.add_dependency "substrate_common.rb", "~> 0.1.10"
|
|
37
|
+
spec.add_dependency "activesupport", "~> 6.0.0"
|
|
37
38
|
spec.add_dependency "json", "~> 2.3.0"
|
|
38
|
-
spec.add_dependency "activesupport", ">= 4.0.0"
|
|
39
39
|
spec.add_dependency "thor", "~> 0.19.0"
|
|
40
|
+
spec.add_dependency "kontena-websocket-client", "~> 0.1.1"
|
|
40
41
|
|
|
41
42
|
spec.add_development_dependency "bundler", "~> 1.17"
|
|
42
43
|
spec.add_development_dependency "pry"
|
data/scripts/block_events.rb
CHANGED
|
@@ -2,7 +2,6 @@ require "scale"
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
client = SubstrateClient.new("ws://127.0.0.1:9944/")
|
|
5
|
-
client.init
|
|
6
5
|
metadata = client.get_metadata nil
|
|
7
6
|
|
|
8
7
|
the_module = metadata.get_module("CertificateModule")
|
|
@@ -23,7 +22,7 @@ puts "CertificateModule storages:"
|
|
|
23
22
|
puts "---------------------------------------"
|
|
24
23
|
puts the_module[:storage][:items]
|
|
25
24
|
|
|
26
|
-
# Scale::TypeRegistry.instance.metadata = metadata
|
|
25
|
+
# Scale::TypeRegistry.instance.metadata = metadata
|
|
27
26
|
# puts metadata.value.event_index["0400"][1]
|
|
28
27
|
# puts metadata.value.event_index["0401"][1]
|
|
29
28
|
# puts metadata.value.event_index["0402"][1]
|
|
@@ -31,4 +30,4 @@ puts the_module[:storage][:items]
|
|
|
31
30
|
# scale_bytes = Scale::Bytes.new(hex_events)
|
|
32
31
|
# Scale::Types.get("Vec<EventRecord>").decode(scale_bytes).value.each do |er|
|
|
33
32
|
# puts er.value
|
|
34
|
-
# end
|
|
33
|
+
# end
|
data/src/lib.rs
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
extern crate parity_scale_codec;
|
|
2
2
|
use std::slice;
|
|
3
|
-
use parity_scale_codec::{Decode};
|
|
3
|
+
use parity_scale_codec::{Encode, Decode};
|
|
4
|
+
use frame_support::Twox128;
|
|
5
|
+
use frame_support::Blake2_128Concat;
|
|
6
|
+
use frame_support::StorageHasher;
|
|
7
|
+
|
|
8
|
+
fn to_u8_vec(v_pointer: *const u8, len: usize) -> Vec<u8> {
|
|
9
|
+
let data_slice = unsafe {
|
|
10
|
+
assert!(!v_pointer.is_null());
|
|
11
|
+
slice::from_raw_parts(v_pointer, len)
|
|
12
|
+
};
|
|
13
|
+
data_slice.to_vec()
|
|
14
|
+
}
|
|
4
15
|
|
|
5
16
|
fn decode_from_raw_parts<T: Decode + PartialEq + std::fmt::Debug>(v_pointer: *const u8, len: usize) -> T {
|
|
6
17
|
let data_slice = unsafe {
|
|
@@ -49,6 +60,36 @@ pub extern fn parse_opt_bool(v_pointer: *const u8, len: usize, inner_value: bool
|
|
|
49
60
|
assert_eq!(decode_from_raw_parts::<Option<bool>>(v_pointer, len), expectation);
|
|
50
61
|
}
|
|
51
62
|
|
|
63
|
+
#[no_mangle]
|
|
64
|
+
pub extern fn assert_storage_key_for_value(
|
|
65
|
+
mv_pointer: *const u8, mv_len: usize,
|
|
66
|
+
sv_pointer: *const u8, sv_len: usize,
|
|
67
|
+
ev_pointer: *const u8, ev_len: usize
|
|
68
|
+
) {
|
|
69
|
+
let m = to_u8_vec(mv_pointer, mv_len);
|
|
70
|
+
let s = to_u8_vec(sv_pointer, sv_len);
|
|
71
|
+
let e = to_u8_vec(ev_pointer, ev_len);
|
|
72
|
+
|
|
73
|
+
let k = [Twox128::hash(&m), Twox128::hash(&s)].concat();
|
|
74
|
+
assert_eq!(k, e);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#[no_mangle]
|
|
78
|
+
pub extern fn assert_storage_key_for_map_black2128concat(
|
|
79
|
+
mv_pointer: *const u8, mv_len: usize,
|
|
80
|
+
sv_pointer: *const u8, sv_len: usize,
|
|
81
|
+
pv_pointer: *const u8, pv_len: usize,
|
|
82
|
+
ev_pointer: *const u8, ev_len: usize,
|
|
83
|
+
) {
|
|
84
|
+
let m = to_u8_vec(mv_pointer, mv_len);
|
|
85
|
+
let s = to_u8_vec(sv_pointer, sv_len);
|
|
86
|
+
let p = to_u8_vec(pv_pointer, pv_len);
|
|
87
|
+
let e = to_u8_vec(ev_pointer, ev_len);
|
|
88
|
+
let mut k = [Twox128::hash(&m), Twox128::hash(&s)].concat();
|
|
89
|
+
k.extend(p.using_encoded(Blake2_128Concat::hash));
|
|
90
|
+
assert_eq!(k, e);
|
|
91
|
+
}
|
|
92
|
+
|
|
52
93
|
#[test]
|
|
53
94
|
fn opt_bool_is_broken()
|
|
54
95
|
{
|
data/src/storage_key.rs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
use frame_support::Twox128;
|
|
2
|
+
use parity_scale_codec::Encode;
|
|
3
|
+
use frame_support::{Identity, Blake2_128Concat, Twox64Concat};
|
|
4
|
+
use frame_support::StorageHasher;
|
|
5
|
+
|
|
6
|
+
pub fn to_hex_string(bytes: Vec<u8>) -> String {
|
|
7
|
+
let strs: Vec<String> = bytes.iter()
|
|
8
|
+
.map(|b| format!("{:02x}", b))
|
|
9
|
+
.collect();
|
|
10
|
+
strs.join("")
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fn main() {
|
|
14
|
+
// value
|
|
15
|
+
let k = [Twox128::hash(b"Sudo"), Twox128::hash(b"Key")].concat();
|
|
16
|
+
println!("{}", to_hex_string(k));
|
|
17
|
+
|
|
18
|
+
// map
|
|
19
|
+
let mut k = [Twox128::hash(b"ModuleAbc"), Twox128::hash(b"Map1")].concat();
|
|
20
|
+
k.extend(vec![1u8, 0, 0, 0].using_encoded(Blake2_128Concat::hash));
|
|
21
|
+
println!("{}", to_hex_string(k));
|
|
22
|
+
|
|
23
|
+
let mut k = [Twox128::hash(b"ModuleAbc"), Twox128::hash(b"Map2")].concat();
|
|
24
|
+
k.extend(1u32.using_encoded(Twox64Concat::hash));
|
|
25
|
+
println!("{}", to_hex_string(k));
|
|
26
|
+
|
|
27
|
+
let mut k = [Twox128::hash(b"ModuleAbc"), Twox128::hash(b"Map3")].concat();
|
|
28
|
+
k.extend(1u32.using_encoded(Identity::hash));
|
|
29
|
+
println!("{}", to_hex_string(k));
|
|
30
|
+
|
|
31
|
+
// double map
|
|
32
|
+
let mut k = [Twox128::hash(b"ModuleAbc"), Twox128::hash(b"DoubleMap1")].concat();
|
|
33
|
+
k.extend(1u32.using_encoded(Blake2_128Concat::hash));
|
|
34
|
+
k.extend(2u32.using_encoded(Blake2_128Concat::hash));
|
|
35
|
+
println!("{}", to_hex_string(k));
|
|
36
|
+
|
|
37
|
+
let mut k = [Twox128::hash(b"ModuleAbc"), Twox128::hash(b"DoubleMap2")].concat();
|
|
38
|
+
k.extend(1u32.using_encoded(Blake2_128Concat::hash));
|
|
39
|
+
k.extend(2u32.using_encoded(Twox64Concat::hash));
|
|
40
|
+
println!("{}", to_hex_string(k));
|
|
41
|
+
}
|
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.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Wu Minzhe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-02-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: substrate_common.rb
|
|
@@ -16,42 +16,42 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.1.
|
|
19
|
+
version: 0.1.10
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.1.
|
|
26
|
+
version: 0.1.10
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: activesupport
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 6.0.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: 6.0.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: json
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: 2.3.0
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
54
|
+
version: 2.3.0
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: thor
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,6 +66,20 @@ dependencies:
|
|
|
66
66
|
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: 0.19.0
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: kontena-websocket-client
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 0.1.1
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 0.1.1
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
84
|
name: bundler
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -144,7 +158,6 @@ executables:
|
|
|
144
158
|
extensions: []
|
|
145
159
|
extra_rdoc_files: []
|
|
146
160
|
files:
|
|
147
|
-
- ".DS_Store"
|
|
148
161
|
- ".dockerignore"
|
|
149
162
|
- ".gitignore"
|
|
150
163
|
- Cargo.lock
|
|
@@ -160,6 +173,7 @@ files:
|
|
|
160
173
|
- bin/setup
|
|
161
174
|
- exe/scale
|
|
162
175
|
- grants_badge.png
|
|
176
|
+
- lib/helper.rb
|
|
163
177
|
- lib/metadata/metadata.rb
|
|
164
178
|
- lib/metadata/metadata_v0.rb
|
|
165
179
|
- lib/metadata/metadata_v1.rb
|
|
@@ -180,8 +194,8 @@ files:
|
|
|
180
194
|
- lib/scale/trie.rb
|
|
181
195
|
- lib/scale/types.rb
|
|
182
196
|
- lib/scale/version.rb
|
|
183
|
-
- lib/
|
|
184
|
-
- lib/type_registry/
|
|
197
|
+
- lib/substrate_client.rb
|
|
198
|
+
- lib/type_registry/crab.json
|
|
185
199
|
- lib/type_registry/darwinia.json
|
|
186
200
|
- lib/type_registry/default.json
|
|
187
201
|
- lib/type_registry/edgeware.json
|
|
@@ -197,6 +211,7 @@ files:
|
|
|
197
211
|
- scripts/block_events.rb
|
|
198
212
|
- scripts/example.rb
|
|
199
213
|
- src/lib.rs
|
|
214
|
+
- src/storage_key.rs
|
|
200
215
|
homepage: https://github.com/itering/scale.rb
|
|
201
216
|
licenses:
|
|
202
217
|
- MIT
|
data/.DS_Store
DELETED
|
Binary file
|
|
@@ -1,662 +0,0 @@
|
|
|
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
|
-
"EthereumRelayHeaderParcel": {
|
|
490
|
-
"type": "struct",
|
|
491
|
-
"type_mapping": [
|
|
492
|
-
[
|
|
493
|
-
"header",
|
|
494
|
-
"EthereumHeader"
|
|
495
|
-
],
|
|
496
|
-
[
|
|
497
|
-
"mmr_root",
|
|
498
|
-
"H256"
|
|
499
|
-
]
|
|
500
|
-
]
|
|
501
|
-
},
|
|
502
|
-
"EthereumRelayProofs": {
|
|
503
|
-
"type": "struct",
|
|
504
|
-
"type_mapping": [
|
|
505
|
-
[
|
|
506
|
-
"ethash_proof",
|
|
507
|
-
"Vec<EthashProof>"
|
|
508
|
-
],
|
|
509
|
-
[
|
|
510
|
-
"mmr_proof",
|
|
511
|
-
"Vec<H256>"
|
|
512
|
-
]
|
|
513
|
-
]
|
|
514
|
-
},
|
|
515
|
-
"OtherSignature": {
|
|
516
|
-
"type": "enum",
|
|
517
|
-
"type_mapping": [
|
|
518
|
-
[
|
|
519
|
-
"Eth",
|
|
520
|
-
"EcdsaSignature"
|
|
521
|
-
],
|
|
522
|
-
[
|
|
523
|
-
"Tron",
|
|
524
|
-
"EcdsaSignature"
|
|
525
|
-
]
|
|
526
|
-
]
|
|
527
|
-
},
|
|
528
|
-
"EcdsaSignature": "[u8; 65]",
|
|
529
|
-
"OtherAddress": {
|
|
530
|
-
"type": "enum",
|
|
531
|
-
"type_mapping": [
|
|
532
|
-
[
|
|
533
|
-
"Eth",
|
|
534
|
-
"[u8; 20]"
|
|
535
|
-
],
|
|
536
|
-
[
|
|
537
|
-
"Tron",
|
|
538
|
-
"[u8; 20]"
|
|
539
|
-
]
|
|
540
|
-
]
|
|
541
|
-
},
|
|
542
|
-
"AddressT": "[u8; 20]",
|
|
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
|
-
"RelayHeaderId": "EthereumBlockNumber",
|
|
557
|
-
"RelayHeaderParcel": "EthereumRelayHeaderParcel",
|
|
558
|
-
"RelayProofs": "EthereumRelayProofs",
|
|
559
|
-
"RelayAffirmationId": {
|
|
560
|
-
"type": "struct",
|
|
561
|
-
"type_mapping": [
|
|
562
|
-
[
|
|
563
|
-
"game_id",
|
|
564
|
-
"EthereumBlockNumber"
|
|
565
|
-
],
|
|
566
|
-
[
|
|
567
|
-
"round",
|
|
568
|
-
"u32"
|
|
569
|
-
],
|
|
570
|
-
[
|
|
571
|
-
"index",
|
|
572
|
-
"u32"
|
|
573
|
-
]
|
|
574
|
-
]
|
|
575
|
-
},
|
|
576
|
-
"RelayAffirmationT": {
|
|
577
|
-
"type": "struct",
|
|
578
|
-
"type_mapping": [
|
|
579
|
-
[
|
|
580
|
-
"relayer",
|
|
581
|
-
"AccountId"
|
|
582
|
-
],
|
|
583
|
-
[
|
|
584
|
-
"relay_header_parcels",
|
|
585
|
-
"EthereumRelayHeaderParcel"
|
|
586
|
-
],
|
|
587
|
-
[
|
|
588
|
-
"bond",
|
|
589
|
-
"Balance"
|
|
590
|
-
],
|
|
591
|
-
[
|
|
592
|
-
"maybe_extended_relay_affirmation_id",
|
|
593
|
-
"Option<RelayAffirmationId>"
|
|
594
|
-
],
|
|
595
|
-
[
|
|
596
|
-
"verified",
|
|
597
|
-
"bool"
|
|
598
|
-
]
|
|
599
|
-
]
|
|
600
|
-
},
|
|
601
|
-
"RelayVotingState": {
|
|
602
|
-
"type": "struct",
|
|
603
|
-
"type_mapping": [
|
|
604
|
-
[
|
|
605
|
-
"ayes",
|
|
606
|
-
"Vec<AccountId>"
|
|
607
|
-
],
|
|
608
|
-
[
|
|
609
|
-
"nays",
|
|
610
|
-
"Vec<AccountId>"
|
|
611
|
-
]
|
|
612
|
-
]
|
|
613
|
-
},
|
|
614
|
-
"ProxyType": {
|
|
615
|
-
"type": "enum",
|
|
616
|
-
"type_mapping": [
|
|
617
|
-
[
|
|
618
|
-
"Any",
|
|
619
|
-
"Null"
|
|
620
|
-
],
|
|
621
|
-
[
|
|
622
|
-
"NonTransfer",
|
|
623
|
-
"Null"
|
|
624
|
-
],
|
|
625
|
-
[
|
|
626
|
-
"Governance",
|
|
627
|
-
"Null"
|
|
628
|
-
],
|
|
629
|
-
[
|
|
630
|
-
"Staking",
|
|
631
|
-
"Null"
|
|
632
|
-
],
|
|
633
|
-
[
|
|
634
|
-
"IdentityJudgement",
|
|
635
|
-
"Null"
|
|
636
|
-
],
|
|
637
|
-
[
|
|
638
|
-
"EthereumBridge",
|
|
639
|
-
"Null"
|
|
640
|
-
]
|
|
641
|
-
]
|
|
642
|
-
},
|
|
643
|
-
"BalancesRuntimeDispatchInfo": {
|
|
644
|
-
"type": "struct",
|
|
645
|
-
"type_mapping": [
|
|
646
|
-
[
|
|
647
|
-
"usable_balance",
|
|
648
|
-
"Balance"
|
|
649
|
-
]
|
|
650
|
-
]
|
|
651
|
-
},
|
|
652
|
-
"StakingRuntimeDispatchInfo": {
|
|
653
|
-
"type": "struct",
|
|
654
|
-
"type_mapping": [
|
|
655
|
-
[
|
|
656
|
-
"power",
|
|
657
|
-
"Power"
|
|
658
|
-
]
|
|
659
|
-
]
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|