Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit a67e4c2

Browse files
committed
More informative nonce error
1 parent 0267c73 commit a67e4c2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

eth/vm/forks/frontier/validation.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ def validate_frontier_transaction(state: StateAPI,
2626
if sender_balance < total_cost:
2727
raise ValidationError("Sender account balance cannot afford txn")
2828

29-
if state.get_nonce(transaction.sender) != transaction.nonce:
30-
raise ValidationError("Invalid transaction nonce")
29+
sender_nonce = state.get_nonce(transaction.sender)
30+
if sender_nonce != transaction.nonce:
31+
raise ValidationError(
32+
f"Invalid transaction nonce: Expected {sender_nonce}, but got {transaction.nonce}"
33+
)
3134

3235

3336
def validate_frontier_transaction_against_header(_vm: VirtualMachineAPI,

0 commit comments

Comments
 (0)