tezos_client 1.4.4 → 1.4.5

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: 9ed76e36473e1470004f6e0b00e22be33b3d53a209d5864d50d6dbbf767912e7
4
- data.tar.gz: 9ac9e6b31f46f5fc6fb9147a7394f9fc73b2131228342ed0ecfa74c7c9c3d2dd
3
+ metadata.gz: 5ef43c07cdb05752ac0547f94ca3977cb78fc02d1b8395090577156009a2c003
4
+ data.tar.gz: 40d3bc0b42568d339ba5eec78654448c5b0257dfe40d44e2540723f9cd14d170
5
5
  SHA512:
6
- metadata.gz: 2a0e8a4c78f84ee1ddad295860ebe2e50dbeaa885c490b35f76bf80d89bb8d848e5750981e8e9a8279e1b37121ff75c6efe42af39cb68d4c7a3d80e435797959
7
- data.tar.gz: 9a2f2eec3f07caae8be2e274e74d2118e37312b38cedccc99ac7cfc643583617c1b45671efd03c0feccc135538ce781e8dc35d1273bce458f55a3440355119c4
6
+ metadata.gz: f1c552679ecad0ff4b7945903c019dbe1055fb7d05ee51d5af4d362f14f7bf2d0cc40a5add0e86c4672a7bbd920e39dd9a06e464c3a228a01360551e70d0e8bd
7
+ data.tar.gz: 7f52897c55d933a6034fe0b17255ec6f570dc57a5464e5b2d2341dd8743781362fb101daca8aabac9969aa55e8f4aed4dbf15877cba65081eed10316d575f40e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tezos_client (1.4.4)
4
+ tezos_client (1.4.5)
5
5
  active_interaction (>= 3.8)
6
6
  activesupport (~> 6.0.0)
7
7
  base58 (~> 0.2.3)
@@ -14,15 +14,15 @@ PATH
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- actionpack (6.0.4.4)
18
- actionview (= 6.0.4.4)
19
- activesupport (= 6.0.4.4)
17
+ actionpack (6.0.6)
18
+ actionview (= 6.0.6)
19
+ activesupport (= 6.0.6)
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.4.4)
25
- activesupport (= 6.0.4.4)
24
+ actionview (6.0.6)
25
+ activesupport (= 6.0.6)
26
26
  builder (~> 3.1)
27
27
  erubi (~> 1.4)
28
28
  rails-dom-testing (~> 2.0)
@@ -30,9 +30,9 @@ GEM
30
30
  active_interaction (4.1.0)
31
31
  activemodel (>= 5, < 8)
32
32
  activesupport (>= 5, < 8)
33
- activemodel (6.0.4.4)
34
- activesupport (= 6.0.4.4)
35
- activesupport (6.0.4.4)
33
+ activemodel (6.0.6)
34
+ activesupport (= 6.0.6)
35
+ activesupport (6.0.6)
36
36
  concurrent-ruby (~> 1.0, >= 1.0.2)
37
37
  i18n (>= 0.7, < 2)
38
38
  minitest (~> 5.1)
@@ -45,56 +45,59 @@ GEM
45
45
  bip_mnemonic (0.0.4)
46
46
  builder (3.2.4)
47
47
  coderay (1.1.3)
48
- concurrent-ruby (1.1.9)
48
+ concurrent-ruby (1.1.10)
49
49
  crack (0.4.5)
50
50
  rexml
51
51
  crass (1.0.6)
52
52
  diff-lcs (1.5.0)
53
53
  domain_name (0.5.20190701)
54
54
  unf (>= 0.0.5, < 1.0.0)
55
- erubi (1.10.0)
55
+ erubi (1.11.0)
56
56
  ffi (1.15.5)
57
57
  hashdiff (1.0.1)
58
- http-cookie (1.0.4)
58
+ http-cookie (1.0.5)
59
59
  domain_name (~> 0.5)
60
60
  httparty (0.17.3)
61
61
  mime-types (~> 3.0)
62
62
  multi_xml (>= 0.5.2)
63
- i18n (1.9.1)
63
+ i18n (1.12.0)
64
64
  concurrent-ruby (~> 1.0)
