sibit 0.12.6 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/cli.feature +5 -1
- data/lib/sibit/btc.rb +5 -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: e93c805c891cda23a83a22d1b2672e8bee9f50cd6bd6cdce29e5554f782faa4a
|
4
|
+
data.tar.gz: 1dbfc35d75a85cc9fa4c480429357f2361f588307ca87ee740a10acdfa558d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba8615db5e241046b2c47f11cb5c238973d39753eda17b96ecd942c385e680204bf4a5aeb2af2a247d7c8fac7f7f5963bd4761c009715ae65f7cb7e7055aa0b6
|
7
|
+
data.tar.gz: 02d888118626eb0cda9b9d282a310f33e1fc28cd587a7de871a2d2a283d60ac82c84e3b4a14c150a28201db085b11ca00a0c8a05f8bd0fbe449f96920ee2d44a
|
data/features/cli.feature
CHANGED
@@ -11,7 +11,11 @@ Feature: Command Line Processing
|
|
11
11
|
Then Exit code is zero
|
12
12
|
|
13
13
|
Scenario: Bitcoin latest block hash can be retrieved
|
14
|
-
When I run bin/sibit with "latest"
|
14
|
+
When I run bin/sibit with "latest --api=blockchain"
|
15
|
+
Then Exit code is zero
|
16
|
+
|
17
|
+
Scenario: Bitcoin latest block hash can be retrieved via Btc
|
18
|
+
When I run bin/sibit with "latest --api=btc"
|
15
19
|
Then Exit code is zero
|
16
20
|
|
17
21
|
Scenario: Bitcoin private key can be generated
|
data/lib/sibit/btc.rb
CHANGED
@@ -70,7 +70,11 @@ class Sibit
|
|
70
70
|
|
71
71
|
# Gets the hash of the latest block.
|
72
72
|
def latest
|
73
|
-
|
73
|
+
uri = URI('https://chain.api.btc.com/v3/block/latest')
|
74
|
+
json = Sibit::Json.new(http: @http, log: @log).get(uri)
|
75
|
+
hash = json['data']['hash']
|
76
|
+
@log.info("The hash of the latest block is #{hash}")
|
77
|
+
hash
|
74
78
|
end
|
75
79
|
end
|
76
80
|
end
|
data/lib/sibit/version.rb
CHANGED