def init_with_components(version: CURRENT_VERSION,  inputs: [],  outputs: [], lock_time: 0)
      @version   = version   || CURRENT_VERSION
      @inputs    = inputs    || []
      @outputs   = outputs   || []
      @lock_time = lock_time || 0
      @inputs.each_with_index do |txin, i|
        txin.transaction = self
        txin.index = i
      end
      @outputs.each_with_index do |txout, i|
        txout.transaction = self
        txout.index = i
      end
    end
def init_with_components(version: CURRENT_VERSION,  inputs: [],  outputs: [], lock_time: 0)
      @version   = version   || CURRENT_VERSION
      @inputs    = inputs    || []
      @outputs   = outputs   || []
      @lock_time = lock_time || 0
      @inputs.each_with_index do |txin, i|
        txin.transaction = self
        txin.index = i
      end
      @outputs.each_with_index do |txout, i|
        txout.transaction = self
        txout.index = i
      end
    end
Initializes transaction with its attributes. Every attribute has a valid default value.