65
- loofah (2.13.0)
65
+ json (2.6.2)
66
+ loofah (2.19.0)
66
67
  crass (~> 1.0.2)
67
68
  nokogiri (>= 1.5.9)
68
69
  method_source (1.0.0)
69
70
  mime-types (3.4.1)
70
71
  mime-types-data (~> 3.2015)
71
72
  mime-types-data (3.2022.0105)
72
- minitest (5.15.0)
73
+ minitest (5.16.3)
73
74
  money-tree (0.10.0)
74
75
  ffi
75
76
  multi_xml (0.6.0)
76
77
  netrc (0.11.0)
77
- nokogiri (1.13.1-x86_64-darwin)
78
+ nokogiri (1.13.8-x86_64-darwin)
78
79
  racc (~> 1.4)
79
- parallel (1.21.0)
80
- parser (3.1.0.0)
80
+ nokogiri (1.13.8-x86_64-linux)
81
+ racc (~> 1.4)
82
+ parallel (1.22.1)
83
+ parser (3.1.2.1)
81
84
  ast (~> 2.4.1)
82
85
  pry (0.14.1)
83
86
  coderay (~> 1.1)
84
87
  method_source (~> 1.0)
85
88
  public_suffix (4.0.6)
86
89
  racc (1.6.0)
87
- rack (2.2.3)
88
- rack-test (1.1.0)
89
- rack (>= 1.0, < 3)
90
+ rack (2.2.4)
91
+ rack-test (2.0.2)
92
+ rack (>= 1.3)
90
93
  rails-dom-testing (2.0.3)
91
94
  activesupport (>= 4.2.0)
92
95
  nokogiri (>= 1.6)
93
- rails-html-sanitizer (1.4.2)
96
+ rails-html-sanitizer (1.4.3)
94
97
  loofah (~> 2.3)
95
- railties (6.0.4.4)
96
- actionpack (= 6.0.4.4)
97
- activesupport (= 6.0.4.4)
98
+ railties (6.0.6)
99
+ actionpack (= 6.0.6)
100
+ activesupport (= 6.0.6)
98
101
  method_source
99
102
  rake (>= 0.8.7)
100
103
  thor (>= 0.20.3, < 2.0)
@@ -102,7 +105,7 @@ GEM
102
105
  rake (13.0.6)
103
106
  rbnacl (5.0.0)
104
107
  ffi
105
- regexp_parser (2.2.0)
108
+ regexp_parser (2.5.0)
106
109
  rest-client (2.0.2)
107
110
  http-cookie (>= 1.0.2, < 2.0)
108
111
  mime-types (>= 1.16, < 4.0)
@@ -121,17 +124,18 @@ GEM
121
124
  diff-lcs (>= 1.2.0, < 2.0)
122
125
  rspec-support (~> 3.11.0)
123
126
  rspec-support (3.11.0)
124
- rubocop (1.25.1)
127
+ rubocop (1.36.0)
128
+ json (~> 2.3)
125
129
  parallel (~> 1.10)
126
- parser (>= 3.1.0.0)
130
+ parser (>= 3.1.2.1)
127
131
  rainbow (>= 2.2.2, < 4.0)
128
132
  regexp_parser (>= 1.8, < 3.0)
129
- rexml
130
- rubocop-ast (>= 1.15.1, < 2.0)
133
+ rexml (>= 3.2.5, < 4.0)
134
+ rubocop-ast (>= 1.20.1, < 2.0)
131
135
  ruby-progressbar (~> 1.7)
132
136
  unicode-display_width (>= 1.4.0, < 3.0)
133
- rubocop-ast (1.15.1)
134
- parser (>= 3.0.1.1)
137
+ rubocop-ast (1.21.0)
138
+ parser (>= 3.1.1.0)
135
139
  rubocop-minitest (0.17.1)
136
140
  rubocop (>= 0.90, < 2.0)
137
141
  rubocop-packaging (0.5.1)
@@ -139,10 +143,10 @@ GEM
139
143
  rubocop-performance (1.13.2)
140
144
  rubocop (>= 1.7.0, < 2.0)
141
145
  rubocop-ast (>= 0.4.0)
