-
Notifications
You must be signed in to change notification settings - Fork 134
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Two TransactionId instances with different hash codes must not be equal.
Violation of the contract breaks HashMap with TransactionId as key.
Steps to reproduce
This test fails:
@Test
void testTransactionIdEquals() {
AccountId accountId = new AccountId(0, 0, 1000);
Instant now = Instant.now();
TransactionId txnId1 = TransactionId.withValidStart(accountId, now);
TransactionId txnId2 = TransactionId.withValidStart(accountId, now);
txnId2.setNonce(0);
assertFalse(txnId1.equals(txnId2) && txnId1.hashCode() != txnId2.hashCode());
}
Additional context
No response
Hedera network
No response
Version
2.65.0
Operating system
None
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working