tezos_client 1.2.0 → 1.2.1
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/Gemfile.lock +25 -25
- data/lib/tezos_client/operation_mgr.rb +3 -2
- data/lib/tezos_client/tools/convert_to_hash.rb +0 -1
- data/lib/tezos_client/tools/convert_to_hash/address.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/base.rb +22 -22
- data/lib/tezos_client/tools/convert_to_hash/big_map.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/bytes.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/int.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/key.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/list.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/map.rb +31 -0
- data/lib/tezos_client/tools/convert_to_hash/nat.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/pair.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/signature.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/string.rb +1 -1
- data/lib/tezos_client/tools/convert_to_hash/timestamp.rb +8 -2
- data/lib/tezos_client/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37c983e5bf0b57cb2d3758165076d7c17e091214c61401b5107989fab6b3e09f
|
|
4
|
+
data.tar.gz: 301462a20464486d1ad37bf0708aa00d1e2db30105f1944eacc4dbd67074d6a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec1a70b4066f70964182d811877cc6a2cad18ae95403a4a86e3e3758a35413922c85115fcf7e3c26edaf9e34f1d27f00f5a109c4050dfa9cc001479a3916b570
|
|
7
|
+
data.tar.gz: 3e2d3c82e9b811990f2682f7d4ce8992c1399850f43dfa587d0fe9f5f2c88f3307235792677210d8c71348ae0d9f083844e7617b194c851e6bbbf2b1c86a2bc3
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
tezos_client (1.2.
|
|
4
|
+
tezos_client (1.2.1)
|
|
5
5
|
active_interaction (~> 3.7)
|
|
6
6
|
activesupport (~> 6.0.0)
|
|
7
7
|
base58 (~> 0.2.3)
|
|
@@ -14,40 +14,40 @@ PATH
|
|
|
14
14
|
GEM
|
|
15
15
|
remote: https://rubygems.org/
|
|
16
16
|
specs:
|
|
17
|
-
actionpack (6.0.
|
|
18
|
-
actionview (= 6.0.
|
|
19
|
-
activesupport (= 6.0.
|
|
20
|
-
rack (~> 2.0)
|
|
17
|
+
actionpack (6.0.2.2)
|
|
18
|
+
actionview (= 6.0.2.2)
|
|
19
|
+
activesupport (= 6.0.2.2)
|
|
20
|
+
rack (~> 2.0, >= 2.0.8)
|
|
21
21
|
rack-test (>= 0.6.3)
|
|
22
22
|
rails-dom-testing (~> 2.0)
|
|
23
23
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
24
|
-
actionview (6.0.
|
|
25
|
-
activesupport (= 6.0.
|
|
24
|
+
actionview (6.0.2.2)
|
|
25
|
+
activesupport (= 6.0.2.2)
|
|
26
26
|
builder (~> 3.1)
|
|
27
27
|
erubi (~> 1.4)
|
|
28
28
|
rails-dom-testing (~> 2.0)
|
|
29
29
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
30
30
|
active_interaction (3.8.0)
|
|
31
31
|
activemodel (>= 4, < 7)
|
|
32
|
-
activemodel (6.0.
|
|
33
|
-
activesupport (= 6.0.
|
|
34
|
-
activesupport (6.0.
|
|
32
|
+
activemodel (6.0.2.2)
|
|
33
|
+
activesupport (= 6.0.2.2)
|
|
34
|
+
activesupport (6.0.2.2)
|
|
35
35
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
36
36
|
i18n (>= 0.7, < 2)
|
|
37
37
|
minitest (~> 5.1)
|
|
38
38
|
tzinfo (~> 1.1)
|
|
39
|
-
zeitwerk (~> 2.
|
|
39
|
+
zeitwerk (~> 2.2)
|
|
40
40
|
addressable (2.7.0)
|
|
41
41
|
public_suffix (>= 2.0.2, < 5.0)
|
|
42
42
|
ast (2.4.0)
|
|
43
43
|
base58 (0.2.3)
|
|
44
44
|
bip_mnemonic (0.0.4)
|
|
45
|
-
builder (3.2.
|
|
45
|
+
builder (3.2.4)
|
|
46
46
|
coderay (1.1.2)
|
|
47
|
-
concurrent-ruby (1.1.
|
|
47
|
+
concurrent-ruby (1.1.6)
|
|
48
48
|
crack (0.4.3)
|
|
49
49
|
safe_yaml (~> 1.0.0)
|
|
50
|
-
crass (1.0.
|
|
50
|
+
crass (1.0.6)
|
|
51
51
|
diff-lcs (1.3)
|
|
52
52
|
domain_name (0.5.20190701)
|
|
53
53
|
unf (>= 0.0.5, < 1.0.0)
|
|
@@ -59,10 +59,10 @@ GEM
|
|
|
59
59
|
httparty (0.17.3)
|
|
60
60
|
mime-types (~> 3.0)
|
|
61
61
|
multi_xml (>= 0.5.2)
|
|
62
|
-
i18n (1.
|
|
62
|
+
i18n (1.8.2)
|
|
63
63
|
concurrent-ruby (~> 1.0)
|
|
64
64
|
jaro_winkler (1.5.3)
|
|
65
|
-
loofah (2.
|
|
65
|
+
loofah (2.4.0)
|
|
66
66
|
crass (~> 1.0.2)
|
|
67
67
|
nokogiri (>= 1.5.9)
|
|
68
68
|
method_source (0.9.2)
|
|
@@ -70,12 +70,12 @@ GEM
|
|
|
70
70
|
mime-types-data (~> 3.2015)
|
|
71
71
|
mime-types-data (3.2019.1009)
|
|
72
72
|
mini_portile2 (2.4.0)
|
|
73
|
-
minitest (5.
|
|
73
|
+
minitest (5.14.0)
|
|
74
74
|
money-tree (0.10.0)
|
|
75
75
|
ffi
|
|
76
76
|
multi_xml (0.6.0)
|
|
77
77
|
netrc (0.11.0)
|
|
78
|
-
nokogiri (1.10.
|
|
78
|
+
nokogiri (1.10.9)
|
|
79
79
|
mini_portile2 (~> 2.4.0)
|
|
80
80
|
parallel (1.18.0)
|
|
81
81
|
parser (2.6.5.0)
|
|
@@ -84,7 +84,7 @@ GEM
|
|
|
84
84
|
coderay (~> 1.1.0)
|
|
85
85
|
method_source (~> 0.9.0)
|
|
86
86
|
public_suffix (4.0.1)
|
|
87
|
-
rack (2.
|
|
87
|
+
rack (2.2.2)
|
|
88
88
|
rack-test (1.1.0)
|
|
89
89
|
rack (>= 1.0, < 3)
|
|
90
90
|
rails-dom-testing (2.0.3)
|
|
@@ -92,9 +92,9 @@ GEM
|
|
|
92
92
|
nokogiri (>= 1.6)
|
|
93
93
|
rails-html-sanitizer (1.3.0)
|
|
94
94
|
loofah (~> 2.3)
|
|
95
|
-
railties (6.0.
|
|
96
|
-
actionpack (= 6.0.
|
|
97
|
-
activesupport (= 6.0.
|
|
95
|
+
railties (6.0.2.2)
|
|
96
|
+
actionpack (= 6.0.2.2)
|
|
97
|
+
activesupport (= 6.0.2.2)
|
|
98
98
|
method_source
|
|
99
99
|
rake (>= 0.8.7)
|
|
100
100
|
thor (>= 0.20.3, < 2.0)
|
|
@@ -138,9 +138,9 @@ GEM
|
|
|
138
138
|
rubocop-rails (~> 2.0)
|
|
139
139
|
ruby-progressbar (1.10.1)
|
|
140
140
|
safe_yaml (1.0.5)
|
|
141
|
-
thor (0.
|
|
141
|
+
thor (1.0.1)
|
|
142
142
|
thread_safe (0.3.6)
|
|
143
|
-
tzinfo (1.2.
|
|
143
|
+
tzinfo (1.2.6)
|
|
144
144
|
thread_safe (~> 0.1)
|
|
145
145
|
unf (0.1.4)
|
|
146
146
|
unf_ext
|
|
@@ -151,7 +151,7 @@ GEM
|
|
|
151
151
|
addressable (>= 2.3.6)
|
|
152
152
|
crack (>= 0.3.2)
|
|
153
153
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
154
|
-
zeitwerk (2.
|
|
154
|
+
zeitwerk (2.3.0)
|
|
155
155
|
|
|
156
156
|
PLATFORMS
|
|
157
157
|
ruby
|
|
@@ -184,7 +184,8 @@ class TezosClient
|
|
|
184
184
|
operations: rpc_operation_args,
|
|
185
185
|
signature: base_58_signature,
|
|
186
186
|
protocol: protocol,
|
|
187
|
-
branch: branch
|
|
187
|
+
branch: branch
|
|
188
|
+
)
|
|
188
189
|
|
|
189
190
|
ensure_applied!(rpc_responses)
|
|
190
191
|
|
|
@@ -237,4 +238,4 @@ class TezosClient
|
|
|
237
238
|
raise exception_klass(errors).new(metadata: metadata, errors: errors, status: status)
|
|
238
239
|
end
|
|
239
240
|
end
|
|
240
|
-
end
|
|
241
|
+
end
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
class TezosClient
|
|
4
4
|
module Tools
|
|
5
5
|
class ConvertToHash < ActiveInteraction::Base
|
|
6
|
-
|
|
7
6
|
class Base
|
|
8
7
|
def initialize(data:, type:)
|
|
9
8
|
@data = data
|
|
@@ -17,34 +16,35 @@ class TezosClient
|
|
|
17
16
|
end
|
|
18
17
|
|
|
19
18
|
protected
|
|
19
|
+
def decode
|
|
20
|
+
klass.new(
|
|
21
|
+
data: data,
|
|
22
|
+
type: type
|
|
23
|
+
).decode
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
rescue NameError
|
|
25
|
-
raise NotImplementedError, "type '#{type[:prim]}' not implemented"
|
|
26
|
-
end
|
|
25
|
+
rescue NameError => e
|
|
26
|
+
raise NotImplementedError, "type '#{type[:prim]}' not implemented"
|
|
27
|
+
end
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
def anonymous?
|
|
30
|
+
!(type.key?(:annots) && type[:annots].any?)
|
|
31
|
+
end
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
def var_name_annot
|
|
34
|
+
type[:annots].first
|
|
35
|
+
end
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
def var_name
|
|
38
|
+
return nil if anonymous?
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
"#{var_name_annot[1..-1]}".to_sym
|
|
41
|
+
end
|
|
41
42
|
|
|
42
43
|
private
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
end
|
|
44
|
+
def klass
|
|
45
|
+
"TezosClient::Tools::ConvertToHash::#{type[:prim].camelize}".constantize
|
|
46
|
+
end
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
|
-
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class TezosClient
|
|
4
|
+
module Tools
|
|
5
|
+
class ConvertToHash < ActiveInteraction::Base
|
|
6
|
+
class Map < Base
|
|
7
|
+
def decode
|
|
8
|
+
new_map = {}
|
|
9
|
+
|
|
10
|
+
data.each do |elem|
|
|
11
|
+
raise "Not a 'Map' type" unless elem[:prim] == "Elt"
|
|
12
|
+
|
|
13
|
+
key = TezosClient::Tools::ConvertToHash::Base.new(
|
|
14
|
+
data: elem[:args].first,
|
|
15
|
+
type: type[:args].first
|
|
16
|
+
).value
|
|
17
|
+
|
|
18
|
+
value = TezosClient::Tools::ConvertToHash::Base.new(
|
|
19
|
+
data: elem[:args].second,
|
|
20
|
+
type: type[:args].second
|
|
21
|
+
).value
|
|
22
|
+
|
|
23
|
+
new_map[key] = value
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
new_map
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -5,9 +5,15 @@ class TezosClient
|
|
|
5
5
|
class ConvertToHash < ActiveInteraction::Base
|
|
6
6
|
class Timestamp < Base
|
|
7
7
|
def decode
|
|
8
|
-
|
|
8
|
+
if data.key? :int
|
|
9
|
+
Time.zone.at(data[:int].to_i)
|
|
10
|
+
elsif data.key? :string
|
|
11
|
+
Time.zone.parse(data[:string])
|
|
12
|
+
else
|
|
13
|
+
raise "Can not convert timestamp: #{data}"
|
|
14
|
+
end
|
|
9
15
|
end
|
|
10
16
|
end
|
|
11
17
|
end
|
|
12
18
|
end
|
|
13
|
-
end
|
|
19
|
+
end
|
data/lib/tezos_client/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tezos_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pierre Michard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-04-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -282,6 +282,7 @@ files:
|
|
|
282
282
|
- lib/tezos_client/tools/convert_to_hash/int.rb
|
|
283
283
|
- lib/tezos_client/tools/convert_to_hash/key.rb
|
|
284
284
|
- lib/tezos_client/tools/convert_to_hash/list.rb
|
|
285
|
+
- lib/tezos_client/tools/convert_to_hash/map.rb
|
|
285
286
|
- lib/tezos_client/tools/convert_to_hash/nat.rb
|
|
286
287
|
- lib/tezos_client/tools/convert_to_hash/pair.rb
|
|
287
288
|
- lib/tezos_client/tools/convert_to_hash/signature.rb
|
|
@@ -313,8 +314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
313
314
|
- !ruby/object:Gem::Version
|
|
314
315
|
version: '0'
|
|
315
316
|
requirements: []
|
|
316
|
-
|
|
317
|
-
rubygems_version: 2.7.6
|
|
317
|
+
rubygems_version: 3.0.6
|
|
318
318
|
signing_key:
|
|
319
319
|
specification_version: 4
|
|
320
320
|
summary: Wrapper to the tezos client.
|