tezos_client 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52e7b70d781942af2a66c3db62098d68541585a00afa73c09e24993d16e3c426
4
- data.tar.gz: 8aa477e4e46f96584904c5d6dc625545dc6a606f69225969ac4b5efc472c5573
3
+ metadata.gz: 5257dbe976b3fba269aa9e6d4a966d2fbc7e4deaac30d5efc76a8a5699529623
4
+ data.tar.gz: 4b55b56b163c326a644fbaf62eda1e3e63b70f77e68af76ce0030f71a740c315
5
5
  SHA512:
6
- metadata.gz: 0a1f456ca8177be6127e90da3c2ca964361180e2ca6b2f1d81f6875124ce9a1e8e8f512476d4470d9d0821078be5c42d1382bd5e761fed4f1a8ce95c0eb2c535
7
- data.tar.gz: b9ec354b6fdba9e4f1eabe5265ffa68966c2035e11900b09ca2f7d501890fe2b7abb99a693b2b8cfe16df83453d8c677f27bc657f157622db4a5e3f02986ccb2
6
+ metadata.gz: ae3837fedb178aaf48381cb110379c184097e32cfc547122c68dcf725c3b795c12bba2e172187f68da8096024abaa3e556e46804e5b31d9649920f65672038b8
7
+ data.tar.gz: 04fa056b5ae0c34c4f01f4c481999a389e2246df3f6dc698327964ced7250d353e87f1533d1deb04548b578c78cda91256eb6136eb778ed85082617991bb6ccd
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tezos_client (1.3.3)
5
- active_interaction (~> 3.7)
4
+ tezos_client (1.3.4)
5
+ active_interaction (> 3.8)
6
6
  activesupport (~> 6.0.0)
7
7
  base58 (~> 0.2.3)
8
8
  bip_mnemonic (~> 0.0.2)
@@ -14,24 +14,24 @@ PATH
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- actionpack (6.0.3.3)
18
- actionview (= 6.0.3.3)
19
- activesupport (= 6.0.3.3)
17
+ actionpack (6.0.3.5)
18
+ actionview (= 6.0.3.5)
19
+ activesupport (= 6.0.3.5)
20
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.3.3)
25
- activesupport (= 6.0.3.3)
24
+ actionview (6.0.3.5)
25
+ activesupport (= 6.0.3.5)
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
- active_interaction (3.8.3)
31
- activemodel (>= 4, < 7)
32
- activemodel (6.0.3.3)
33
- activesupport (= 6.0.3.3)
34
- activesupport (6.0.3.3)
30
+ active_interaction (4.0.0)
31
+ activemodel (>= 5, < 7)
32
+ activemodel (6.0.3.5)
33
+ activesupport (= 6.0.3.5)
34
+ activesupport (6.0.3.5)
35
35
  concurrent-ruby (~> 1.0, >= 1.0.2)
36
36
  i18n (>= 0.7, < 2)
37
37
  minitest (~> 5.1)
@@ -39,51 +39,52 @@ GEM
39
39
  zeitwerk (~> 2.2, >= 2.2.2)
40
40
  addressable (2.7.0)
41
41
  public_suffix (>= 2.0.2, < 5.0)
42
- ast (2.4.0)
42
+ ast (2.4.2)
43
43
  base58 (0.2.3)
44
44
  bip_mnemonic (0.0.4)
45
45
  builder (3.2.4)
46
- coderay (1.1.2)
47
- concurrent-ruby (1.1.7)
48
- crack (0.4.3)
49
- safe_yaml (~> 1.0.0)
46
+ coderay (1.1.3)
47
+ concurrent-ruby (1.1.8)
48
+ crack (0.4.5)
49
+ rexml
50
50
  crass (1.0.6)
51
- diff-lcs (1.3)
51
+ diff-lcs (1.4.4)
52
52
  domain_name (0.5.20190701)
53
53
  unf (>= 0.0.5, < 1.0.0)
54
- erubi (1.9.0)
55
- ffi (1.13.1)
56
- hashdiff (1.0.0)
54
+ erubi (1.10.0)
55
+ ffi (1.14.2)
56
+ hashdiff (1.0.1)
57
57
  http-cookie (1.0.3)
58
58
  domain_name (~> 0.5)
59
59
  httparty (0.17.3)
60
60
  mime-types (~> 3.0)
61
61
  multi_xml (>= 0.5.2)
62
- i18n (1.8.5)
62
+ i18n (1.8.9)
63
63
  concurrent-ruby (~> 1.0)
64
- jaro_winkler (1.5.3)
65
- loofah (2.7.0)
64
+ loofah (2.9.0)
66
65
  crass (~> 1.0.2)
67
66
  nokogiri (>= 1.5.9)
68
67
  method_source (0.9.2)
69
68
  mime-types (3.3.1)
70
69
  mime-types-data (~> 3.2015)
