Search in sources :

Example 56 with RecordItem

use of com.hedera.mirror.common.domain.transaction.RecordItem in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListenerNonFeeTransferTest method cryptoTransferWithTransferList.

private void cryptoTransferWithTransferList(Transaction transaction, TransferList.Builder transferList, ResponseCodeEnum rc) {
    var transactionBody = getTransactionBody(transaction);
    var record = transactionRecord(transactionBody, rc, transferList).build();
    expectedTransactions.add(new TransactionContext(transaction, record));
    parseRecordItemAndCommit(new RecordItem(transaction, record));
}
Also used : RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem)

Example 57 with RecordItem

use of com.hedera.mirror.common.domain.transaction.RecordItem in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListenerNonFeeTransferTest method contractCallWithTransferList.

private void contractCallWithTransferList(TransferList.Builder transferList) {
    var transaction = contractCall();
    var transactionBody = getTransactionBody(transaction);
    var recordBuilder = transactionRecordSuccess(transactionBody, transferList);
    var contractCallResult = recordBuilder.getContractCallResultBuilder().setContractID(ContractID.newBuilder().setContractNum(NEW_CONTRACT_NUM));
    var record = recordBuilder.setContractCallResult(contractCallResult).build();
    expectedTransactions.add(new TransactionContext(transaction, record));
    parseRecordItemAndCommit(new RecordItem(transaction, record));
}
Also used : RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem)

Example 58 with RecordItem

use of com.hedera.mirror.common.domain.transaction.RecordItem in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListenerScheduleTest method insertScheduleCreateTransaction.

private void insertScheduleCreateTransaction(long createdTimestamp, AccountID payer, ScheduleID scheduleID) {
    Transaction createTransaction = scheduleCreateTransaction(payer);
    TransactionBody createTransactionBody = getTransactionBody(createTransaction);
    var createTransactionRecord = createTransactionRecord(createdTimestamp, scheduleID, createTransactionBody, SUCCESS, false);
    parseRecordItemAndCommit(new RecordItem(createTransaction, createTransactionRecord));
}
Also used : ScheduleCreateTransactionBody(com.hederahashgraph.api.proto.java.ScheduleCreateTransactionBody) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) ScheduleDeleteTransactionBody(com.hederahashgraph.api.proto.java.ScheduleDeleteTransactionBody) SchedulableTransactionBody(com.hederahashgraph.api.proto.java.SchedulableTransactionBody) Transaction(com.hederahashgraph.api.proto.java.Transaction) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem)

Example 59 with RecordItem

use of com.hedera.mirror.common.domain.transaction.RecordItem in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListenerScheduleTest method insertScheduledTransaction.

private void insertScheduledTransaction(long signTimestamp, ScheduleID scheduleID, ResponseCodeEnum responseCodeEnum) {
    Transaction scheduledTransaction = scheduledTransaction();
    TransactionBody scheduledTransactionBody = getTransactionBody(scheduledTransaction);
    var scheduledTransactionRecord = createTransactionRecord(signTimestamp, scheduleID, scheduledTransactionBody, responseCodeEnum, true);
    parseRecordItemAndCommit(new RecordItem(scheduledTransaction, scheduledTransactionRecord));
}
Also used : ScheduleCreateTransactionBody(com.hederahashgraph.api.proto.java.ScheduleCreateTransactionBody) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) ScheduleDeleteTransactionBody(com.hederahashgraph.api.proto.java.ScheduleDeleteTransactionBody) SchedulableTransactionBody(com.hederahashgraph.api.proto.java.SchedulableTransactionBody) Transaction(com.hederahashgraph.api.proto.java.Transaction) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem)

Example 60 with RecordItem

use of com.hedera.mirror.common.domain.transaction.RecordItem in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListenerTokenTest method updateTokenFeeSchedule.

private void updateTokenFeeSchedule(TokenID tokenID, long consensusTimestamp, List<CustomFee> customFees) {
    Transaction transaction = buildTransaction(builder -> builder.getTokenFeeScheduleUpdateBuilder().setTokenId(tokenID).addAllCustomFees(convertCustomFees(customFees)));
    TransactionBody transactionBody = getTransactionBody(transaction);
    TransactionRecord transactionRecord = buildTransactionRecord(builder -> builder.setConsensusTimestamp(TestUtils.toTimestamp(consensusTimestamp)), transactionBody, ResponseCodeEnum.SUCCESS.getNumber());
    parseRecordItemAndCommit(new RecordItem(transaction, transactionRecord));
}
Also used : TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) Transaction(com.hederahashgraph.api.proto.java.Transaction) TransactionRecord(com.hederahashgraph.api.proto.java.TransactionRecord) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem)

Aggregations

RecordItem (com.hedera.mirror.common.domain.transaction.RecordItem)182 Test (org.junit.jupiter.api.Test)131 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)131 TransactionBody (com.hederahashgraph.api.proto.java.TransactionBody)108 TransactionRecord (com.hederahashgraph.api.proto.java.TransactionRecord)95 Transaction (com.hederahashgraph.api.proto.java.Transaction)94 EntityId (com.hedera.mirror.common.domain.entity.EntityId)42 DomainUtils (com.hedera.mirror.common.util.DomainUtils)36 SignedTransaction (com.hederahashgraph.api.proto.java.SignedTransaction)36 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)36 ResponseCodeEnum (com.hederahashgraph.api.proto.java.ResponseCodeEnum)34 EnumSource (org.junit.jupiter.params.provider.EnumSource)34 Entity (com.hedera.mirror.common.domain.entity.Entity)31 CryptoUpdateTransactionBody (com.hederahashgraph.api.proto.java.CryptoUpdateTransactionBody)31 Transaction (com.hedera.mirror.common.domain.transaction.Transaction)29 CryptoCreateTransactionBody (com.hederahashgraph.api.proto.java.CryptoCreateTransactionBody)29 AccountID (com.hederahashgraph.api.proto.java.AccountID)28 CryptoAddLiveHashTransactionBody (com.hederahashgraph.api.proto.java.CryptoAddLiveHashTransactionBody)28 CryptoDeleteLiveHashTransactionBody (com.hederahashgraph.api.proto.java.CryptoDeleteLiveHashTransactionBody)28 FileAppendTransactionBody (com.hederahashgraph.api.proto.java.FileAppendTransactionBody)28