use of com.hederahashgraph.api.proto.java.CryptoAddLiveHashTransactionBody in project hedera-mirror-node by hashgraph.
the class EntityRecordItemListenerCryptoTest method cryptoAddLiveHashPersist.
@Test
void cryptoAddLiveHashPersist() {
Transaction transaction = cryptoAddLiveHashTransaction();
TransactionBody transactionBody = getTransactionBody(transaction);
CryptoAddLiveHashTransactionBody cryptoAddLiveHashTransactionBody = transactionBody.getCryptoAddLiveHash();
TransactionRecord record = transactionRecordSuccess(transactionBody);
parseRecordItemAndCommit(new RecordItem(transaction, record));
var dbTransaction = getDbTransaction(record.getConsensusTimestamp());
LiveHash dbLiveHash = liveHashRepository.findById(dbTransaction.getConsensusTimestamp()).get();
assertAll(() -> assertEquals(1, transactionRepository.count()), () -> assertEntities(), () -> assertCryptoTransfers(3), () -> assertEquals(1, liveHashRepository.count()), () -> assertTransactionAndRecord(transactionBody, record), () -> assertArrayEquals(cryptoAddLiveHashTransactionBody.getLiveHash().getHash().toByteArray(), dbLiveHash.getLivehash()));
}
Aggregations