Module: TezosClient::LiquidityInterface::LiquidityWrapper
- Included in:
- TezosClient::LiquidityInterface
- Defined in:
- lib/tezos_client/liquidity_inteface/liquidity_wrapper.rb
Overview
Wrapper used to call the tezos-client binary
Instance Method Summary collapse
Instance Method Details
#call_liquidity(command) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tezos_client/liquidity_inteface/liquidity_wrapper.rb', line 7 def call_liquidity(command) cmd = "#{liquidity_cmd} #{command}" log cmd Open3.popen3(cmd) do |_stdin, stdout, stderr, wait_thr| err = stderr.read status = wait_thr.value.exitstatus if status != 0 raise "command '#{cmd}' existed with status #{status}: #{err}" end log err output = stdout.read if block_given? yield(output) else output end end end |
#liquidity_cmd ⇒ Object
29 30 31 |
# File 'lib/tezos_client/liquidity_inteface/liquidity_wrapper.rb', line 29 def liquidity_cmd "liquidity --tezos-node #{tezos_node}" end |