istox 0.1.43.12 → 0.1.44

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: 66d89dfab32d78e8b9dca04177ab440e2c5292e7b0aa6e17ff5d0df43d1ced6c
4
- data.tar.gz: 72429bf39891372f4e4358670182deeaf60012be7e2b5c1ce8d7b9e04aaa060a
3
+ metadata.gz: d284e11ec21a267732521aa16f60cefc5d7d1efa69cf3b96bed1cc7ced004014
4
+ data.tar.gz: 236be580fa06fc556dab64853fd8e48dc1b05c988b75d00a535c2be3a077fd37
5
5
  SHA512:
6
- metadata.gz: 1edf9f9c90f039bf716e63e23dac99bc1677bb2e069f2bd1621e075dd139fed235d3906a99e83fcda23c770f03f73ea51b1c316a03323ec071e04222760162c0
7
- data.tar.gz: c29a3d7c46df76584aab162f06ec20f4da0509124466a7a12ffc56ad3981fb053dc32b6ad6c13b134f0ed464ccaa57d1d268aea25f8a871477aca25e2caf5de6
6
+ metadata.gz: 6ad5ad56023548b15ee8172ec7c03982f60d15c74ecc71c616e04a7ed6d46e642306d1761c6f8be2ea099c7be82d3f9d4ffd3b8ad65f9cac4560ffd757177423
7
+ data.tar.gz: 417cf3903c36b166abce744be293dff76ad32c18293fc508e7c0bf42003e5d3b8f2050706387912d1ff68bfa174a7e9e5e851abf0f5af7c142734992747dd3f5
@@ -1,17 +1,18 @@
1
1
  module Istox
2
2
  class BlockchainHashHandler
3
3
  class << self
4
- def hash_generated(data)
5
- receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid, txhash: nil).first
6
-
7
- if receipt.nil?
8
- puts 'Transaction not found, skipping...'
4
+ def hash_generated(data, payload_target, target)
5
+ if payload_target != target
6
+ puts 'Transaction doesnt belong to this target, skipping...'
9
7
  return
10
8
  end
11
-
9
+
10
+ receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid, txhash: nil).first
11
+ if receipt.nil?
12
+ raise 'Unable to find receipt, will retry later.'
13
+ end
12
14
  receipt.update!(txhash: data.txnHash)
13
15
  end
14
-
15
16
  end
16
17
  end
17
18
  end
@@ -1,15 +1,22 @@
1
1
  module Istox
2
2
  class BlockchainStatusHandler
3
3
  class << self
4
- def txn_status_changed(transactions)
4
+ def txn_status_changed(transactions, payload_target, target)
5
+ if payload_target != target
6
+ puts 'Transaction doesnt belong to this target, skipping...'
7
+ return
8
+ end
9
+
10
+ # pre check all transaction does exists
5
11
  transactions.each do |transaction|
6
-
7
12
  receipt = ::Istox::BlockchainReceipt.where(txhash: transaction.id).first
8
-
9
13
  if receipt.nil?
10
- puts 'Transaction not found, skipping...'
11
- next
14
+ raise 'Unable to find receipt, will retry later.'
12
15
  end
16
+ end
17
+
18
+ transactions.each do |transaction|
19
+ receipt = ::Istox::BlockchainReceipt.where(txhash: transaction.id).first
13
20
 
14
21
  find_resource(transaction) do |receipt, resource_name, resource_id, resource_action, sid|
15
22
  resource = begin
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = "0.1.43.12"
2
+ VERSION = "0.1.44"
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.43.12
4
+ version: 0.1.44
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-04-14 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny