sibit 0.21.0 → 0.21.1

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: b6560adb5310350a01c7d22c8fa4dd58abc73e9c60c737117d8929cc1a77bdc1
4
- data.tar.gz: 31f7e57e269801972b5e3f8cb11f29d9ff847a214b29f488c0a809bc35d0341e
3
+ metadata.gz: 7f5aa35b76dae1b83f707bb8fb83778b440c3a360be0d488528a75fa54ec8a4c
4
+ data.tar.gz: 0addf6b95dcdacaa73bef4587ba3e3b434314a9064d8905a3fac76c47a60eb0d
5
5
  SHA512:
6
- metadata.gz: 87d170b48eca5cd5ecd76d6e60bbf9b2fb5575f1e203a92aab6d10547fcfbf9043f30e55d12f21e45ff6929ab46538a2c56edd103df8e48cc0e621fca1810fe2
7
- data.tar.gz: 910666d824ba0e74414e39a51d18b3e5fbbeae6af37cd4c8d15cf27e2b591a1b3d0b992f98b324e3c43dc0fa07ae5a5d19e0bb403f5958242e2f47a2eaeb412a
6
+ metadata.gz: 15685ed9d9b96ec1e50005e9fdc5f84ccfb57e70a31fa319a8065b6312e31b326b981c8c100e5a015bfcd90c37411ccd3f36c7bf736ec004a4a450eadcbaf005
7
+ data.tar.gz: ce65b2ff52d59493c73aa43bae875608483767d2033b34070ab8ec25832a6ec68aa3a9fb391a697871bbe9ce61ee57fde78577df9dd4a55d53d0d04f4eeecc9a
@@ -62,8 +62,12 @@ class Sibit
62
62
  json = Sibit::Json.new(http: @http, log: @log).get(
63
63
  URI("https://blockchain.info/rawblock/#{hash}")
64
64
  )
65
- nxt = json['next_block']
66
- @log.info("The next block of #{hash} is #{nxt}")
65
+ nxt = json['next_block'][0]
66
+ if nxt.nil?
67
+ @log.info("There is no block after #{hash}")
68
+ else
69
+ @log.info("The next block of #{hash} is #{nxt}")
70
+ end
67
71
  nxt
68
72
  end
69
73
 
@@ -26,5 +26,5 @@
26
26
  # License:: MIT
27
27
  class Sibit
28
28
  # Current version of the library.
29
- VERSION = '0.21.0'
29
+ VERSION = '0.21.1'
30
30
  end
@@ -34,7 +34,7 @@ class TestBlockchain < Minitest::Test
34
34
  def test_fetch_block
35
35
  hash = '0000000000000000000f676241aabc9b62b748d26192a44bc25720c34de27d19'
36
36
  stub_request(:get, "https://blockchain.info/rawblock/#{hash}")
37
- .to_return(body: '{"next_block": "n", "prev_block": "p", "hash": "h",
37
+ .to_return(body: '{"next_block": ["n"], "prev_block": "p", "hash": "h",
38
38
  "tx": [{"hash": "h1", "out": [{"hash": "oh", "value": 123}]}]}')
39
39
  sibit = Sibit::Blockchain.new
40
40
  json = sibit.block(hash)
@@ -49,7 +49,7 @@ class TestBlockchain < Minitest::Test
49
49
  def test_next_of
50
50
  hash = '0000000000000000000f676241aabc9b62b748d26192a44bc25720c34de27d19'
51
51
  stub_request(:get, "https://blockchain.info/rawblock/#{hash}")
52
- .to_return(body: '{"next_block": "nxt"}')
52
+ .to_return(body: '{"next_block": ["nxt"]}')
53
53
  sibit = Sibit::Blockchain.new
54
54
  nxt = sibit.next_of(hash)
55
55
  assert_equal('nxt', nxt)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.21.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko