sibit 0.14.1 → 0.14.2

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: bd4e6a52e607ad9aa2101cd65545bc5002f530b493ddb2ba1abb33db17745f8a
4
- data.tar.gz: 80086103804e4f181dc848e9b864327d2bfb467f2e2a1173ad1e3192d4156f25
3
+ metadata.gz: 80dd8e6fa8034a499c63c15f1333cf366800c85da969af2891b392cc7a09c6ac
4
+ data.tar.gz: f8126179a4de258e575daf7dc04e9e21cd5bd31c214699573366b7ede67eacca
5
5
  SHA512:
6
- metadata.gz: 24c6913f48638f43374e3f7c65efb1bc7df1c34714e9f1bf0939cf7cd47a3e9a1e6021de09db6cb528c7f12046b0d17d060153f548d0b92d4c1b614e8bf4642e
7
- data.tar.gz: c7518ebc0681367f2983ae9ced5227479829c370b882e11280ea238703196e77550c6ce5e71f37e55b8e0a13e3a9565323b090a25346fdcd775c043761b1aac1
6
+ metadata.gz: 8ba3f4cd38f43af06f5399caf63be7e48cbcfa63192ceec6c42d892d92800863773e482cbc3a431ba4843042db85b970950d65bbc4c299cf0ec18fc81f2456ab
7
+ data.tar.gz: b6a759fc3c29c1ca6d6cfad246501ca36abfc81f7ef4caebdcf0e77ed462e0a97328e61d3dfac23d47f56b7a5d6fc8e1ecc44e0cf3267eb86d5512c379fb03ee
@@ -72,11 +72,13 @@ class Sibit
72
72
  )['hash']
73
73
  end
74
74
 
75
- # This method should fetch a Blockchain block and return as a hash.
75
+ # This method should fetch a Blockchain block and return as a hash. Raises
76
+ # an exception if the block is not found.
76
77
  def block(hash)
77
78
  head = Sibit::Json.new(http: @http, log: @log).get(
78
79
  URI("https://api-r.bitcoinchain.com/v1/block/#{hash}")
79
80
  )[0]
81
+ raise Sibit::Error, "The block #{hash} is not found" if head.nil?
80
82
  nxt = head['next_block']
81
83
  nxt = nil if nxt == '0000000000000000000000000000000000000000000000000000000000000000'
82
84
  {
data/lib/sibit/version.rb CHANGED
@@ -26,5 +26,5 @@
26
26
  # License:: MIT
27
27
  class Sibit
28
28
  # Current version of the library.
29
- VERSION = '0.14.1'
29
+ VERSION = '0.14.2'
30
30
  end
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.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko