def add_input(input, network: @network)
      # TODO: allow specifying prev_tx and index with a Hash.
      # Possibly stop using SparseInput.

      input = Input.new(input.merge(transaction: self,
                                    index: @inputs.size,
                                    network: network)
                       ) unless input.is_a?(Input)

      @inputs << input
      self.update_native do |native|
        native.add_in input.native
      end
      input
    end
def add_input(input, network: @network)
      # TODO: allow specifying prev_tx and index with a Hash.
      # Possibly stop using SparseInput.

      input = Input.new(input.merge(transaction: self,
                                    index: @inputs.size,
                                    network: network)
                       ) unless input.is_a?(Input)

      @inputs << input
      self.update_native do |native|
        native.add_in input.native
      end
      input
    end
Takes one of

 * an instance of Input
 * an instance of Output
 * a Hash describing an Output