Search in sources :

Example 51 with RecordItem

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

the class EntityRecordItemListenerFileTest method fileUpdateAllToNew.

@Test
void fileUpdateAllToNew() {
    Transaction transaction = fileUpdateAllTransaction();
    TransactionBody transactionBody = getTransactionBody(transaction);
    TransactionRecord record = transactionRecord(transactionBody);
    parseRecordItemAndCommit(new RecordItem(transaction, record));
    assertAll(() -> assertRowCountOnSuccess(FILE_ID), () -> assertTransactionAndRecord(transactionBody, record), () -> assertFileEntityAndData(transactionBody.getFileUpdate(), record.getConsensusTimestamp()));
}
Also used : FileAppendTransactionBody(com.hederahashgraph.api.proto.java.FileAppendTransactionBody) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) FileUpdateTransactionBody(com.hederahashgraph.api.proto.java.FileUpdateTransactionBody) FileCreateTransactionBody(com.hederahashgraph.api.proto.java.FileCreateTransactionBody) Transaction(com.hederahashgraph.api.proto.java.Transaction) TransactionRecord(com.hederahashgraph.api.proto.java.TransactionRecord) RecordItem(com.hedera.mirror.common.domain.transaction.RecordItem) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 52 with RecordItem

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

the class EntityRecordItemListenerFreezeTest method freezeInvalidTransaction.

@Test
void freezeInvalidTransaction() {
    Transaction transaction = freezeTransaction();
    TransactionBody transactionBody = getTransactionBody(transaction);
    TransactionRecord record = transactionRecord(transactionBody, ResponseCodeEnum.INSUFFICIENT_ACCOUNT_BALANCE);
    parseRecordItemAndCommit(new RecordItem(transaction, record));
    assertAll(() -> assertRowCount(), () -> assertTransactionAndRecord(transactionBody, record));
}
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) Test(org.junit.jupiter.api.Test)

Example 53 with RecordItem

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

the class EntityRecordItemListenerFreezeTest method freeze.

@Test
void freeze() {
    Transaction transaction = freezeTransaction();
    TransactionBody transactionBody = getTransactionBody(transaction);
    TransactionRecord record = transactionRecord(transactionBody);
    parseRecordItemAndCommit(new RecordItem(transaction, record));
    assertAll(() -> assertRowCount(), () -> assertTransactionAndRecord(transactionBody, record));
}
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) Test(org.junit.jupiter.api.Test)

Example 54 with RecordItem

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

the class EntityRecordItemListenerPerformanceCryptoTest method getCreateAccountRecordItem.

private RecordItem getCreateAccountRecordItem(int accountNum) throws Exception {
    Transaction createTransaction = cryptoCreateTransaction();
    TransactionBody createTransactionBody = getTransactionBody(createTransaction);
    TransactionRecord createRecord = transactionRecord(createTransactionBody, ResponseCodeEnum.SUCCESS.getNumber(), accountNum);
    return new RecordItem(createTransaction, createRecord);
}
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)

Example 55 with RecordItem

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

the class EntityRecordItemListenerPerformanceCryptoTest method getUpdateAccountRecordItem.

private RecordItem getUpdateAccountRecordItem(int accountNum) throws Exception {
    Transaction updateTransaction = cryptoUpdateTransaction(AccountID.newBuilder().setShardNum(0).setRealmNum(0).setAccountNum(accountNum).build());
    TransactionBody updateTransactionBody = getTransactionBody(updateTransaction);
    TransactionRecord createRecord = transactionRecord(updateTransactionBody, ResponseCodeEnum.SUCCESS.getNumber(), accountNum);
    return new RecordItem(updateTransaction, createRecord);
}
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