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 +4 -4
- data/README.md +1 -1
- data/lib/istox/consumers/blockchain_hash_handler.rb +18 -0
- data/lib/istox/interfaces/chainhub/transaction.rb +22 -0
- data/lib/istox/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aa87b2bc48c22e22b0ab966cc84e90c31460e05ede59e88f1eb1eb59a6a968f
|
4
|
+
data.tar.gz: 96d7899a4cc9c6e22fb93808a011a6b29d6156931b05d3300bb9199bba06f8b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40bd8a884b772acfb263768f70536f22391c44d4f8310d9cc647d1d9be98e931f59933927826ebcf33109c493a8806331692487d02690b0d164fcdb7700cefbe
|
7
|
+
data.tar.gz: 724c2cb868f6545d9b779b57145c5414a48cf5315bac330a894b8edf8db16398fec05b7106a2b03c4c7db042cd10d8b46903555c289e22a6322c222fdfd01f81
|
data/README.md
CHANGED
@@ -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
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
|