4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/istox/consumers/blockchain_hash_handler.rb', line 4
def hash_generated(data, payload_target)
receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid).first
if receipt.nil?
puts 'Transaction doesnt belong here, skipping...'
return
end
update_receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid, txhash: nil).where.not(sid: nil).first
raise "Unable to find receipt to update" if update_receipt.blank?
update_receipt.update!(txhash: data.txnHash)
end
|