istox 0.1.60.5 → 0.1.60.6

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: c307c9b81b85cc265c521853ce4bd540e281b45b3f16020e74247d73e32675d9
4
- data.tar.gz: 0d3ba881da02b940a706b827c36bb49958f7059e7f5f888d3cba9bb290ae5242
3
+ metadata.gz: 8cdf272a1081f16e82eeaad5bb12d7fd0cc2ae904c65228f50f5e7975b49ef41
4
+ data.tar.gz: e7c6ba7c362e57114bfa7c49f13dd7528ae5d92bca317e9f65270475099e19e1
5
5
  SHA512:
6
- metadata.gz: 15df9e5beace3307bacaff3d3a981a8834f0db22901ed77b0d243f41b03f85863d9ccb65cf5da70bc932e95d2aab249126048e67766506c82af1a61d9e4ac28d
7
- data.tar.gz: 985eda3f477887ef3ae7e8c5420b12c77df3e872223657f9d3934de5514895b845d1bf2969e9e61f862a14e36087c08b2e959617ffb8bd7169b7f63804997422
6
+ metadata.gz: 5eb428b1900eff36660ef4cc2bc7fcd0abcb35c83c08ba8dcb60a31d11c6df13e721a46b0dfb52808043b7fb8525506e3a7fd7fccbfa3befdff7fb8a5f8e240b
7
+ data.tar.gz: 239a0d3037071f6d0a1c13320da19b27639373e9d2b586cad70936445852036456eb433a5dcc58224b3cd7cf0982a4628d124c22a2c2d9d5ed29700c4a10a929
@@ -2,15 +2,17 @@ module Istox
2
2
  class BlockchainHashHandler
3
3
  class << self
4
4
  def hash_generated(data, payload_target)
5
- receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid).first
6
- if receipt.nil?
7
- puts 'Transaction doesnt belong here, skipping...'
8
- return
9
- end
10
-
11
- # sid cannot be nil
12
- update_receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid, txhash: nil).where.not(sid: nil).first
13
- update_receipt.update!(txhash: data.txnHash)
5
+ ActiveRecord::Base.transaction do
6
+ receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid).first
7
+ if receipt.nil?
8
+ puts 'Transaction doesnt belong here, skipping...'
9
+ return
10
+ end
11
+
12
+ # sid cannot be nil
13
+ update_receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid, txhash: nil).where.not(sid: nil).first
14
+ update_receipt.update!(txhash: data.txnHash)
15
+ end
14
16
  end
15
17
  end
16
18
  end
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = "0.1.60.5"
2
+ VERSION = "0.1.60.6"
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.60.5
4
+ version: 0.1.60.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng