def set_script_sigs(*input_args, &block)
      # No sense trying to authorize when the transaction isn't usable.
      report = validate_syntax
      unless report[:valid] == true
        raise "Invalid syntax:  #{report[:errors].to_json}"
      end

      # Array#zip here allows us to iterate over the inputs in lockstep with any
      # number of sets of values.
      self.inputs.zip(*input_args) do |input, *input_arg|
        input.script_sig = yield input, *input_arg
      end
    end
def set_script_sigs(*input_args, &block)
      # No sense trying to authorize when the transaction isn't usable.
      report = validate_syntax
      unless report[:valid] == true
        raise "Invalid syntax:  #{report[:errors].to_json}"
      end

      # Array#zip here allows us to iterate over the inputs in lockstep with any
      # number of sets of values.
      self.inputs.zip(*input_args) do |input, *input_arg|
        input.script_sig = yield input, *input_arg
      end
    end
A convenience method for authorizing inputs in a generic manner.
 Rather than iterating over the inputs manually, the user can
 provide this method with an array of values and a block that
 knows what to do with the values.

 For example, if you happen to have the script sigs precomputed
 for some strange reason, you could do this:

   tx.set_script_sigs sig_array do |input, sig|
     sig
   end

 More realistically, if you have an array of the keypairs corresponding
 to the inputs:

   tx.set_script_sigs keys do |input, key|
     sig_hash = tx.sig_hash(input)
     key.sign(sig_hash)
   end

 Each element of the array may be an array, which allows for easy handling
 of multisig situations.