So you have a Transaction#tx_id and you want to know what the operation was
 that lead to it.  Well, that's tricky because all of the ops are in their
 own tables.  This method will (slowly) try to find the appropriate table.
184983
def op
      retries = 0
      puts type
      # Here, we map the type to class name, if supported.  Most of them can be
      # mapped automatically, e.g. "vote" => "Vote" but some types share tables
      # with one another.  We also use timestamps to narrow the search
      # parameters, for all the good it does.  We use the expiration minus the
      # maximum TaPoS window.
      op_type = case type
      when 'account_create_with_delegation', 'create_claimed_account' then 'AccountCreate'
      when 'comment_options' then 'CommentOption'
      when 'custom_json' then 'Custom'
      when 'delegate_vesting_shares' then 'DelegateVestingShare'
      when 'feed_publish' then 'Feed'
      when 'limit_order_create', 'limit_order_create2' then 'LimitOrder'
      when 'Pow2' then 'Pow'
      when 'set_withdraw_vesting_route' then 'WithdrawVestingRoute'
      when 'transfer_from_savings', 'transfer_to_vesting' then 'Transfer'
      when 'withdraw_vesting' then 'Withdraw'
      when *%w(
        cancel_transfer_from_savings change_recovery_account claim_account
        decline_voting_rights limit_order_cancel recover_account
        request_account_recovery witness_set_properties
      ) then raise "Unsupported: #{type}"
      else; type.split('_').collect(&:capitalize).join
      end
      
      tapos_window_start = expiration - 28800.seconds
      ops = Tx.const_get(op_type).where(tx_id: self).
        where("timestamp BETWEEN ? AND ?", tapos_window_start, expiration)
      
      loop do
        retries += 1
        op = ops.first
        
        return op if !!op
        break if retries > 10
        
        sleep 3
      end
      
      raise "Unable to find #{type} for tx_id: #{tx_id}"
    end
510982
function GetTransactionDetails($txnID) {
    if ($this->_mode == 'payflow') {
      $values['ORIGID'] = $txnID;
      $values['TENDER'] = 'C';
      $values['TRXTYPE'] = 'I';
      $values['VERBOSITY'] = 'MEDIUM';
    } elseif ($this->_mode == 'nvp') {
      $values['TRANSACTIONID'] = $txnID;
    }
    return $this->_request($values, 'GetTransactionDetails');
  }
846056
synchronized List<Long> addUpdates(long txId, TxContext txContext, boolean isTrialRun) {
		if (isSingleSession) {
			//no need to record history
			return null;
		}
		
		ArrayList<TxObjInfo> updatesAndDeletes = txContext.getUpdatesAndDeletes();
		
		//first, check for conflicts
		ArrayList<Long> conflicts = null;
		for (TxObjInfo clientInfo: updatesAndDeletes) {
			long oid = clientInfo.getOid();
			long ots = clientInfo.getTS();
			//At this point we should not ignore objects that are apparently new!
			//Why? Even if the object appears new, the OID may be in use, which 
			//may present a conflict.

			TxObjInfo serverInfo = updateSummary.get(oid);
			//OLD:
			//Did the current transaction begin before the other was committed?
			//I.e. is the updateTimeStamp higher than the readTimeStamp of the current TX?
			//NEW: We just check whether the cached TS equals the expected TS. 
			//If not, we have a conflict. Note, that the new timestamp may be LOWER than the
			//cached timestamp if the object was updated AFTER the current TX started, but
			//before the current TX first accessed the object.
			//System.out.println("TxM-au: " + oid + " ots=" + ots + "   txTS=" + (serverInfo != null?serverInfo.getTS():"null"));
			if (serverInfo != null && serverInfo.getTxId() != ots) {
				if (clientInfo.isDeleted() && serverInfo.isDeleted()) {
					//okay, ignore
					//continue;
					//TODO For now we don't ignore these. To ignore these, we have to report back
					//so that there will be no attempts on updating any indexes. Furthermore,
					//it is not obvious that this is the right thing to do, because the TX may 
					//semantically rely on having deleted an object, however the object is already 
					//gone (for example if the number of deleted objects counts).
				}
				if (conflicts == null) {
					conflicts = new ArrayList<>();
				}
				conflicts.add(oid);
			}
		}
		if (conflicts != null || isTrialRun) {
			return conflicts;
		}
		
		//apply updates
		updateHistory.put(txId, updatesAndDeletes);
		for (TxObjInfo info: updatesAndDeletes) {
			// +1 to ensure conflicts even with latest transaction
			info.setTxId(txId);
			updateSummary.put(info.getOid(), info);
		}
		//not very clean: 'null' indicates no conflicts.
		return null;
	}
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)
1309114
def _ExecuteTransaction(self, transaction):
    """"""

    def Action(connection):
      connection.cursor.execute("START TRANSACTION")
      for query in transaction:
        connection.cursor.execute(query["query"], query["args"])
      connection.cursor.execute("COMMIT")
      return connection.cursor.fetchall()

    return self._RetryWrapper(Action)
388472
def rpc_get_subdomain_ops_at_txid(self, txid, **con_info):
        
        if not check_string(txid, min_length=64, max_length=64, pattern='^[0-9a-fA-F]{64}$'):
            return {'error': 'Not a valid txid', 'http_status': 400}
       
        subdomain_ops = get_subdomain_ops_at_txid(txid)
        return self.success_response( {'subdomain_ops': subdomain_ops} )
691307
function tableCheckup() {
    global $db, $sniffer;
    $fieldOkay1 = (method_exists($sniffer, 'field_type')) ? $sniffer->field_type(TABLE_AUTHORIZENET, 'transaction_id', 'bigint(20)', true) : -1;
    if ($fieldOkay1 !== true) {
      $db->Execute("ALTER TABLE " . TABLE_AUTHORIZENET . " CHANGE transaction_id transaction_id bigint(20) default NULL");
    }
  }
134853
def to_dict(self):
        
        if self.txid is None and self.output is None:
            return None
        else:
            return {
                'transaction_id': self.txid,
                'output_index': self.output,
            }
1196696
def parse_transaction_id(self, data):
        ""
        if data[0] == TDS_ERROR_TOKEN:
            raise self.parse_error('begin()', data)
        t, data = _parse_byte(data)
        assert t == TDS_ENVCHANGE_TOKEN
        _, data = _parse_int(data, 2)   # packet length
        e, data = _parse_byte(data)
        assert e == TDS_ENV_BEGINTRANS
        ln, data = _parse_byte(data)
        assert ln == 8                  # transaction id length
        return data[:ln], data[ln:]
528781
def resolve_class(operation):
        """"""

        create_txn_class = Transaction.type_registry.get(Transaction.CREATE)
        return Transaction.type_registry.get(operation, create_txn_class)
758801
public synchronized boolean isSettlementTransaction(Transaction tx) {
        try {
            tx.verify();
            tx.getInput(0).verify(getContractInternal().getOutput(0));
            return true;
        } catch (VerificationException e) {
            return false;
        }
    }
144966
protected int getTransactionIsolation() {
		String val = props.get(PROPS_TRANSACTION_ISOLATION);
		return val == null ? -1 : Integer.parseInt(val);
	}
7065
def _ops_to_requests(self, ops):
        
        request_ops = []
        for op in ops:
            if isinstance(op, transactions.Put):
                request = self._build_put_request(op.key, op.value,
                                                  op.lease, op.prev_kv)
                request_op = etcdrpc.RequestOp(request_put=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Get):
                request = self._build_get_range_request(op.key, op.range_end)
                request_op = etcdrpc.RequestOp(request_range=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Delete):
                request = self._build_delete_request(op.key, op.range_end,
                                                     op.prev_kv)
                request_op = etcdrpc.RequestOp(request_delete_range=request)
                request_ops.append(request_op)

            elif isinstance(op, transactions.Txn):
                compare = [c.build_message() for c in op.compare]
                success_ops = self._ops_to_requests(op.success)
                failure_ops = self._ops_to_requests(op.failure)
                request = etcdrpc.TxnRequest(compare=compare,
                                             success=success_ops,
                                             failure=failure_ops)
                request_op = etcdrpc.RequestOp(request_txn=request)
                request_ops.append(request_op)

            else:
                raise Exception(
                    'Unknown request class {}'.format(op.__class__))
        return request_ops
