Convert ether tx to kundera tx.

@param transactionResult
the transaction result
@return the transaction
492775
public static Transaction convertEtherTxToKunderaTx(TransactionResult transactionResult)
    {

        Transaction kunderaTx = new Transaction();
        TransactionObject txObj = (TransactionObject) transactionResult;

        kunderaTx.setBlockHash(txObj.getBlockHash());
        kunderaTx.setBlockNumber(txObj.getBlockNumberRaw());
        kunderaTx.setCreates(txObj.getCreates());
        kunderaTx.setFrom(txObj.getFrom());
        kunderaTx.setGas(txObj.getGasRaw());
        kunderaTx.setGasPrice(txObj.getGasPriceRaw());
        kunderaTx.setHash(txObj.getHash());
        kunderaTx.setInput(txObj.getInput());
        kunderaTx.setNonce(txObj.getNonceRaw());
        kunderaTx.setPublicKey(txObj.getPublicKey());
        kunderaTx.setR(txObj.getR());
        kunderaTx.setRaw(txObj.getRaw());
        kunderaTx.setS(txObj.getS());
        kunderaTx.setTo(txObj.getTo());
        kunderaTx.setTransactionIndex(txObj.getTransactionIndexRaw());
        kunderaTx.setV(txObj.getV());
        kunderaTx.setValue(txObj.getValueRaw());

        return kunderaTx;

    }
815740
public static TransactionImpl[] getAllTransactions()
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "getAllTransactions");

        final Collection<TransactionImpl> txns = localTIDMap.values();

        if (txns != null)
        {
            if (tc.isEntryEnabled()) Tr.exit(tc, "getAllTransactions", txns);
            return txns.toArray(noTxns);
        }

        if (tc.isEntryEnabled()) Tr.exit(tc, "getAllTransactions", noTxns);
        return noTxns;
    }
232149
public Transaction getTransaction(OTMConnection conn)
    {
        TransactionFactory txFactory = getTransactionFactory();
        Transaction tx = txFactory.getTransactionForConnection(conn);
        tx.setKit(this);
        return tx;
    }
93811
public static TransactionException transactionOpen(TransactionOLTP tx) {
        return create(ErrorMessage.TRANSACTION_ALREADY_OPEN.getMessage(tx.keyspace()));
    }
1347776
@Override
    @Deprecated
    public Transaction<Type> getTxn(UUID txId) {
        StreamSegments segments = getAndHandleExceptions(
                controller.getCurrentSegments(stream.getScope(), stream.getStreamName()), RuntimeException::new);
        Status status = getAndHandleExceptions(controller.checkTransactionStatus(stream, txId), RuntimeException::new);
        if (status != Status.OPEN) {
            return new TransactionImpl<>(txId, controller, stream);
        }
        
        Map<Segment, SegmentTransaction<Type>> transactions = new HashMap<>();
        for (Segment s : segments.getSegments()) {
            SegmentOutputStream out = outputStreamFactory.createOutputStreamForTransaction(s, txId, config, segments.getDelegationToken());
            SegmentTransactionImpl<Type> impl = new SegmentTransactionImpl<>(txId, out, serializer);
            transactions.put(s, impl);
        }
        return new TransactionImpl<Type>(txId, transactions, segments, controller, stream, pinger);
        
    }
47059
protected ConnectionWrapper createConnection(Transaction tx) throws SQLException {
        final XAConnection xaConn = xaDataSource.getXAConnection();
        final Connection conn = xaConn.getConnection();
        final ConnectionWrapper wrapper = createTransactionalConnectionWrapper(xaConn, conn, tx);
        if (logger.isDebugEnabled()) {
            logger.debug("Created physical connection: tx={}, conn={}", tx, conn);
        }
        return wrapper;
    }
1104416
public static BitcoinTransaction convertToBitcoinTransaction(HiveBitcoinTransaction transaction) {
		List<BitcoinTransactionOutput> newTransactionsOutputList = new ArrayList<>();
		for (int j = 0; j < transaction.getListOfOutputs().size(); j++) {
			HiveBitcoinTransactionOutput currentOutput = transaction.getListOfOutputs().get(j);
			newTransactionsOutputList.add(new BitcoinTransactionOutput(currentOutput.getValue().bigDecimalValue().toBigIntegerExact(),
					currentOutput.getTxOutScriptLength(), currentOutput.getTxOutScript()));
		}
		BitcoinTransaction result = new BitcoinTransaction(transaction.getMarker(),transaction.getFlag(),transaction.getVersion(), transaction.getInCounter(), transaction.getListOfInputs(),  transaction.getOutCounter(), newTransactionsOutputList, transaction.getBitcoinScriptWitness(), transaction.getLockTime());
		return result;
	}
64943
public Transaction createTransaction(EvseId evseId) {
        Transaction transaction = new Transaction();
        transaction.setEvseId(evseId);

        transactionRepository.insert(transaction);

        return transaction;
    }
188908
function (txResult) {
    var errorCode = {
      OUT_OF_GAS: 'out of gas',
      STACK_UNDERFLOW: 'stack underflow',
      STACK_OVERFLOW: 'stack overflow',
      INVALID_JUMP: 'invalid JUMP',
      INVALID_OPCODE: 'invalid opcode',
      REVERT: 'revert',
      STATIC_STATE_CHANGE: 'static state change'
    }
    var ret = {
      error: false,
      message: ''
    }
    if (!txResult.result.vm.exceptionError) {
      return ret
    }
    var exceptionError = txResult.result.vm.exceptionError.error || ''
    var error = `VM error: ${exceptionError}.\n`
    var msg
    if (exceptionError === errorCode.INVALID_OPCODE) {
      msg = `\t\n\tThe execution might have thrown.\n`
      ret.error = true
    } else if (exceptionError === errorCode.OUT_OF_GAS) {
      msg = `\tThe transaction ran out of gas. Please increase the Gas Limit.\n`
      ret.error = true
    } else if (exceptionError === errorCode.REVERT) {
      var returnData = txResult.result.vm.return
      // It is the hash of Error(string)
      if (returnData && (returnData.slice(0, 4).toString('hex') === '08c379a0')) {
        var abiCoder = new ethers.utils.AbiCoder()
        var reason = abiCoder.decode(['string'], returnData.slice(4))[0]
        msg = `\tThe transaction has been reverted to the initial state.\nReason provided by the contract: "${reason}".`
      } else {
        msg = `\tThe transaction has been reverted to the initial state.\nNote: The called function should be payable if you send value and the value you send should be less than your current balance.`
      }
      ret.error = true
    } else if (exceptionError === errorCode.STATIC_STATE_CHANGE) {
      msg = `\tState changes is not allowed in Static Call context\n`
      ret.error = true
    }
    ret.message = `${error}${exceptionError}${msg}\tDebug the transaction to get more information.`
    return ret
  }
562835
public RefundQuery refundQueryByTransactionId(String transactionId) {
        RefundQueryRequestWrapper refundQueryRequestWrapper = new RefundQueryRequestWrapper();
        refundQueryRequestWrapper.setTransactionId(transactionId);
        return refundQuery(refundQueryRequestWrapper);
    }
285113
public Transaction get( Transaction transaction ) {
    return RestfulUtils.show( TransactionService.PATH, transaction, Transaction.class, super.httpClient );
  }
1297022
@Override
	public TransactionId getTransIdFromByte(byte[] transId) {
		
		ByteBuffer byteBuffer = ByteBuffer.wrap(transId);
		int appId = getUnsignedShort(byteBuffer);
		int busCode = getUnsignedShort(byteBuffer);
		long trxId = byteBuffer.getLong();
		
		return new TransactionId(codecer.findString(APP_ID, appId), codecer.findString(BUSINESS_CODE, busCode), trxId);
	}
491980
@Override
    public void bind(TransactionResource resource)
    {
        // Not checking for type of TransactionRes
        if (resource != null && resource instanceof RedisTransaction)
        {
            this.resource = resource;
        }
        else
        {
            throw new KunderaTransactionException("Invalid transaction resource provided:" + resource
                    + " Should have been an instance of :" + RedisTransaction.class);
        }
    }
422913
public Dispatchable addDispatchableForOptimizedLocalTransaction(int transactionId) {
        if (tc.isEntryEnabled())
            SibTr.entry(this, tc, "addDispatchableForOptimizedLocalTransaction", "" + transactionId);
        final Dispatchable result = addDispatchableForLocalTransaction(transactionId);
        if (tc.isEntryEnabled())
            SibTr.exit(this, tc, "addDispatchableForOptimizedLocalTransaction", result);
        return result;
    }
537090
protected <RESULT> RESULT performTx(TransactionShow<RESULT> txLambda, TransactionManagerAdapter adapter, TransactionGenre genre)
            throws Throwable {
        final BegunTx<RESULT> tx = newBegunTransaction(genre);
        BegunTxContext.setBegunTxOnThread(tx);
        try {
            txLambda.perform(tx);
            if (tx.isRollbackOnly()) { // e.g. when validation error
                adapter.setRollbackOnly();
            }
            return tx.getResult();
        } catch (Throwable e) {
            // same as DefaultTransactionCallback
            // forcedly roll-backed if exception in 'required' transaction scope
            adapter.setRollbackOnly();
            throw e;
        } finally {
            BegunTxContext.clearBegunTxOnThread();
        }
    }
492657
public synchronized Token get(Object key,
                                  Transaction transaction)
                    throws ObjectManagerException
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this,
                        cclass,
                        "get",
                        new Object[] { key,
                                      transaction });

        Entry entry = getEntry(key, transaction);
        Token value = null;
        if (entry != null)
            value = entry.getValue();

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this,
                       cclass,
                       "get",
                       new Object[] { entry, value });
        return value;
    }
911480
private J2EETransactionImpl newInternTransaction()
    {
        if (log.isDebugEnabled()) log.debug("obtain new intern odmg-transaction");
        J2EETransactionImpl tx = new J2EETransactionImpl(this);
        try
        {
            getConfigurator().configure(tx);
        }
        catch (ConfigurationException e)
        {
            throw new OJBRuntimeException("Cannot create new intern odmg transaction", e);
        }
        return tx;
    }