Class: Graphdb::Model::TxIn

Inherits:
ActiveNodeBase show all
Defined in:
lib/graphdb/model/tx_in.rb

Class Method Summary collapse

Methods inherited from ActiveNodeBase

remove_module

Class Method Details

.create_from_hash(hash) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/graphdb/model/tx_in.rb', line 19

def self.create_from_hash(hash)
  tx_in = new
  tx_in.txid = hash['txid']
  tx_in.vout = hash['vout']
  if hash['scriptSig']
    tx_in.script_sig_asm = hash['scriptSig']['asm']
    tx_in.script_sig_hex = hash['scriptSig']['hex']
  end
  tx_in.coinbase = hash['coinbase']
  tx_in.sequence = hash['sequence']
  tx_in.save!
  tx_in
end