def partial_verify_asset_transaction(asset_transaction)
      raise ArgumentError, "Asset Transaction is missing" if !asset_transaction

      # 1. Verify issuing transactions and collect transfer outputs
      cache_transactions do
        if !verify_issues(asset_transaction)
          return nil
        end

        # No transfer outputs, this transaction is verified.
        # If there are assets on some inputs, they are destroyed.
        if asset_transaction.transfer_outputs.size == 0
          # We keep inputs unverified to indicate that they were not even processed.
          return []
        end

        # 2. Fetch parent transactions to verify.
        # * Verify inputs from non-OpenAsset transactions.
        # * Return OA transactions for verification.
        # * Link each input to its OA transaction output.
        prev_unverified_atxs_by_hash = {}
        asset_transaction.inputs.each do |ain|
          txin = ain.transaction_input
          # Ask source if it has a cached verified transaction for this input.
          prev_atx = @source.verified_asset_transaction_for_hash(txin.previous_hash)
          if prev_atx
            BTC::Invariant(prev_atx.verified?, "Cached verified tx must be fully verified")
          end
          prev_atx ||= prev_unverified_atxs_by_hash[txin.previous_hash]
          if !prev_atx
            prev_tx = transaction_for_input(txin)
            if !prev_tx
              Diagnostics.current.add_message("Failed to load previous transaction for input #{ain.index}: #{txin.previous_id}")
              return nil
            end
            begin
              prev_atx = AssetTransaction.new(transaction: prev_tx)
              prev_unverified_atxs_by_hash[prev_atx.transaction_hash] = prev_atx
            rescue FormatError => e
              # Previous transaction is not a valid Open Assets transaction,
              # so we mark the input as uncolored and verified as such.
              ain.asset_id = nil
              ain.value = nil
              ain.verified = true
            end
          end
          # Remember a reference to this transaction so we can validate the whole `asset_transaction` when all previous ones are set and verified.
          ain.previous_asset_transaction = prev_atx
        end # each input

        # Return all unverified transactions.
        # Note: this won't include the already verified one.
        prev_unverified_atxs_by_hash.values
      end
    end
def partial_verify_asset_transaction(asset_transaction)
      raise ArgumentError, "Asset Transaction is missing" if !asset_transaction

      # 1. Verify issuing transactions and collect transfer outputs
      cache_transactions do
        if !verify_issues(asset_transaction)
          return nil
        end

        # No transfer outputs, this transaction is verified.
        # If there are assets on some inputs, they are destroyed.
        if asset_transaction.transfer_outputs.size == 0
          # We keep inputs unverified to indicate that they were not even processed.
          return []
        end

        # 2. Fetch parent transactions to verify.
        # * Verify inputs from non-OpenAsset transactions.
        # * Return OA transactions for verification.
        # * Link each input to its OA transaction output.
        prev_unverified_atxs_by_hash = {}
        asset_transaction.inputs.each do |ain|
          txin = ain.transaction_input
          # Ask source if it has a cached verified transaction for this input.
          prev_atx = @source.verified_asset_transaction_for_hash(txin.previous_hash)
          if prev_atx
            BTC::Invariant(prev_atx.verified?, "Cached verified tx must be fully verified")
          end
          prev_atx ||= prev_unverified_atxs_by_hash[txin.previous_hash]
          if !prev_atx
            prev_tx = transaction_for_input(txin)
            if !prev_tx
              Diagnostics.current.add_message("Failed to load previous transaction for input #{ain.index}: #{txin.previous_id}")
              return nil
            end
            begin
              prev_atx = AssetTransaction.new(transaction: prev_tx)
              prev_unverified_atxs_by_hash[prev_atx.transaction_hash] = prev_atx
            rescue FormatError => e
              # Previous transaction is not a valid Open Assets transaction,
              # so we mark the input as uncolored and verified as such.
              ain.asset_id = nil
              ain.value = nil
              ain.verified = true
            end
          end
          # Remember a reference to this transaction so we can validate the whole `asset_transaction` when all previous ones are set and verified.
          ain.previous_asset_transaction = prev_atx
        end # each input

        # Return all unverified transactions.
        # Note: this won't include the already verified one.
        prev_unverified_atxs_by_hash.values
      end
    end
Returns a list of asset transactions remaining to verify.
 Returns an empty array if verification succeeded and there is nothing more to verify.
 Returns `nil` if verification failed.