scale.rb 0.2.18 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Cargo.lock +8 -4
- data/Cargo.toml +2 -3
- data/Dockerfile +4 -1
- data/Gemfile.lock +3 -3
- data/README.md +20 -4
- data/Rakefile +6 -0
- data/lib/helper.rb +19 -4
- data/lib/metadata/metadata.rb +27 -17
- data/lib/metadata/metadata_v0.rb +24 -20
- data/lib/metadata/metadata_v1.rb +13 -9
- data/lib/metadata/metadata_v10.rb +2 -2
- data/lib/metadata/metadata_v11.rb +2 -2
- data/lib/metadata/metadata_v12.rb +9 -8
- data/lib/metadata/metadata_v13.rb +161 -0
- data/lib/metadata/metadata_v2.rb +2 -2
- data/lib/metadata/metadata_v3.rb +2 -2
- data/lib/metadata/metadata_v4.rb +21 -11
- data/lib/metadata/metadata_v5.rb +21 -11
- data/lib/metadata/metadata_v6.rb +9 -9
- data/lib/metadata/metadata_v7.rb +26 -15
- data/lib/metadata/metadata_v8.rb +9 -9
- data/lib/metadata/metadata_v9.rb +2 -2
- data/lib/scale/base.rb +136 -96
- data/lib/scale/block.rb +10 -10
- data/lib/scale/trie.rb +1 -1
- data/lib/scale/types.rb +91 -40
- data/lib/scale/version.rb +1 -1
- data/lib/scale.rb +38 -377
- data/lib/scale_bytes.rb +63 -0
- data/lib/substrate_client.rb +11 -8
- data/lib/type_builder.rb +280 -0
- data/lib/type_registry/darwinia.json +730 -554
- data/lib/type_registry/default.json +1 -0
- data/lib/type_registry/pangolin.json +571 -132
- data/lib/type_registry.rb +91 -0
- data/scripts/mmr_root_to_sign.rb +10 -0
- data/src/lib.rs +80 -25
- metadata +7 -3
- data/src/storage_key.rs +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45e42a3b0f9d6934412cf21cf4eff6576846b914e1f93f136ba5cf9188cca349
|
4
|
+
data.tar.gz: 905d9f7d1fdeed1ef44050e5d187e775fed65e322acd9e0d3ed6c638b8676f40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a61c8fe8bc16594feff4c4fe6898bb9a826a3a1bb22eec7f6f483cb5f2a053d6ac69a6431a2bcf8ce41cfbf41a04860799c2d625b232953be0386a948464e7
|
7
|
+
data.tar.gz: e74c876481194337664d0e0df5ed1862452262cb7beb2e575912a043e24268c404b55ada4ee3b908f07511b029ad3399d63894e0503ce6b9fa04f0a35ebac735
|
data/.gitignore
CHANGED
data/Cargo.lock
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# This file is automatically @generated by Cargo.
|
2
2
|
# It is not intended for manual editing.
|
3
|
+
version = 3
|
4
|
+
|
3
5
|
[[package]]
|
4
6
|
name = "Inflector"
|
5
7
|
version = "0.11.4"
|
@@ -15,6 +17,8 @@ name = "SCALE-testing-interface"
|
|
15
17
|
version = "0.1.0"
|
16
18
|
dependencies = [
|
17
19
|
"frame-support",
|
20
|
+
"hex",
|
21
|
+
"libc",
|
18
22
|
"parity-scale-codec",
|
19
23
|
"sp-core",
|
20
24
|
]
|
@@ -642,9 +646,9 @@ dependencies = [
|
|
642
646
|
|
643
647
|
[[package]]
|
644
648
|
name = "hex"
|
645
|
-
version = "0.4.
|
649
|
+
version = "0.4.3"
|
646
650
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
647
|
-
checksum = "
|
651
|
+
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
648
652
|
|
649
653
|
[[package]]
|
650
654
|
name = "hmac"
|
@@ -744,9 +748,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|
744
748
|
|
745
749
|
[[package]]
|
746
750
|
name = "libc"
|
747
|
-
version = "0.2.
|
751
|
+
version = "0.2.94"
|
748
752
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
749
|
-
checksum = "
|
753
|
+
checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
|
750
754
|
|
751
755
|
[[package]]
|
752
756
|
name = "libsecp256k1"
|
data/Cargo.toml
CHANGED
@@ -8,11 +8,10 @@ edition = "2018"
|
|
8
8
|
parity-scale-codec = { version = "1.3.6" }
|
9
9
|
sp-core = { version = "2.0.0", git = "https://github.com/paritytech/substrate.git", features = ["full_crypto"]}
|
10
10
|
frame-support = { version = "2.0.0", git = "https://github.com/paritytech/substrate.git" }
|
11
|
+
libc = { version = "0.2.94" }
|
12
|
+
hex = { version = "0.4.3" }
|
11
13
|
|
12
14
|
[lib]
|
13
15
|
name = "scale_ffi"
|
14
16
|
crate-type = ["dylib"]
|
15
17
|
|
16
|
-
[[bin]]
|
17
|
-
name = "storage_key"
|
18
|
-
path = "src/storage_key.rs"
|
data/Dockerfile
CHANGED
@@ -15,7 +15,10 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
|
|
15
15
|
export RUSTFLAGS='-C target-feature=-crt-static' && \
|
16
16
|
make
|
17
17
|
|
18
|
-
|
18
|
+
ENV RUSTFLAGS='-C target-feature=-crt-static'
|
19
|
+
ENV PATH=/root/.cargo/bin:$PATH
|
20
|
+
|
21
|
+
RUN gem install bundler:2.2.13 && \
|
19
22
|
bundle install && \
|
20
23
|
rake install:local
|
21
24
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
scale.rb (0.2
|
4
|
+
scale.rb (0.3.2)
|
5
5
|
base58
|
6
6
|
blake2b_rs (~> 0.1.2)
|
7
7
|
faye-websocket
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
coderay (1.1.3)
|
20
20
|
diff-lcs (1.4.4)
|
21
21
|
eventmachine (1.2.7)
|
22
|
-
faye-websocket (0.11.
|
22
|
+
faye-websocket (0.11.1)
|
23
23
|
eventmachine (>= 0.12.0)
|
24
24
|
websocket-driver (>= 0.5.1)
|
25
25
|
ffi (1.15.0)
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
tomlrb (~> 1.2)
|
50
50
|
thor (1.1.0)
|
51
51
|
tomlrb (1.3.0)
|
52
|
-
websocket-driver (0.7.
|
52
|
+
websocket-driver (0.7.5)
|
53
53
|
websocket-extensions (>= 0.1.0)
|
54
54
|
websocket-extensions (0.1.5)
|
55
55
|
xxhash (0.4.0)
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
![grants_badge](./grants_badge.png)
|
2
2
|
|
3
|
+
**Warning: After v0.2.19, the develop branch will do a structure refactor and big optimization.**
|
4
|
+
|
3
5
|
# scale.rb
|
4
6
|
|
5
7
|
**Ruby SCALE Codec Library**
|
@@ -19,7 +21,7 @@ Because the feature of ruby 2.6 is used, the ruby version is required to be >= 2
|
|
19
21
|
Add this line to your application's Gemfile:
|
20
22
|
|
21
23
|
```ruby
|
22
|
-
gem 'scale.rb', '0.2.
|
24
|
+
gem 'scale.rb', '0.2.19'
|
23
25
|
```
|
24
26
|
|
25
27
|
And then execute:
|
@@ -73,9 +75,23 @@ p o.encode # "080001"
|
|
73
75
|
3. client
|
74
76
|
```ruby
|
75
77
|
require "scale"
|
76
|
-
|
77
|
-
|
78
|
-
|
78
|
+
client = SubstrateClient.new "wss://rpc.darwinia.network"
|
79
|
+
|
80
|
+
v = Scale::Types.get("EthereumTransactionIndex")
|
81
|
+
.new(
|
82
|
+
[
|
83
|
+
Scale::Types::H256.new("0x803054c2beacabc36e15c3147bb87d8320a02e9b601be28820a622dedd1c7717"),
|
84
|
+
Scale::Types::U64.new(266)
|
85
|
+
]
|
86
|
+
)
|
87
|
+
|
88
|
+
storage = client.get_storage("EthereumBacking", "VerifiedProof", [v])
|
89
|
+
puts storage.to_human
|
90
|
+
|
91
|
+
# get the raw data
|
92
|
+
key = client.generate_storage_key("EthereumBacking", "VerifiedProof", [v])[0]
|
93
|
+
storage_raw = client.state_getStorageAt(key)
|
94
|
+
puts storage_raw
|
79
95
|
|
80
96
|
```
|
81
97
|
Please go to `spec` dir for more examples.
|
data/Rakefile
CHANGED
data/lib/helper.rb
CHANGED
@@ -18,16 +18,30 @@ class SubstrateClient::Helper
|
|
18
18
|
return_type = map[:value]
|
19
19
|
# TODO: decode to account id if param is address
|
20
20
|
# params[0] = decode(params[0]) if map[:key] == "AccountId"
|
21
|
+
|
21
22
|
type = Scale::Types.get(map[:key])
|
22
|
-
params[0]
|
23
|
+
if params[0].class != type
|
24
|
+
raise Scale::StorageInputTypeError.new("The type of first param is not equal to the type from metadata: #{map[:key]} => #{type}")
|
25
|
+
end
|
26
|
+
params[0] = params[0].encode
|
23
27
|
elsif map = storage_item[:type][:DoubleMap]
|
24
28
|
raise "Storage call of type \"DoubleMapType\" requires 2 parameters" if params.nil? || params.length != 2
|
25
29
|
|
26
30
|
hasher = map[:hasher]
|
27
31
|
hasher2 = map[:key2Hasher]
|
28
32
|
return_type = map[:value]
|
29
|
-
|
30
|
-
|
33
|
+
|
34
|
+
type1 = Scale::Types.get(map[:key1])
|
35
|
+
if params[0].class != type1
|
36
|
+
raise Scale::StorageInputTypeError.new("The type of 1st param is not equal to the type from metadata: #{map[:key1]} => #{type1.class.name}")
|
37
|
+
end
|
38
|
+
params[0] = params[0].encode
|
39
|
+
|
40
|
+
type2 = Scale::Types.get(map[:key2])
|
41
|
+
if params[1].class != type2
|
42
|
+
raise Scale::StorageInputTypeError.new("The type of 2nd param is not equal to the type from metadata: #{map[:key2]} => #{type2.class.name}")
|
43
|
+
end
|
44
|
+
params[1] = params[1].encode
|
31
45
|
else
|
32
46
|
raise NotImplementedError
|
33
47
|
end
|
@@ -41,7 +55,8 @@ class SubstrateClient::Helper
|
|
41
55
|
hasher2,
|
42
56
|
metadata.value.value[:metadata][:version]
|
43
57
|
)
|
44
|
-
[
|
58
|
+
storage_modifier = storage_item[:modifier]
|
59
|
+
[storage_key, return_type, storage_item]
|
45
60
|
end
|
46
61
|
|
47
62
|
def generate_storage_key(module_name, storage_name, params = nil, hasher = nil, hasher2 = nil, metadata_version = nil)
|
data/lib/metadata/metadata.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
module Scale
|
2
2
|
module Types
|
3
3
|
class Metadata
|
4
|
-
include
|
4
|
+
include Base
|
5
5
|
attr_accessor :version
|
6
6
|
def self.decode(scale_bytes)
|
7
7
|
bytes = scale_bytes.get_next_bytes(4)
|
8
8
|
if bytes.bytes_to_utf8 == "meta"
|
9
|
-
|
9
|
+
version_enum = {
|
10
|
+
"type" => "enum",
|
11
|
+
"value_list" => %w[MetadataV0 MetadataV1 MetadataV2 MetadataV3 MetadataV4 MetadataV5 MetadataV6 MetadataV7 MetadataV8 MetadataV9 MetadataV10 MetadataV11 MetadataV12 MetadataV13]
|
12
|
+
}
|
13
|
+
metadata_version = Scale::Types.get(version_enum).decode(scale_bytes).value
|
10
14
|
metadata = Metadata.new "Scale::Types::#{metadata_version}".constantize2.decode(scale_bytes)
|
11
15
|
metadata.version = metadata_version[9..].to_i
|
12
16
|
else
|
@@ -48,7 +52,7 @@ module Scale
|
|
48
52
|
end
|
49
53
|
|
50
54
|
class MetadataModule
|
51
|
-
include
|
55
|
+
include Base
|
52
56
|
def self.decode(scale_bytes)
|
53
57
|
name = String.decode(scale_bytes).value
|
54
58
|
prefix = String.decode(scale_bytes).value
|
@@ -60,19 +64,19 @@ module Scale
|
|
60
64
|
|
61
65
|
has_storage = Bool.decode(scale_bytes).value
|
62
66
|
if has_storage
|
63
|
-
storages = Scale::Types.
|
67
|
+
storages = Scale::Types.get("Vec<MetadataModuleStorage>").decode(scale_bytes).value
|
64
68
|
result[:storage] = storages.map(&:value)
|
65
69
|
end
|
66
70
|
|
67
71
|
has_calls = Bool.decode(scale_bytes).value
|
68
72
|
if has_calls
|
69
|
-
calls = Scale::Types.
|
73
|
+
calls = Scale::Types.get("Vec<MetadataModuleCall>").decode(scale_bytes).value
|
70
74
|
result[:calls] = calls.map(&:value)
|
71
75
|
end
|
72
76
|
|
73
77
|
has_events = Bool.decode(scale_bytes).value
|
74
78
|
if has_events
|
75
|
-
events = Scale::Types.
|
79
|
+
events = Scale::Types.get("Vec<MetadataModuleEvent>").decode(scale_bytes).value
|
76
80
|
result[:events] = events.map(&:value)
|
77
81
|
end
|
78
82
|
|
@@ -85,11 +89,17 @@ module Scale
|
|
85
89
|
end
|
86
90
|
|
87
91
|
class MetadataModuleStorage
|
88
|
-
include
|
92
|
+
include Base
|
89
93
|
def self.decode(scale_bytes)
|
94
|
+
name = String.decode(scale_bytes).value
|
95
|
+
enum = {
|
96
|
+
"type" => "enum",
|
97
|
+
"value_list" => ["Optional", "Default"]
|
98
|
+
}
|
99
|
+
modifier = Scale::Types.get(enum).decode(scale_bytes).value
|
90
100
|
result = {
|
91
|
-
name:
|
92
|
-
modifier:
|
101
|
+
name: name,
|
102
|
+
modifier: modifier
|
93
103
|
}
|
94
104
|
|
95
105
|
is_key_value = Bool.decode(scale_bytes).value
|
@@ -108,25 +118,25 @@ module Scale
|
|
108
118
|
end
|
109
119
|
|
110
120
|
result[:fallback] = Hex.decode(scale_bytes).value
|
111
|
-
result[:documentation] = Scale::Types.
|
121
|
+
result[:documentation] = Scale::Types.get("Vec<String>").decode(scale_bytes).value.map(&:value)
|
112
122
|
|
113
123
|
MetadataModuleStorage.new(result)
|
114
124
|
end
|
115
125
|
end
|
116
126
|
|
117
127
|
class MetadataModuleCall
|
118
|
-
include
|
128
|
+
include Base
|
119
129
|
def self.decode(scale_bytes)
|
120
130
|
result = {}
|
121
131
|
result[:name] = String.decode(scale_bytes).value
|
122
|
-
result[:args] = Scale::Types.
|
123
|
-
result[:documentation] = Scale::Types.
|
132
|
+
result[:args] = Scale::Types.get("Vec<MetadataModuleCallArgument>").decode(scale_bytes).value.map(&:value)
|
133
|
+
result[:documentation] = Scale::Types.get("Vec<String>").decode(scale_bytes).value.map(&:value)
|
124
134
|
MetadataModuleCall.new(result)
|
125
135
|
end
|
126
136
|
end
|
127
137
|
|
128
138
|
class MetadataModuleCallArgument
|
129
|
-
include
|
139
|
+
include Base
|
130
140
|
def self.decode(scale_bytes)
|
131
141
|
result = {}
|
132
142
|
result[:name] = String.decode(scale_bytes).value
|
@@ -137,12 +147,12 @@ module Scale
|
|
137
147
|
end
|
138
148
|
|
139
149
|
class MetadataModuleEvent
|
140
|
-
include
|
150
|
+
include Base
|
141
151
|
def self.decode(scale_bytes)
|
142
152
|
result = {}
|
143
153
|
result[:name] = String.decode(scale_bytes).value
|
144
|
-
result[:args] = Scale::Types.
|
145
|
-
result[:documentation] = Scale::Types.
|
154
|
+
result[:args] = Scale::Types.get("Vec<String>").decode(scale_bytes).value.map(&:value)
|
155
|
+
result[:documentation] = Scale::Types.get("Vec<String>").decode(scale_bytes).value.map(&:value)
|
146
156
|
|
147
157
|
MetadataModuleEvent.new(result)
|
148
158
|
end
|
data/lib/metadata/metadata_v0.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Scale
|
2
2
|
module Types
|
3
3
|
class MetadataV0
|
4
|
-
include
|
4
|
+
include Base
|
5
5
|
attr_accessor :call_index, :event_index
|
6
6
|
|
7
7
|
def initialize(value)
|
@@ -26,12 +26,12 @@ module Scale
|
|
26
26
|
}
|
27
27
|
}
|
28
28
|
|
29
|
-
events_modules = Scale::Types.
|
30
|
-
modules = Scale::Types.
|
29
|
+
events_modules = Scale::Types.get("Vec<MetadataV0EventModule>").decode(scale_bytes).value.map(&:value)
|
30
|
+
modules = Scale::Types.get("Vec<MetadataV0Module>").decode(scale_bytes).value.map(&:value)
|
31
31
|
|
32
32
|
Bytes.decode(scale_bytes).value
|
33
33
|
|
34
|
-
sections = Scale::Types.
|
34
|
+
sections = Scale::Types.get("Vec<MetadataV0Section>").decode(scale_bytes).value.map(&:value)
|
35
35
|
|
36
36
|
value[:metadata][:outerEvent][:events] = events_modules
|
37
37
|
value[:metadata][:modules] = modules
|
@@ -65,11 +65,11 @@ module Scale
|
|
65
65
|
end
|
66
66
|
|
67
67
|
class MetadataV0EventModule
|
68
|
-
include
|
68
|
+
include Base
|
69
69
|
|
70
70
|
def self.decode(scale_bytes)
|
71
71
|
name = Bytes.decode(scale_bytes).value
|
72
|
-
events = Scale::Types.
|
72
|
+
events = Scale::Types.get('Vec<MetadataV0Event>').decode(scale_bytes).value.map(&:value)
|
73
73
|
MetadataV0EventModule.new([
|
74
74
|
name,
|
75
75
|
events
|
@@ -78,25 +78,25 @@ module Scale
|
|
78
78
|
end
|
79
79
|
|
80
80
|
class MetadataV0Event
|
81
|
-
include
|
81
|
+
include Base
|
82
82
|
|
83
83
|
def self.decode(scale_bytes)
|
84
84
|
name = Bytes.decode(scale_bytes).value
|
85
|
-
args = Scale::Types.
|
86
|
-
documentation = Scale::Types.
|
85
|
+
args = Scale::Types.get("Vec<Bytes>").decode(scale_bytes).value.map(&:value)
|
86
|
+
documentation = Scale::Types.get("Vec<Bytes>").decode(scale_bytes).value.map(&:value)
|
87
87
|
MetadataV0Event.new({name: name, args: args.map {|arg| arg }, documentation: documentation})
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
91
|
class MetadataV0Module
|
92
|
-
include
|
92
|
+
include Base
|
93
93
|
|
94
94
|
def self.decode(scale_bytes)
|
95
95
|
prefix = Bytes.decode(scale_bytes).value
|
96
96
|
name = Bytes.decode(scale_bytes).value
|
97
97
|
call_name = Bytes.decode(scale_bytes).value
|
98
98
|
|
99
|
-
functions = Scale::Types.
|
99
|
+
functions = Scale::Types.get("Vec<MetadataV0ModuleFunction>").decode(scale_bytes).value.map(&:value)
|
100
100
|
|
101
101
|
result = {
|
102
102
|
prefix: prefix,
|
@@ -112,7 +112,7 @@ module Scale
|
|
112
112
|
has_storage = Bool.decode(scale_bytes).value
|
113
113
|
if has_storage
|
114
114
|
storage_prefix = Bytes.decode(scale_bytes).value
|
115
|
-
storage = Scale::Types.
|
115
|
+
storage = Scale::Types.get("Vec<MetadataV0ModuleStorage>").decode(scale_bytes).value.map(&:value)
|
116
116
|
result[:storage] = {
|
117
117
|
prefix: storage_prefix,
|
118
118
|
functions: storage
|
@@ -124,13 +124,13 @@ module Scale
|
|
124
124
|
end
|
125
125
|
|
126
126
|
class MetadataV0ModuleFunction
|
127
|
-
include
|
127
|
+
include Base
|
128
128
|
|
129
129
|
def self.decode(scale_bytes)
|
130
130
|
id = U16.decode(scale_bytes).value
|
131
131
|
name = Bytes.decode(scale_bytes).value
|
132
|
-
args = Scale::Types.
|
133
|
-
documentation = Scale::Types.
|
132
|
+
args = Scale::Types.get("Vec<MetadataV0ModuleCallArgument>").decode(scale_bytes).value.map(&:value)
|
133
|
+
documentation = Scale::Types.get("Vec<Bytes>").decode(scale_bytes).value.map(&:value)
|
134
134
|
MetadataV0ModuleFunction.new({
|
135
135
|
id: id,
|
136
136
|
name: name,
|
@@ -141,7 +141,7 @@ module Scale
|
|
141
141
|
end
|
142
142
|
|
143
143
|
class MetadataV0ModuleCallArgument
|
144
|
-
include
|
144
|
+
include Base
|
145
145
|
|
146
146
|
def self.decode(scale_bytes)
|
147
147
|
name = Bytes.decode(scale_bytes).value
|
@@ -152,11 +152,15 @@ module Scale
|
|
152
152
|
end
|
153
153
|
|
154
154
|
class MetadataV0ModuleStorage
|
155
|
-
include
|
155
|
+
include Base
|
156
156
|
|
157
157
|
def self.decode(scale_bytes)
|
158
158
|
name = Bytes.decode(scale_bytes).value
|
159
|
-
|
159
|
+
enum = {
|
160
|
+
"type" => "enum",
|
161
|
+
"value_list" => ["Optional", "Default"]
|
162
|
+
}
|
163
|
+
modifier = Scale::Types.get(enum).decode(scale_bytes).value
|
160
164
|
|
161
165
|
is_key_value = Bool.decode(scale_bytes).value
|
162
166
|
|
@@ -174,7 +178,7 @@ module Scale
|
|
174
178
|
end
|
175
179
|
|
176
180
|
fallback = Hex.decode(scale_bytes).value
|
177
|
-
documentation = Scale::Types.
|
181
|
+
documentation = Scale::Types.get("Vec<Bytes>").decode(scale_bytes).value.map(&:value)
|
178
182
|
|
179
183
|
MetadataV0ModuleStorage.new({
|
180
184
|
name: name,
|
@@ -187,7 +191,7 @@ module Scale
|
|
187
191
|
end
|
188
192
|
|
189
193
|
class MetadataV0Section
|
190
|
-
include
|
194
|
+
include Base
|
191
195
|
|
192
196
|
def self.decode(scale_bytes)
|
193
197
|
name = Bytes.decode(scale_bytes).value
|