142
- rubocop-rails (2.13.2)
146
+ rubocop-rails (2.16.1)
143
147
  activesupport (>= 4.2.0)
144
148
  rack (>= 1.1)
145
- rubocop (>= 1.7.0, < 2.0)
149
+ rubocop (>= 1.33.0, < 2.0)
146
150
  rubocop-rails_config (1.8.2)
147
151
  railties (>= 5.0)
148
152
  rubocop (>= 1.19)
@@ -154,21 +158,22 @@ GEM
154
158
  ruby-progressbar (1.11.0)
155
159
  thor (1.2.1)
156
160
  thread_safe (0.3.6)
157
- tzinfo (1.2.9)
161
+ tzinfo (1.2.10)
158
162
  thread_safe (~> 0.1)
159
163
  unf (0.1.4)
160
164
  unf_ext
161
- unf_ext (0.0.8)
162
- unicode-display_width (2.1.0)
165
+ unf_ext (0.0.8.2)
166
+ unicode-display_width (2.3.0)
163
167
  vcr (4.0.0)
164
168
  webmock (3.14.0)
165
169
  addressable (>= 2.8.0)
166
170
  crack (>= 0.3.2)
167
171
  hashdiff (>= 0.4.0, < 2.0.0)
168
- zeitwerk (2.5.4)
172
+ zeitwerk (2.6.0)
169
173
 
170
174
  PLATFORMS
171
175
  x86_64-darwin-19
176
+ x86_64-linux
172
177
 
173
178
  DEPENDENCIES
174
179
  bundler (~> 2.1)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TezosClient
4
- VERSION = "1.4.4"
4
+ VERSION = "1.4.5"
5
5
  end
data/lib/tezos_client.rb CHANGED
@@ -166,23 +166,23 @@ class TezosClient
166
166
  broadcast_operation(operation: operation, dry_run: dry_run)
167
167
  end
168
168
 
169
- def call_contract(dry_run: false, entrypoint:, params:, params_type:, **args)
170
- _entrypoint = select_entrypoint(
171
- contract_address: args[:to],
172
- entrypoint: entrypoint
173
- )
169
+ def build_transaction(dry_run: false, entrypoint:, params:, params_type:, **args)
170
+ transfer_args = transfer_args(dry_run: dry_run, entrypoint: entrypoint, params: params, params_type:params_type, **args)
174
171
 
175
- json_params = micheline_params(
176
- params: params,
177
- entrypoint: _entrypoint,
178
- params_type: params_type
172
+ transaction = TransactionOperation.new(
173
+ rpc_interface: rpc_interface,
174
+ **transfer_args
179
175
  )
180
176
 
181
- transfer_args = args.merge(
182
- entrypoint: _entrypoint,
183
- parameters: json_params,
184
- dry_run: dry_run
185
- )
177
+ transaction.rpc_operation_args
178
+ end
179
+
180
+ def call_contract(dry_run: false, entrypoint:, params:, params_type:, **args)
181
+ transfer_args = transfer_args(dry_run: dry_run,
182
+ entrypoint: entrypoint,
183
+ params: params,
184
+ params_type:params_type,
185
+ **args)
186
186
 
187
187
  transfer(transfer_args)
188
188
  end
@@ -266,6 +266,26 @@ class TezosClient
266
266
  end
267
267
 
268
268
  private
269
+ def transfer_args(dry_run: false, entrypoint:, params:, params_type:, **args)
270
+ _entrypoint = select_entrypoint(
271
+ contract_address: args[:to],
272
+ entrypoint: entrypoint
273
+ )
274
+
275
+ json_params = micheline_params(
276
+ params: params,
277
+ entrypoint: _entrypoint,
278
+ params_type: params_type
279
+ )
280
+
281
+ args.merge(
282
+ entrypoint: _entrypoint,
283
+ parameters: json_params,
284
+ dry_run: dry_run
285
+ )
286
+ end
287
+
288
+
269
289
  def broadcast_operation(operation:, dry_run:)
270
290
  res = if dry_run
271
291
  operation.simulate
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tezos_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Michard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-04-12 00:00:00.000000000 Z
13
+ date: 2022-09-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler