istox 0.1.84 → 0.1.85.pre.test1

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: 854004247090c0884aa24fa0c77208e6cad407509e24762291d1c1080e9d387c
4
- data.tar.gz: e4a725fb85ecc5f84361da376613e2202a1e43bbcec39bbd831c3d1808f8fd5a
3
+ metadata.gz: 1dcd810577ffd0c7b57c7727b3f1eff90af5adf4d51f6a7a5e7b6579b05dded9
4
+ data.tar.gz: c7687fc0a5d2598cf353c843b8b5801299bf3c792465764963158f3af2f5b9d1
5
5
  SHA512:
6
- metadata.gz: b207971e2dc4c7b7239f216c3a9275ba70bed62288b8f010f78058c508fa7041c0c521ae0d276ce2f93a8d29affea1f9ef206032792cee3b26a060b4e03f1f3a
7
- data.tar.gz: c2f77e3c9af27b0a7327128496960a518b714d9f71876156e1a886ec7b0c1c87c56c45357bf46c50d79943cb5559ddc28eddf3051a99e0af76f16db016208068
6
+ metadata.gz: 9790119d241a18a535aff32c2102fae262e4ac694b55652c9aef41be53932639af17188fd835638e5b76a4e92e5ab9bfb87caa49d0e5b4fb1e131771f64d12e8
7
+ data.tar.gz: 589078155df41802b63561f887c3e8ad1742243afb659069e91e50ab138f433a7d4ae9b6ea336b49ea8aa22207d2299b5b7f6439931bf906869de7b12fd36c4b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.83)
4
+ istox (0.1.84)
5
5
  binding_of_caller
6
6
  bunny (>= 2.12.0)
7
7
  graphlient
@@ -28,8 +28,8 @@ module Istox
28
28
  require 'istox/models/blockchain_receipt'
29
29
  require 'istox/models/concerns/blockchain_receipt_query'
30
30
  require 'istox/consumers/blockchain_status_handler'
31
- require 'istox/migrations/create_blockchain_receipts'
31
+ require 'istox/inherited_migrations/create_blockchain_receipts'
32
32
  require 'istox/logging/hash_logging'
33
33
  require 'istox/logging/log_formatter'
34
- require "istox/quant/bond"
34
+ require 'istox/quant/bond'
35
35
  end
@@ -30,6 +30,8 @@ module Istox
30
30
  resource_action: action
31
31
  )
32
32
 
33
+ chainhub_processing = true
34
+
33
35
  ::ActiveRecord::Base.transaction do
34
36
  # execute before proc, and get the model that blockchain receipt should bind to
35
37
  model = before.call(uuid)
@@ -41,8 +43,20 @@ module Istox
41
43
  @receipt.update!(resource_id: model.id, resource_name: model.class.name)
42
44
 
43
45
  # execute the actual call to chainhub
44
- execute.call(uuid)
46
+ result = execute.call(uuid)
47
+
48
+ # no need to create a receipt if txn count is zero
49
+ if result.respond_to?('txn_count')
50
+ count = result.send('txn_count')
51
+
52
+ if count.to_i <= 0
53
+ @receipt&.destroy!
54
+ chainhub_processing = false
55
+ end
56
+ end
45
57
  end
58
+
59
+ chainhub_processing
46
60
  rescue StandardError => e
47
61
  @receipt&.destroy
48
62
  raise e
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.84'.freeze
2
+ VERSION = '0.1.85-test1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.84
4
+ version: 0.1.85.pre.test1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-16 00:00:00.000000000 Z
11
+ date: 2019-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -302,10 +302,10 @@ files:
302
302
  - lib/istox/helpers/order_book.rb
303
303
  - lib/istox/helpers/publisher.rb
304
304
  - lib/istox/helpers/vault.rb
305
+ - lib/istox/inherited_migrations/create_blockchain_receipts.rb
305
306
  - lib/istox/interfaces/chainhub/transaction.rb
306
307
  - lib/istox/logging/hash_logging.rb
307
308
  - lib/istox/logging/log_formatter.rb
308
- - lib/istox/migrations/create_blockchain_receipts.rb
309
309
  - lib/istox/models/blockchain_receipt.rb
310
310
  - lib/istox/models/concerns/blockchain_receipt_query.rb
311
311
  - lib/istox/quant/bond.rb
@@ -324,9 +324,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
324
324
  version: '0'
325
325
  required_rubygems_version: !ruby/object:Gem::Requirement
326
326
  requirements:
327
- - - ">="
327
+ - - ">"
328
328
  - !ruby/object:Gem::Version
329
- version: '0'
329
+ version: 1.3.1
330
330
  requirements: []
331
331
  rubygems_version: 3.0.6
332
332
  signing_key: