sibit 0.21.5 → 0.21.6

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: e9a648e75088ba27f0c8c0f70ffa0bff4eab4aad0942f2c5f8b51b9eccb39109
4
- data.tar.gz: 2682a77e3eefe9fe800dce91f3497d36a6fd6d81910c3e9f005d207b2022245f
3
+ metadata.gz: 5fedd8437c2839f08b7848a6451cadf574a59cb8fa4ea4ef98440612f031d240
4
+ data.tar.gz: b847db96a5b91a8b8c361d52d554573b6c1aea0ab340df3b410731bc7d7ed4a4
5
5
  SHA512:
6
- metadata.gz: 75579cc314eddf9d74f26d74f6ea68f1ad0e7148e5f1111b61d97b1cb6d3ec4e5c6c275074ce5d70dfd2071abb0c7436c6b408dfedae773394b63ffbc2d3dce6
7
- data.tar.gz: 598291e668fc4aca8a2ab25e159458a0d6f47c2f856e1eb529b1d0d3d55ccaa0f86d004442906ba9ac0b8079067c6a866b76f3854bcdcdefe8bdd78225b0d1f0
6
+ metadata.gz: 354a33e9fd0e1fb0360f4f0e80f29f1aa60de51e0dfa25ae8d6434a2547570fa814645c26b66f6c572b0e50ada6fa0121086fe328a5351a8b6fc70445d4705d5
7
+ data.tar.gz: ae351875b79a6ea30c026ac788780b3c15efd390ec67f4fc6ff9481b248d18671d813ce62687c0832bea0144416e55bd93973e4ab77b1c2f29dc389098f04486
data/lib/sibit.rb CHANGED
@@ -221,10 +221,15 @@ class Sibit
221
221
  checked += 1
222
222
  end
223
223
  count += 1
224
- @log.info("We checked #{checked} txns and #{checked_outputs} outputs in block #{block}")
224
+ @log.info("We checked #{checked} txns and #{checked_outputs} outputs
225
+ in block #{block} (by #{json[:provider]})")
225
226
  block = json[:next]
226
227
  if block.nil?
227
- @log.info("The next_block is empty in block #{json[:hash]}, this is the end of Blockchain")
228
+ @log.info("The next_block is empty in #{json[:hash]}, this may be the end of Blockchain...")
229
+ block = @api.next_of(json[:hash])
230
+ end
231
+ if block.nil?
232
+ @log.info("The block #{json[:hash]} is definitely the end of Blockchain, we stop.")
228
233
  break
229
234
  end
230
235
  if count > max
@@ -121,6 +121,7 @@ class Sibit
121
121
  nxt = head['next_block']
122
122
  nxt = nil if nxt == '0000000000000000000000000000000000000000000000000000000000000000'
123
123
  {
124
+ provider: self.class.name,
124
125
  hash: head['hash'],
125
126
  orphan: !head['is_main'],
126
127
  next: nxt,
@@ -139,6 +139,7 @@ class Sibit
139
139
  Iri.new('https://blockchain.info/rawblock').append(hash)
140
140
  )
141
141
  {
142
+ provider: self.class.name,
142
143
  hash: json['hash'],
143
144
  orphan: !json['main_chain'],
144
145
  next: json['next_block'][0],
data/lib/sibit/btc.rb CHANGED
@@ -74,7 +74,7 @@ class Sibit
74
74
  balance
75
75
  end
76
76
 
77
- # Get hash of the block after this one.
77
+ # Get hash of the block after this one, or NIL if it's the last one in Blockchain.
78
78
  def next_of(hash)
79
79
  head = Sibit::Json.new(http: @http, log: @log).get(
80
80
  Iri.new('https://chain.api.btc.com/v3/block').append(hash)
@@ -162,6 +162,7 @@ class Sibit
162
162
  nxt = data['next_block_hash']
163
163
  nxt = nil if nxt == '0000000000000000000000000000000000000000000000000000000000000000'
164
164
  {
165
+ provider: self.class.name,
165
166
  hash: data['hash'],
166
167
  orphan: data['is_orphan'],
167
168
  next: nxt,
@@ -119,6 +119,7 @@ class Sibit
119
119
  headers: headers
120
120
  )['payload']
121
121
  {
122
+ provider: self.class.name,
122
123
  hash: head['hash'],
123
124
  orphan: false,
124
125
  next: head['nextblockhash'],
data/lib/sibit/fake.rb CHANGED
@@ -64,6 +64,7 @@ class Sibit
64
64
 
65
65
  def block(hash)
66
66
  {
67
+ provider: self.class.name,
67
68
  hash: hash,
68
69
  orphan: false,
69
70
  next: hash,
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.21.5'
29
+ VERSION = '0.21.6'
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.5
4
+ version: 0.21.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace