scale.rb 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/metadata/metadata_v1.rb +1 -1
- data/lib/metadata/metadata_v10.rb +1 -1
- data/lib/metadata/metadata_v11.rb +1 -1
- data/lib/metadata/metadata_v2.rb +1 -1
- data/lib/metadata/metadata_v3.rb +1 -1
- data/lib/metadata/metadata_v4.rb +1 -1
- data/lib/metadata/metadata_v5.rb +1 -1
- data/lib/metadata/metadata_v6.rb +1 -1
- data/lib/metadata/metadata_v7.rb +1 -1
- data/lib/metadata/metadata_v8.rb +1 -1
- data/lib/metadata/metadata_v9.rb +1 -1
- data/lib/scale/block.rb +31 -1
- data/lib/scale/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57a926d8c88b0299b3aa8c24ab8452b6e02b65e540017ea208c2cef029a9dd66
|
4
|
+
data.tar.gz: 28f3039ccd89246f9613f46ecd442a7a10a4dd750d3ffdd55a24ed8bd246cb83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e685ed147def9c29297934e1a805856c19a397527842cd2e61c6422219228b569a18cc6837c98592f3ce47b12db7d8f28f8bcc547dbaad2d41a58cb45d5419c6
|
7
|
+
data.tar.gz: d1645de7d187cdcd2e68157f5907a63229241be265eca0d05332fabc402b94156bc86fb7ab7146475b47fcdb92e2f7d4ef7561c8004c861c82517437feb5a57d
|
data/Gemfile.lock
CHANGED
data/lib/metadata/metadata_v1.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v2.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v3.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v4.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v5.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v6.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v7.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v8.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/metadata/metadata_v9.rb
CHANGED
@@ -37,7 +37,7 @@ module Scale
|
|
37
37
|
|
38
38
|
if m[:events]
|
39
39
|
m[:events].each_with_index do |event, index|
|
40
|
-
event[:lookup] = "%02x%02x" % [
|
40
|
+
event[:lookup] = "%02x%02x" % [event_module_index, index]
|
41
41
|
result.event_index[event[:lookup]] = [m, event]
|
42
42
|
end
|
43
43
|
event_module_index += 1
|
data/lib/scale/block.rb
CHANGED
@@ -104,10 +104,40 @@ module Scale
|
|
104
104
|
result[:extrinsic_length] = extrinsic_length
|
105
105
|
result[:version_info] = version_info
|
106
106
|
|
107
|
-
result
|
107
|
+
Extrinsic.new result
|
108
|
+
end
|
109
|
+
|
110
|
+
def encode(metadata)
|
111
|
+
puts metadata.value.value["modules"]
|
112
|
+
result = "04" + self.value[:call_index]
|
113
|
+
|
114
|
+
result = result +
|
115
|
+
self.value[:params].map do |param|
|
116
|
+
param[:type].constantize.new(param[:value]).encode
|
117
|
+
end.join
|
118
|
+
|
119
|
+
result = "0x" + Compact.new(result.length / 2).encode + result
|
120
|
+
return result
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
class EventRecord
|
125
|
+
include SingleValue
|
126
|
+
|
127
|
+
def self.decode(scale_bytes, metadata)
|
128
|
+
phase = scale_bytes.get_next_bytes(1).first
|
129
|
+
|
130
|
+
if phase == 0
|
131
|
+
extrinsic_idx = U32.decode(scale_bytes).value
|
132
|
+
end
|
133
|
+
|
134
|
+
type = scale_bytes.get_next_bytes(2).bytes_to_hex
|
135
|
+
|
136
|
+
|
108
137
|
end
|
109
138
|
|
110
139
|
def encode
|
140
|
+
|
111
141
|
end
|
112
142
|
end
|
113
143
|
|
data/lib/scale/version.rb
CHANGED
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.3
|
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-04-
|
11
|
+
date: 2020-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: substrate_common.rb
|