istox 0.1.43 → 0.1.43.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: 88f804800fe5806da1be32b8f6b8510d4935937f81d0f37a7cdf2e70fdbb77e3
4
- data.tar.gz: 13b4692c747648fb8ff21426b4c322fc50cdaf8b417039d6ddaaf8a5fadedcd3
3
+ metadata.gz: 0aa87b2bc48c22e22b0ab966cc84e90c31460e05ede59e88f1eb1eb59a6a968f
4
+ data.tar.gz: 96d7899a4cc9c6e22fb93808a011a6b29d6156931b05d3300bb9199bba06f8b4
5
5
  SHA512:
6
- metadata.gz: 5d63ab6ab5288527e9aef9ecfff3fd02848fd9eaa254f235e1189eb4a80b42309189f97e4ab23c613126c4c2b8397160eaa268366b7a8f9c564fc059ca5fa661
7
- data.tar.gz: 82b14b0b6fd2f4fb1998e8e40785b62c660083b81b8a58edb85e45fc8cc043eb7b0f1419dfba6af7566c8593c52e53736e7f889f73f7809289793c4d31c5b41c
6
+ metadata.gz: 40bd8a884b772acfb263768f70536f22391c44d4f8310d9cc647d1d9be98e931f59933927826ebcf33109c493a8806331692487d02690b0d164fcdb7700cefbe
7
+ data.tar.gz: 724c2cb868f6545d9b779b57145c5414a48cf5315bac330a894b8edf8db16398fec05b7106a2b03c4c7db042cd10d8b46903555c289e22a6322c222fdfd01f81
data/README.md CHANGED
@@ -4,4 +4,4 @@ to publish new version
4
4
 
5
5
  2. gem build istox
6
6
 
7
- 3. gem publish istox-<VERSION>.gem
7
+ 3. gem push istox-<VERSION>.gem
@@ -0,0 +1,18 @@
1
+ module Istox
2
+ class BlockchainHashHandler
3
+ class << self
4
+ def hash_generated(transactions)
5
+ transactions.each do |transaction|
6
+ receipt = ::Istox::BlockchainReceipt.where(txid: transaction[:id], txhash: nil).first
7
+
8
+ if receipt.nil?
9
+ puts 'Transaction not found, skipping...'
10
+ next
11
+ end
12
+ receipt.update!(txhash: transaction[:hash])
13
+ end
14
+ end
15
+
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ module Istox
2
+ module Interfaces
3
+ module Chainhub
4
+ class Transaction
5
+ class << self
6
+ def get_block_transactions(txhashes)
7
+ query = <<-'GRAPHQL'
8
+ query($hashes: [String!]!) {
9
+ blockTransactions(hashes: $hashes) {
10
+ txhash
11
+ state
12
+ }
13
+ }
14
+ GRAPHQL
15
+
16
+ ::Istox::GraphqlClient.query("chainhub", query, { hashes: txhashes }).data.block_transactions
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = "0.1.43"
2
+ VERSION = "0.1.43.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.43
4
+ version: 0.1.43.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
@@ -223,6 +223,7 @@ files:
223
223
  - bin/setup
224
224
  - istox.gemspec
225
225
  - lib/istox.rb
226
+ - lib/istox/consumers/blockchain_hash_handler.rb
226
227
  - lib/istox/consumers/blockchain_status_handler.rb
227
228
  - lib/istox/helpers/blockchain_receipt_service.rb
228
229
  - lib/istox/helpers/bunny_boot.rb
@@ -231,6 +232,7 @@ files:
231
232
  - lib/istox/helpers/message_service.rb
232
233
  - lib/istox/helpers/order_book.rb
233
234
  - lib/istox/helpers/publisher.rb
235
+ - lib/istox/interfaces/chainhub/transaction.rb
234
236
  - lib/istox/migrations/create_blockchain_receipts.rb
235
237
  - lib/istox/models/blockchain_receipt.rb
236
238
  - lib/istox/models/concerns/blockchain_receipt_query.rb