sibit 0.14.1 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sibit/bitcoinchain.rb +3 -1
- data/lib/sibit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80dd8e6fa8034a499c63c15f1333cf366800c85da969af2891b392cc7a09c6ac
|
4
|
+
data.tar.gz: f8126179a4de258e575daf7dc04e9e21cd5bd31c214699573366b7ede67eacca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ba3f4cd38f43af06f5399caf63be7e48cbcfa63192ceec6c42d892d92800863773e482cbc3a431ba4843042db85b970950d65bbc4c299cf0ec18fc81f2456ab
|
7
|
+
data.tar.gz: b6a759fc3c29c1ca6d6cfad246501ca36abfc81f7ef4caebdcf0e77ed462e0a97328e61d3dfac23d47f56b7a5d6fc8e1ecc44e0cf3267eb86d5512c379fb03ee
|
data/lib/sibit/bitcoinchain.rb
CHANGED
@@ -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