Skip to content

Commit 31e26fe

Browse files
committed
Address PR comment
Signed-off-by: Zhivko Kelchev <zhivko.kelchev@limechain.tech>
1 parent fea36e6 commit 31e26fe

File tree

1 file changed

+12
-1
lines changed
  • hedera-node/test-clients/src/main/java/com/hedera/services/bdd/junit/support/translators

1 file changed

+12
-1
lines changed

hedera-node/test-clients/src/main/java/com/hedera/services/bdd/junit/support/translators/BaseTranslator.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,19 @@ private boolean allMintsAreFound() {
982982
return true;
983983
}
984984

985+
/**
986+
* Compares the Ethereum transaction body nonce with the most recent nonce value in the state changes.
987+
* In normal scenarios, these values should be equal. However, when multiple Ethereum calls exist
988+
* within a single batch transaction (all modifying the same account), the final state change might
989+
* contain a greater nonce value than what appears in any individual transaction body.
990+
*
991+
* @param accountID The Ethereum transaction sender account
992+
* @param nonce The nonce value from the Ethereum transaction body
993+
* @param remainingStateChanges The current state changes to examine
994+
* @return true if the signer nonce from state changes is greater than the one in the transaction body
995+
*/
985996
public boolean isNonceIncremented(
986-
final AccountID accountID, final Long nonce, List<StateChange> remainingStateChanges) {
997+
@NonNull final AccountID accountID, long nonce, @NonNull List<StateChange> remainingStateChanges) {
987998
final var currentNonce = getSignerNonce(accountID, remainingStateChanges);
988999
return currentNonce != null && currentNonce > nonce;
9891000
}

0 commit comments

Comments
 (0)