Search in sources :

Example 56 with TransactionBody

use of com.hederahashgraph.api.proto.java.TransactionBody in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListenerFileTest method fileSystemUnDeleteTransaction.

@Test
void fileSystemUnDeleteTransaction() {
    Transaction systemUndeleteTransaction = systemUnDeleteTransaction();
    TransactionBody transactionBody = getTransactionBody(systemUndeleteTransaction);
    TransactionRecord record = transactionRecord(transactionBody);
    parseRecordItemAndCommit(new RecordItem(systemUndeleteTransaction, record));
    assertAll(() -> assertRowCountOnSuccessNoData(FILE_ID), () -> assertTransactionAndRecord(transactionBody, record), () -> assertFileEntityHasNullFields(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 57 with TransactionBody

use of com.hederahashgraph.api.proto.java.TransactionBody in project hedera-mirror-node by hashgraph.

the class EntityRecordItemListenerFileTest method fileDeleteFailedTransaction.

@Test
void fileDeleteFailedTransaction() {
    Transaction fileDeleteTransaction = fileDeleteTransaction();
    TransactionBody transactionBody = getTransactionBody(fileDeleteTransaction);
    TransactionRecord record = transactionRecord(transactionBody, ResponseCodeEnum.INSUFFICIENT_PAYER_BALANCE);
    parseRecordItemAndCommit(new RecordItem(fileDeleteTransaction, record));
    assertAll(() -> assertRowCountOnFailureNoData(), () -> assertFailedFileTransaction(transactionBody, record));
}
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 58 with TransactionBody

use of com.hederahashgraph.api.proto.java.TransactionBody 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 59 with TransactionBody

use of com.hederahashgraph.api.proto.java.TransactionBody 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 60 with TransactionBody

use of com.hederahashgraph.api.proto.java.TransactionBody 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)

Aggregations

TransactionBody (com.hederahashgraph.api.proto.java.TransactionBody)145 RecordItem (com.hedera.mirror.common.domain.transaction.RecordItem)106 Test (org.junit.jupiter.api.Test)100 TransactionRecord (com.hederahashgraph.api.proto.java.TransactionRecord)96 Transaction (com.hederahashgraph.api.proto.java.Transaction)91 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)91 FileAppendTransactionBody (com.hederahashgraph.api.proto.java.FileAppendTransactionBody)34 AccountID (com.hederahashgraph.api.proto.java.AccountID)32 EnumSource (org.junit.jupiter.params.provider.EnumSource)32 EntityId (com.hedera.mirror.common.domain.entity.EntityId)31 CryptoAddLiveHashTransactionBody (com.hederahashgraph.api.proto.java.CryptoAddLiveHashTransactionBody)31 CryptoCreateTransactionBody (com.hederahashgraph.api.proto.java.CryptoCreateTransactionBody)31 CryptoUpdateTransactionBody (com.hederahashgraph.api.proto.java.CryptoUpdateTransactionBody)31 FileUpdateTransactionBody (com.hederahashgraph.api.proto.java.FileUpdateTransactionBody)31 SignedTransaction (com.hederahashgraph.api.proto.java.SignedTransaction)31 Entity (com.hedera.mirror.common.domain.entity.Entity)29 ResponseCodeEnum (com.hederahashgraph.api.proto.java.ResponseCodeEnum)29 CryptoDeleteLiveHashTransactionBody (com.hederahashgraph.api.proto.java.CryptoDeleteLiveHashTransactionBody)28 FileCreateTransactionBody (com.hederahashgraph.api.proto.java.FileCreateTransactionBody)28 Contract (com.hedera.mirror.common.domain.contract.Contract)27