istox 0.1.131 → 0.1.132

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: 04eb6fe45e9b4ba3087d12878f510283eab4f481d333e238d05ff251ed02742d
4
- data.tar.gz: ec2331196b3e126c2113535533c4054f078109b299ef786230baad798ad192fc
3
+ metadata.gz: c6f9c10ee44d70a98501078da3d052b9533b1920c24ac42b41bce9aa42b209a5
4
+ data.tar.gz: 6a126fcc4c28acf5b0630fb5002a4b61157d189f11a96cdeb17021678c70c52c
5
5
  SHA512:
6
- metadata.gz: 731df9ba5b436d2955e7977d15a777297730df6b191d7378fab454a07628eceab8305b2eb817742485492d67ddd4fd24515442624271fcefa6a659e2d7cf73df
7
- data.tar.gz: 83a9b14d3e8905a5e6859b14b44d6d4dc1aa8f569e008207285c98a90a6128988c8b5547ce2894907fc55cd26f130dbdf540a229c7488675d817ea6b47fd85c7
6
+ metadata.gz: e5f9014a153df8032a28aeca26c3df5ccefcc47e432376faef69c1c7c9bcc309bb5f7baa3423d8476d90b14e6fd974efd64592d8d2713f5a410b14ca22cb25d3
7
+ data.tar.gz: 2b315e6851f32cd28de13f9b54355ee3acf480a89dab4fb6e956670eaf73b4f158a954bbbed21332dd3fb3450e949f73606bf4fad8a78a00196c0a6b2e23d6c5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.130)
4
+ istox (0.1.131)
5
5
  awesome_print
6
6
  binding_of_caller
7
7
  bunny (>= 2.12.0)
@@ -23,7 +23,7 @@ module Istox
23
23
  # create blockchain receipt first
24
24
  klass = blockchain_receipt_class
25
25
  uuid = ::SecureRandom.uuid
26
- @receipt = klass.create!(
26
+ receipt = klass.create!(
27
27
  txid: uuid,
28
28
  sid: sid,
29
29
  is_request: is_request,
@@ -40,7 +40,7 @@ module Istox
40
40
  klass.where(resource_name: model.class.name, resource_id: model.id).destroy_all
41
41
 
42
42
  # then update receipt
43
- @receipt.update!(resource_id: model.id, resource_name: model.class.name)
43
+ receipt.update!(resource_id: model.id, resource_name: model.class.name)
44
44
 
45
45
  # execute the actual call to chainhub
46
46
  result = execute.call(uuid)
@@ -50,7 +50,7 @@ module Istox
50
50
  count = result.send('txn_count')
51
51
 
52
52
  if count.to_i <= 0
53
- @receipt&.destroy!
53
+ receipt&.destroy!
54
54
  chainhub_processing = false
55
55
  end
56
56
  end
@@ -58,7 +58,7 @@ module Istox
58
58
 
59
59
  chainhub_processing
60
60
  rescue StandardError => e
61
- @receipt&.destroy
61
+ receipt&.destroy
62
62
  raise e
63
63
  end
64
64
 
@@ -67,9 +67,7 @@ module Istox
67
67
 
68
68
  blockchain_receipt_klass = get_blockchain_receipt_klass
69
69
  klass = class_eval("::#{blockchain_receipt_klass.name}", __FILE__, __LINE__)
70
- unless klass <= ::Istox::BlockchainReceipt
71
- raise "#{blockchain_receipt_klass.name} does not inherit istox blockchain receipt"
72
- end
70
+ raise "#{blockchain_receipt_klass.name} does not inherit istox blockchain receipt" unless klass <= ::Istox::BlockchainReceipt
73
71
 
74
72
  klass
75
73
  end
@@ -113,11 +113,11 @@ module Istox
113
113
  end
114
114
 
115
115
  # Initiate klass
116
- ruby_class = ::Istox::BunnyBoot.ruby_class consumer_key
116
+ ruby_class = ::Istox::BunnyBoot.ruby_class(consumer_key) || "#{consumer_key.to_s.underscore}_consumer"
117
117
  @workers = {} if @workers.nil?
118
118
  unless block || @workers[ruby_class]
119
119
  klass = Object.const_get(
120
- '::' + (ruby_class.nil? ? "#{consumer_key.to_s.underscore}_consumer" : ruby_class).camelize
120
+ '::' + (ruby_class).camelize
121
121
  )
122
122
  param = ::Istox::BunnyBoot.queue_worker_param consumer_key
123
123
  if param.nil?
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.131'.freeze
2
+ VERSION = '0.1.132'.freeze
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.131
4
+ version: 0.1.132
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng