Search in sources :

Example 16 with TransactionResultCapsule

use of org.tron.core.capsule.TransactionResultCapsule in project java-tron by tronprotocol.

the class Manager method processTransaction.

/**
 * Process transaction.
 */
public boolean processTransaction(final TransactionCapsule trxCap) throws ValidateSignatureException, ContractValidateException, ContractExeException {
    TransactionResultCapsule transRet;
    if (trxCap == null || !trxCap.validateSignature()) {
        return false;
    }
    final List<Actuator> actuatorList = ActuatorFactory.createActuator(trxCap, this);
    TransactionResultCapsule ret = new TransactionResultCapsule();
    for (Actuator act : actuatorList) {
        act.validate();
        act.execute(ret);
        trxCap.setResult(ret);
    }
    transactionStore.put(trxCap.getTransactionId().getBytes(), trxCap);
    return true;
}
Also used : TransactionResultCapsule(org.tron.core.capsule.TransactionResultCapsule) Actuator(org.tron.core.actuator.Actuator)

Aggregations

TransactionResultCapsule (org.tron.core.capsule.TransactionResultCapsule)16 Test (org.junit.Test)15 AccountCapsule (org.tron.core.capsule.AccountCapsule)15 ContractExeException (org.tron.core.exception.ContractExeException)15 ContractValidateException (org.tron.core.exception.ContractValidateException)15 DateTime (org.joda.time.DateTime)5 AssetIssueCapsule (org.tron.core.capsule.AssetIssueCapsule)2 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 Actuator (org.tron.core.actuator.Actuator)1 Contract (org.tron.protos.Contract)1