102399
def get_transactions_details(tx_hash_list, coin_symbol='btc', limit=None, api_key=None):
    

    for tx_hash in tx_hash_list:
        assert is_valid_hash(tx_hash)
    assert is_valid_coin_symbol(coin_symbol)

    if len(tx_hash_list) == 0:
        return []
    elif len(tx_hash_list) == 1:
        return [get_transaction_details(tx_hash=tx_hash_list[0],
                                        coin_symbol=coin_symbol,
                                        limit=limit,
                                        api_key=api_key
                                        )]

        url = make_url(coin_symbol, **dict(txs=';'.join(tx_hash_list)))

    params = {}
    if api_key:
        params['token'] = api_key
    if limit:
        params['limit'] = limit

    r = requests.get(url, params=params, verify=True, timeout=TIMEOUT_IN_SECONDS)
    response_dict_list = get_valid_json(r)

    cleaned_dict_list = []

    for response_dict in response_dict_list:
        if 'error' not in response_dict:
            if response_dict['block_height'] > 0:
                response_dict['confirmed'] = parser.parse(response_dict['confirmed'])
            else:
                # Blockcypher reports fake times if it's not in a block
                response_dict['confirmed'] = None
                response_dict['block_height'] = None

            # format this string as a datetime object
            response_dict['received'] = parser.parse(response_dict['received'])
        cleaned_dict_list.append(response_dict)

    return cleaned_dict_list
110365
public TableInfo getTableInfo(String tblName, Transaction tx) {
		// Optimization:
		TableInfo resultTi = tiMap.get(tblName);
		if (resultTi != null)
			return resultTi;

		RecordFile tcatfile = tcatInfo.open(tx, true);
		tcatfile.beforeFirst();
		boolean found = false;
		while (tcatfile.next()) {
			String t = (String) tcatfile.getVal(TCAT_TBLNAME).asJavaVal();
			if (t.equals(tblName)) {
				found = true;
				break;
			}
		}
		tcatfile.close();
		// return null if table is undefined
		if (!found)
			return null;

		RecordFile fcatfile = fcatInfo.open(tx, true);
		fcatfile.beforeFirst();
		Schema sch = new Schema();
		while (fcatfile.next())
			if (((String) fcatfile.getVal(FCAT_TBLNAME).asJavaVal())
					.equals(tblName)) {
				String fldname = (String) fcatfile.getVal(FCAT_FLDNAME)
						.asJavaVal();
				int fldtype = (Integer) fcatfile.getVal(FCAT_TYPE).asJavaVal();
				int fldarg = (Integer) fcatfile.getVal(FCAT_TYPEARG)
						.asJavaVal();
				sch.addField(fldname, Type.newInstance(fldtype, fldarg));
			}
		fcatfile.close();
		// Optimization:
		resultTi = new TableInfo(tblName, sch);
		tiMap.put(tblName, resultTi);
		return resultTi;
	}
1080034
def getTransactionByBlock(self, block_identifier, transaction_index):
        
        method = select_method_for_block_identifier(
            block_identifier,
            if_predefined='eth_getTransactionByBlockNumberAndIndex',
            if_hash='eth_getTransactionByBlockHashAndIndex',
            if_number='eth_getTransactionByBlockNumberAndIndex',
        )
        result = self.web3.manager.request_blocking(
            method,
            [block_identifier, transaction_index],
        )
        if result is None:
            raise TransactionNotFound(
                f"Transaction index: {transaction_index} "
                f"on block id: {block_identifier} not found."
            )
        return result
662091
function getId (transaction) {
	var hash = crypto.createHash('sha256').update(getBytes(transaction).toString('hex'), 'hex').digest();
	var temp = new Buffer(8);
	for (var i = 0; i < 8; i++) {
		temp[i] = hash[7 - i];
	}

	var id = bignum.fromBuffer(temp).toString();
	return id;
}