use of com.hedera.services.records.TxnIdRecentHistory in project hedera-services by hashgraph.
the class ExpiryManagerTest method rebuildsExpectedRecordsFromState.
@Test
void rebuildsExpectedRecordsFromState() {
subject = new ExpiryManager(mockScheduleStore, nums, sigImpactHistorian, liveTxnHistories, () -> liveAccounts, () -> mockSchedules);
final var newTxnId = recordWith(aGrpcId, start).getTxnId().toGrpc();
final var leftoverTxnId = recordWith(bGrpcId, now).getTxnId().toGrpc();
liveTxnHistories.put(leftoverTxnId, new TxnIdRecentHistory());
anAccount.records().offer(expiring(recordWith(aGrpcId, start), firstThen));
anAccount.records().offer(expiring(recordWith(aGrpcId, start), secondThen));
liveAccounts.put(aKey, anAccount);
subject.reviewExistingPayerRecords();
// then:
assertFalse(liveTxnHistories.containsKey(leftoverTxnId));
assertEquals(firstThen, liveTxnHistories.get(newTxnId).priorityRecord().getExpiry());
assertEquals(secondThen, liveTxnHistories.get(newTxnId).allDuplicateRecords().get(0).getExpiry());
}
Aggregations