Class: Istox::BlockchainHashHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/istox/consumers/blockchain_hash_handler.rb

Class Method Summary collapse

Class Method Details

.hash_generated(data) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/istox/consumers/blockchain_hash_handler.rb', line 4

def hash_generated(data)
  receipt = ::Istox::BlockchainReceipt.where(txid: data.uuid, txhash: nil).first

  if receipt.nil?
    puts 'Transaction not found, skipping...'
    return
  end
  
  receipt.update!(txhash: data.txnHash)
end