71
- mime-types-data (3.2020.0512)
72
- mini_portile2 (2.4.0)
73
- minitest (5.14.2)
70
+ mime-types-data (3.2021.0225)
71
+ mini_portile2 (2.5.0)
72
+ minitest (5.14.4)
74
73
  money-tree (0.10.0)
75
74
  ffi
76
75
  multi_xml (0.6.0)
77
76
  netrc (0.11.0)
78
- nokogiri (1.10.10)
79
- mini_portile2 (~> 2.4.0)
80
- parallel (1.18.0)
81
- parser (2.6.5.0)
82
- ast (~> 2.4.0)
77
+ nokogiri (1.11.1)
78
+ mini_portile2 (~> 2.5.0)
79
+ racc (~> 1.4)
80
+ parallel (1.20.1)
81
+ parser (3.0.0.0)
82
+ ast (~> 2.4.1)
83
83
  pry (0.12.2)
84
84
  coderay (~> 1.1.0)
85
85
  method_source (~> 0.9.0)
86
- public_suffix (4.0.1)
86
+ public_suffix (4.0.6)
87
+ racc (1.5.2)
87
88
  rack (2.2.3)
88
89
  rack-test (1.1.0)
89
90
  rack (>= 1.0, < 3)
@@ -92,9 +93,9 @@ GEM
92
93
  nokogiri (>= 1.6)
93
94
  rails-html-sanitizer (1.3.0)
94
95
  loofah (~> 2.3)
95
- railties (6.0.3.3)
96
- actionpack (= 6.0.3.3)
97
- activesupport (= 6.0.3.3)
96
+ railties (6.0.3.5)
97
+ actionpack (= 6.0.3.5)
98
+ activesupport (= 6.0.3.5)
98
99
  method_source
99
100
  rake (>= 0.8.7)
100
101
  thor (>= 0.20.3, < 2.0)
@@ -102,56 +103,63 @@ GEM
102
103
  rake (13.0.1)
103
104
  rbnacl (5.0.0)
104
105
  ffi
106
+ regexp_parser (2.1.1)
105
107
  rest-client (2.0.2)
106
108
  http-cookie (>= 1.0.2, < 2.0)
107
109
  mime-types (>= 1.16, < 4.0)
108
110
  netrc (~> 0.8)
111
+ rexml (3.2.4)
109
112
  rspec (3.9.0)
110
113
  rspec-core (~> 3.9.0)
111
114
  rspec-expectations (~> 3.9.0)
112
115
  rspec-mocks (~> 3.9.0)
113
- rspec-core (3.9.0)
114
- rspec-support (~> 3.9.0)
115
- rspec-expectations (3.9.0)
116
+ rspec-core (3.9.3)
117
+ rspec-support (~> 3.9.3)
118
+ rspec-expectations (3.9.4)
116
119
  diff-lcs (>= 1.2.0, < 2.0)
117
120
  rspec-support (~> 3.9.0)
118
- rspec-mocks (3.9.0)
121
+ rspec-mocks (3.9.1)
119
122
  diff-lcs (>= 1.2.0, < 2.0)
120
123
  rspec-support (~> 3.9.0)
121
- rspec-support (3.9.0)
122
- rubocop (0.75.1)
123
- jaro_winkler (~> 1.5.1)
124
+ rspec-support (3.9.4)
125
+ rubocop (0.93.1)
124
126
  parallel (~> 1.10)
125
- parser (>= 2.6)
127
+ parser (>= 2.7.1.5)
126
128
  rainbow (>= 2.2.2, < 4.0)
129
+ regexp_parser (>= 1.8)
130
+ rexml
131
+ rubocop-ast (>= 0.6.0)
127
132
  ruby-progressbar (~> 1.7)
128
- unicode-display_width (>= 1.4.0, < 1.7)
129
- rubocop-performance (1.5.0)
130
- rubocop (>= 0.71.0)
131
- rubocop-rails (2.3.2)
133
+ unicode-display_width (>= 1.4.0, < 2.0)
134
+ rubocop-ast (1.4.1)
135
+ parser (>= 2.7.1.5)
136
+ rubocop-performance (1.10.1)
137
+ rubocop (>= 0.90.0, < 2.0)
138
+ rubocop-ast (>= 0.4.0)
139
+ rubocop-rails (2.9.1)
140
+ activesupport (>= 4.2.0)
132
141
  rack (>= 1.1)
133
- rubocop (>= 0.72.0)
142
+ rubocop (>= 0.90.0, < 2.0)
134
143
  rubocop-rails_config (0.7.3)
135
144
  railties (>= 3.0)
136
145
  rubocop (~> 0.74)
137
146
  rubocop-performance (~> 1.3)
138
147
  rubocop-rails (~> 2.0)
139
- ruby-progressbar (1.10.1)
140
- safe_yaml (1.0.5)
141
- thor (1.0.1)
148
+ ruby-progressbar (1.11.0)
149
+ thor (1.1.0)
142
150
  thread_safe (0.3.6)
