katapaty 1.0.6 → 1.1.0

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: 8eb028f176c05a743d9cc340132c736b4a99a846244c07dc11c2807d484675b3
4
- data.tar.gz: b59262cd1ee71fd0726a541cff262b4dba2e8fbb898da029bf0c0fb99a309c2c
3
+ metadata.gz: c343bb08ed79a5ec9358724bdfb29d8c6050467179f36479cb0c5b94429d92d9
4
+ data.tar.gz: 2a7048fdd064e699d904b89a2e793c3181d068d8f75d185f8fec5ce2a26908bc
5
5
  SHA512:
6
- metadata.gz: 29a27392bdd0688ef8a2461c3378e15d408a22e6df1ca6fbc42d8f9b5a946347c3d65af4e4416ab67f79fb9f789e0f45e61af7b338f70eb014daba862be06fe4
7
- data.tar.gz: e8f70a0877121a2f923a6b5fe396991a84274e3532fd6ae88077e4f97f2343e7d44bf72738315553785f3f37e5704aeee557b1b428d0aa5946f040fdda5938de
6
+ metadata.gz: 4659f173babc0f1a74ae257c99ee27dac48af777fd9c23e95eaba3f5472a7dab8fd98282d793253ecc4c28f8f144f3b53d5614169ae3cd03ea0f0e9b6e2d1d7a
7
+ data.tar.gz: 901c1caf9c4906f0610f91d241f535d4dc50544ac6575190e04604db05cc591a0aeda78f9e730856ddf0015b5935630905e82b750b26ddc7338b34db7635f22c
@@ -7,7 +7,7 @@ module Katapaty
7
7
  class << self
8
8
 
9
9
  def request(method_name, params={})
10
- client = RestClient::Resource.new Katapaty.configuration.counterblock_url
10
+ client = RestClient::Resource.new(Katapaty.configuration.counterblock_url, timeout: Katapaty.configuration.timeout)
11
11
  request = { method: method_name, params: params, jsonrpc: '2.0', id: '0' }.to_json
12
12
  response = JSON.parse client.post(
13
13
  request,
@@ -25,7 +25,7 @@ module Katapaty
25
25
  end
26
26
 
27
27
  def proxy_to_cp(method:, params: {})
28
- client = RestClient::Resource.new Katapaty.configuration.counterblock_url
28
+ client = RestClient::Resource.new(Katapaty.configuration.counterblock_url, timeout: Katapaty.configuration.timeout)
29
29
  request = { method: :proxy_to_counterpartyd, params: { method: method, params: params }, jsonrpc: '2.0', id: '0' }.to_json
30
30
  response = JSON.parse client.post(
31
31
  request,
@@ -8,7 +8,10 @@ module Katapaty
8
8
  :block_password,
9
9
  :block_host,
10
10
  :block_port,
11
- :ssl
11
+ :ssl,
12
+ :timeout
13
+
14
+ DEFAULT_TIMEOUT_IN_SECONDS = 60
12
15
 
13
16
  def counterparty_url
14
17
  return 'http://rpc:1234@public.coindaddy.io:14000/api/' unless @host
@@ -22,6 +25,10 @@ module Katapaty
22
25
  "#{protocol}://#{authen}#{@block_host}:#{@block_port}/api/"
23
26
  end
24
27
 
28
+ def timeout
29
+ @timeout || DEFAULT_TIMEOUT_IN_SECONDS
30
+ end
31
+
25
32
  private
26
33
 
27
34
  def protocol
@@ -54,7 +54,7 @@ module Katapaty
54
54
  end
55
55
 
56
56
  def request(method_name, payload={})
57
- client = RestClient::Resource.new Katapaty.configuration.counterparty_url
57
+ client = RestClient::Resource.new(Katapaty.configuration.counterparty_url, timeout: Katapaty.configuration.timeout)
58
58
  request = { method: method_name.to_s, params: payload, jsonrpc: '2.0', id: '0' }.to_json
59
59
  response = JSON.parse client.post(request,
60
60
  accept: 'json',
@@ -1,3 +1,3 @@
1
1
  module Katapaty
2
- VERSION = "1.0.6"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katapaty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - longhoang.wkm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-22 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler