use of com.hederahashgraph.api.proto.java.TransactionRecord in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method fileDeleteToNew.
@Test
void fileDeleteToNew() {
Transaction fileDeleteTransaction = fileDeleteTransaction();
TransactionBody transactionBody = getTransactionBody(fileDeleteTransaction);
TransactionRecord record = transactionRecord(transactionBody);
parseRecordItemAndCommit(new RecordItem(fileDeleteTransaction, record));
Entity fileEntity = getTransactionEntity(record.getConsensusTimestamp());
assertAll(() -> assertRowCountOnSuccessNoData(FILE_ID), () -> assertTransactionAndRecord(transactionBody, record), () -> assertFileEntityHasNullFields(record.getConsensusTimestamp()), () -> assertTrue(fileEntity.getDeleted()));
}
use of com.hederahashgraph.api.proto.java.TransactionRecord in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method fileUpdateContentsToNew.
@Test
void fileUpdateContentsToNew() {
Transaction transaction = fileUpdateContentsTransaction();
TransactionBody transactionBody = getTransactionBody(transaction);
TransactionRecord record = transactionRecord(transactionBody);
parseRecordItemAndCommit(new RecordItem(transaction, record));
Entity actualFile = getTransactionEntity(record.getConsensusTimestamp());
assertAll(() -> assertRowCountOnSuccess(FILE_ID), () -> assertTransactionAndRecord(transactionBody, record), () -> assertFileData(transactionBody.getFileUpdate().getContents(), record.getConsensusTimestamp()), // Additional entity checks
() -> assertFalse(actualFile.getDeleted()), () -> assertNull(actualFile.getKey()), () -> assertNull(actualFile.getAutoRenewPeriod()), () -> assertNull(actualFile.getProxyAccountId()));
}
use of com.hederahashgraph.api.proto.java.TransactionRecord in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerFileTest method fileCreatePersistSystemNegative.
@Test
void fileCreatePersistSystemNegative() {
entityProperties.getPersist().setFiles(false);
Transaction transaction = fileCreateTransaction();
TransactionBody transactionBody = getTransactionBody(transaction);
FileID fileID = FileID.newBuilder().setShardNum(0).setRealmNum(0).setFileNum(2000).build();
TransactionRecord record = transactionRecord(transactionBody, fileID);
parseRecordItemAndCommit(new RecordItem(transaction, record));
assertAll(() -> assertRowCountOnSuccessNoData(fileID), () -> assertTransactionAndRecord(transactionBody, record), () -> assertFileEntity(transactionBody.getFileCreate(), record.getConsensusTimestamp()));
}
use of com.hederahashgraph.api.proto.java.TransactionRecord 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()));
}
use of com.hederahashgraph.api.proto.java.TransactionRecord 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));
}
Aggregations