Returns whether the transaction is in a valid batch.

        Args:
            txn_id (str): The transaction header signature.

        Returns:
            (bool): True if the txn's batch is valid, False otherwise.
974581
def _txn_is_in_valid_batch(self, txn_id):
        

        batch = self._batches_by_txn_id[txn_id]

        # Return whether every transaction in the batch with a
        # transaction result is valid
        return all(
            self._txn_results[sig].is_valid
            for sig in set(self._txn_results).intersection(
                (txn.header_signature for txn in batch.transactions)))
565808
def get(self, tx_id):
        
        pool = current_app.config['bigchain_pool']

        with pool() as bigchain:
            tx = bigchain.get_transaction(tx_id)

        if not tx:
            return make_error(404)

        return tx.to_dict()
26035
def next_valid_batch(self, batch_size):
        
        start = self.index_in_valid_epoch
        if self.index_in_valid_epoch + batch_size > self.num_valid_images:
            batch_size = 1
        self.index_in_valid_epoch += batch_size
        end = self.index_in_valid_epoch
        return self.valid_labels[start:end], self.img_norm(self.valid_images[start:end]), end, batch_size
25066
def notify_batch_pending(self, batch):
        
        txn_ids = {t.header_signature for t in batch.transactions}
        with self._lock:
            self._pending.add(batch.header_signature)
            self._batch_info[batch.header_signature] = txn_ids
            self._update_observers(batch.header_signature,
                                   ClientBatchStatus.PENDING)
114502
def _isNewTxn(self, identifier, reply, txnId) -> bool:
        
        return (identifier not in self.processedRequests or
                reply.reqId not in self.processedRequests[identifier]) and \
            txnId is not None
626399
def get_outputs_from_txid(txid, use_cache = false)
      tx = get_tx(txid, use_cache)
      outputs = get_color_outputs_from_tx(tx)
      outputs.map.with_index{|out, i|out.to_hash.merge({'txid' => tx.hash, 'vout' => i})}
    end
178794
def in_transaction(self):
        
        self._in_transaction = self._in_transaction and self.is_connected
        return self._in_transaction
912855
def check_tx(self, raw_transaction):
        

        self.abort_if_abci_chain_is_not_synced()

        logger.debug('check_tx: %s', raw_transaction)
        transaction = decode_transaction(raw_transaction)
        if self.bigchaindb.is_valid_transaction(transaction):
            logger.debug('check_tx: VALID')
            return ResponseCheckTx(code=CodeTypeOk)
        else:
            logger.debug('check_tx: INVALID')
            return ResponseCheckTx(code=CodeTypeError)
767737
def validate_id(tx_body):
        
        # NOTE: Remove reference to avoid side effects
        # tx_body = deepcopy(tx_body)
        tx_body = rapidjson.loads(rapidjson.dumps(tx_body))

        try:
            proposed_tx_id = tx_body['id']
        except KeyError:
            raise InvalidHash('No transaction id found!')

        tx_body['id'] = None

        tx_body_serialized = Transaction._to_str(tx_body)
        valid_tx_id = Transaction._to_hash(tx_body_serialized)

        if proposed_tx_id != valid_tx_id:
            err_msg = ("The transaction's id '{}' isn't equal to "
                       "the hash of its body, i.e. it's not valid.")
            raise InvalidHash(err_msg.format(proposed_tx_id))
145789
def is_deposit_confirmed(
        channel_state: NettingChannelState,
        block_number: BlockNumber,
) -> bool:
    
    if not channel_state.deposit_transaction_queue:
        return False

    return is_transaction_confirmed(
        channel_state.deposit_transaction_queue[0].block_number,
        block_number,
    )
1061558
def _check_id_validity(self, p_ids):
        
        errors = []
        valid_ids = self.todolist.ids()

        if len(p_ids) == 0:
            errors.append('No todo item was selected')
        else:
            errors = ["Invalid todo ID: {}".format(todo_id)
                      for todo_id in p_ids - valid_ids]

        errors = '\n'.join(errors) if errors else None
        return errors
731807
def get_asset_id(self, tx_id):
        
        tx = self.driver.instance.transactions.retrieve(txid=tx_id)
        assert tx is not None
        return tx['id'] if tx['operation'] == 'CREATE' else tx['asset']['id']
1301773
public static boolean isActive(Transaction tx)
   {
      if (tx == null)
         return false;
      
      try
      {
         int status = tx.getStatus();

         return status == Status.STATUS_ACTIVE;
      }
      catch (SystemException error)
      {
         throw new RuntimeException("Error during isActive()", error);
      }
   }
669618
def valid_batch(self):
        

        valid_fns = list(zip(*self.corpus.get_valid_fns()))
        return self.load_batch(valid_fns)
1089682
def Verify(self, mempool):
        
        logger.info("Verifying transaction: %s " % self.Hash.ToBytes())

        return Helper.VerifyScripts(self)
819532
def get_status(self, batch_id):
        
        with self._lock:
            if self._batch_committed(batch_id):
                return ClientBatchStatus.COMMITTED
            if batch_id in self._invalid:
                return ClientBatchStatus.INVALID
            if batch_id in self._pending:
                return ClientBatchStatus.PENDING
            return ClientBatchStatus.UNKNOWN
924684
def workflow_validate_batch(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/validateBatch' % object_id, input_params, always_retry=always_retry, **kwargs)