143
- tzinfo (1.2.7)
151
+ tzinfo (1.2.9)
144
152
  thread_safe (~> 0.1)
145
153
  unf (0.1.4)
146
154
  unf_ext
147
155
  unf_ext (0.0.7.7)
148
- unicode-display_width (1.6.0)
156
+ unicode-display_width (1.7.0)
149
157
  vcr (4.0.0)
150
158
  webmock (3.7.6)
151
159
  addressable (>= 2.3.6)
152
160
  crack (>= 0.3.2)
153
161
  hashdiff (>= 0.4.0, < 2.0.0)
154
- zeitwerk (2.4.0)
162
+ zeitwerk (2.4.2)
155
163
 
156
164
  PLATFORMS
157
165
  ruby
data/lib/tezos_client.rb CHANGED
@@ -4,6 +4,8 @@ require "pp"
4
4
  require "active_support/core_ext/hash/indifferent_access"
5
5
  require "active_support/core_ext/string/inflections"
6
6
  require "active_support/core_ext/module/delegation"
7
+ require "active_support/core_ext/time"
8
+ require "active_support/core_ext/array"
7
9
  require "timeout"
8
10
  require "benchmark"
9
11
  require "open3"
@@ -238,7 +238,7 @@ class TezosClient
238
238
  end
239
239
 
240
240
  def ignore_0x(payload)
241
- payload.starts_with?("0x") ? payload[2..-1] : payload
241
+ payload.start_with?("0x") ? payload[2..-1] : payload
242
242
  end
243
243
  end
244
244
  end
@@ -72,7 +72,7 @@ class TezosClient::Tools::AnnotsToType < ActiveInteraction::Base
72
72
 
73
73
  def validate_types
74
74
  allowed_types = TYPES_MAPPING.keys
75
- return if typed_annots.values.map{|type| type.to_s.delete_prefix("optional_").to_sym}.all? { |type| type.in? allowed_types }
75
+ return if typed_annots.values.map{|type| type.to_s.delete_prefix("optional_").to_sym}.all? { |type| allowed_types.include? type }
76
76
 
77
77
  errors.add(:base, "The allowed types are: #{allowed_types.join(', ')}")
78
78
  end
@@ -7,8 +7,8 @@ Dir[File.join(__dir__, "convert_to_hash", "*.rb")].each { |file| require file }
7
7
  class TezosClient
8
8
  module Tools
9
9
  class ConvertToHash < ActiveInteraction::Base
10
- interface :data
11
- interface :type
10
+ interface :data, methods: []
11
+ interface :type, methods: []
12
12
 
13
13
  def execute
14
14
  TezosClient::Tools::ConvertToHash::Base.new(data: data, type: type).value
@@ -8,6 +8,8 @@ class TezosClient
8
8
  if data.key? :int
9
9
  Time.zone.at(data[:int].to_i)
10
10
  elsif data.key? :string
11
+ return Time.zone.at(data[:string].to_i) if data[:string].match?(/\A\d+\z/)
12
+
11
13
  Time.zone.parse(data[:string])
12
14
  else
13
15
  raise "Can not convert timestamp: #{data}"
@@ -13,7 +13,7 @@ class TezosClient::Tools::HashToMicheline < ActiveInteraction::Base
13
13
  # spending_ref: "toto",
14
14
  # expires_at: Time.now
15
15
  # }
16
- interface :params
16
+ interface :params, methods: []
17
17
  hash :storage_type, strip: false, default: {}
18
18
  interface :blockchain_client, methods: %i[entrypoint entrypoints select_entrypoint], default: -> { TezosClient.new }
19
19
 
@@ -5,7 +5,7 @@ class TezosClient
5
5
  class HashToMicheline < ActiveInteraction::Base
6
6
  class Signature < Base
7
7
  def encode
8
- raise "#{data} does not seem to be a signature" unless data.starts_with?("edsig")
8
+ raise "#{data} does not seem to be a signature" unless data.start_with?("edsig")
9
9
  { string: data }
10
10
  end
11
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TezosClient
4
- VERSION = "1.3.3"
4
+ VERSION = "1.3.4"
5
5
  end
data/tezos_client.gemspec CHANGED
@@ -41,7 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency "vcr", "~> 4.0.0"
42
42
  spec.add_development_dependency "pry"
43
43
 
44
- spec.add_dependency "active_interaction", "~> 3.7"
44
+ spec.add_dependency "active_interaction", "> 3.8"
45
45
  spec.add_dependency "base58", "~> 0.2.3"
46
46
  spec.add_dependency "httparty", "~> 0.17.0"
47
47
  spec.add_dependency "rbnacl", "~> 5.0.0"
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.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Michard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-15 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: active_interaction
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">"
116
116
  - !ruby/object:Gem::Version
117
- version: '3.7'
117
+ version: '3.8'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">"
123
123
  - !ruby/object:Gem::Version
124
- version: '3.7'
124
+ version: '3.8'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: base58
127
127
  requirement: !ruby/object:Gem::Requirement