tezos_client 0.4.7 → 0.4.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a21029dab6eb8b945102361e51011ad6a580d80cee4bffe390b3280ccc901976
4
- data.tar.gz: 8c1fa53542e21120978dc47629709b32f0ecbfc944ced46a7b85e434d2051260
3
+ metadata.gz: c91c8a1a25ddbd83a4e012ded7f1a05a2fdc97c08218f6b91affcf5ecf67551c
4
+ data.tar.gz: 76ca606aa726bb45322b9967c0ac8c3719bb7cd605b58e9d10a68982f4be2ca1
5
5
  SHA512:
6
- metadata.gz: 7a0bbbdaca9dd25288db693b6543b4c6c7be52927f8a423704e85633cd51028b14c5d502ea75798365891a9ed5f89e6cce7a4e6076c1df86963bb29423cdd5a3
7
- data.tar.gz: a9e05d491808f5ddb3649bcaf50cba40c9142814966c85deaa35d6a1892d6bc55f419bf02c145c5b50984a0f23d1f7eca957cf210485c000d860b2f2f8756cc5
6
+ metadata.gz: a14e2ec8094a5a882319291ae10b09b3a663ac13c6fad6130f00f48b61b77b067a4c6ce8ce90d2289a5613724a33f42c17225dfda689195d5551592f22b5664c
7
+ data.tar.gz: 7f44696344a7197c8d32716e8f4ab2bbc43b6176802815d588dd4adbe7062f4be17adeb5b8cda1e7c223ba3d268a58f7cf2789b53b19257b3e9a93c6682b8328
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tezos_client (0.4.7)
4
+ tezos_client (0.4.8)
5
5
  activesupport (~> 5.2.3)
6
6
  base58 (~> 0.2.3)
7
7
  bip_mnemonic (~> 0.0.2)
data/README.md CHANGED
@@ -126,6 +126,17 @@ TezosClient.new.call_contract(
126
126
  )
127
127
  ```
128
128
 
129
+ ## Options
130
+
131
+ ### Liquidity options
132
+
133
+ `TezosClient.new(..., liquidity_options: { options... })`
134
+
135
+ Available options :
136
+
137
+ * verbose (boolean) : enable verbose mode of Liquidity commands.
138
+
139
+
129
140
  ## Development
130
141
 
131
142
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -4,8 +4,8 @@ class TezosClient
4
4
  class LiquidityInterface
5
5
  # Wrapper used to call the tezos-client binary
6
6
  module LiquidityWrapper
7
- def call_liquidity(command)
8
- cmd = "#{liquidity_cmd} #{command}"
7
+ def call_liquidity(command, verbose: false)
8
+ cmd = "#{liquidity_cmd(verbose: verbose)} #{command}"
9
9
  log cmd
10
10
  Open3.popen3(cmd) do |_stdin, stdout, stderr, wait_thr|
11
11
  err = stderr.read
@@ -26,8 +26,9 @@ class TezosClient
26
26
  end
27
27
  end
28
28
 
29
- def liquidity_cmd
30
- "liquidity --tezos-node #{tezos_node}"
29
+ def liquidity_cmd(verbose:)
30
+ verbose_option = verbose ? "--verbose" : ""
31
+ "liquidity #{verbose_option} --tezos-node #{tezos_node}"
31
32
  end
32
33
  end
33
34
  end
@@ -7,9 +7,12 @@ class TezosClient
7
7
  include Logger
8
8
  include LiquidityWrapper
9
9
 
10
- def initialize(rpc_node_address: "127.0.0.1", rpc_node_port: 8732)
10
+ attr_reader :options
11
+
12
+ def initialize(rpc_node_address: "127.0.0.1", rpc_node_port: 8732, options: {})
11
13
  @rpc_node_address = rpc_node_address
12
14
  @rpc_node_port = rpc_node_port
15
+ @options = options
13
16
  end
14
17
 
15
18
  def format_params(params)
@@ -24,7 +27,7 @@ class TezosClient
24
27
  init_params = format_params(init_params)
25
28
 
26
29
  with_tempfile(".json") do |json_file|
27
- call_liquidity "--source #{from} --json #{script} -o #{json_file.path} --init-storage #{init_params}"
30
+ call_liquidity "--source #{from} --json #{script} -o #{json_file.path} --init-storage #{init_params}", verbose: options[:verbose]
28
31
  JSON.parse json_file.read.strip
29
32
  end
30
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TezosClient
4
- VERSION = "0.4.7"
4
+ VERSION = "0.4.8"
5
5
  end
data/lib/tezos_client.rb CHANGED
@@ -43,9 +43,10 @@ class TezosClient
43
43
 
44
44
  RANDOM_SIGNATURE = "edsigu165B7VFf3Dpw2QABVzEtCxJY2gsNBNcE3Ti7rRxtDUjqTFRpg67EdAQmY6YWPE5tKJDMnSTJDFu65gic8uLjbW2YwGvAZ"
45
45
 
46
- def initialize(rpc_node_address: "127.0.0.1", rpc_node_port: 8732)
46
+ def initialize(rpc_node_address: "127.0.0.1", rpc_node_port: 8732, liquidity_options: {})
47
47
  @rpc_node_address = rpc_node_address
48
48
  @rpc_node_port = rpc_node_port
49
+ @liquidity_options = liquidity_options
49
50
 
50
51
  @client_config_file = ENV["TEZOS_CLIENT_CONFIG_FILE"]
51
52
  @client_interface = ClientInterface.new(
@@ -59,7 +60,8 @@ class TezosClient
59
60
 
60
61
  @liquidity_interface = LiquidityInterface.new(
61
62
  rpc_node_address: @rpc_node_address,
62
- rpc_node_port: @rpc_node_port
63
+ rpc_node_port: @rpc_node_port,
64
+ options: @liquidity_options
63
65
  )
64
66
  end
65
67
 
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: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Michard
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-17 00:00:00.000000000 Z
11
+ date: 2019-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler