ethereum / ethereum/execution-specs
Bespoke constructor for `NonceMismatchError`
Open
stale
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 505
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 116
Description
Not something that needs to be fixed now, but an idea for future improvement would be to:
```python
class NonceMismatchError(InvalidTransaction):
def __init__(self, account_nonce: Uint, tx_nonce: U256):
assert account_nonce != tx_nonce
if account_nonce > Uint(tx.nonce):
message = "nonce too low"
else:
message = "nonce too high"
super(message)
...
```
_Originally posted by @SamWilsn in https://github.com/ethereum/execution-specs/pull/1266#discussion_r2155240486_
Contributor guide
Assessment
This issue has not been assessed yet.