Skip to content

Commit

Permalink
move retesteth exceptions into pyspecs
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed May 27, 2024
1 parent 3baf416 commit d02b67c
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions src/ethereum_test_tools/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,75 @@ class TransactionException(ExceptionBase):
If a transaction with any of these exceptions is included in a block, the block is invalid.
"""

ADDRESS_TOO_SHORT = auto()
"""
Transaction `to` is not allowed to be less than 20 bytes
"""
ADDRESS_TOO_LONG = auto()
"""
Transaction `to` is not allowed to be more than 20 bytes
"""
NONCE_TOO_BIG = auto()
"""
Transaction `nonce` is not allowed to be max_unit64 - 1
"""
NONCE_OVERFLOW = auto()
"""
Transaction `nonce` is not allowed to be more than uint64
"""
GASLIMIT_OVERFLOW = auto()
"""
Transaction gaslimit exceeds 2^64-1 maximum value
"""
VALUE_OVERFLOW = auto()
"""
Transaction value exceeds 2^256-1 maximum value
"""
GASPRICE_OVERFLOW = auto()
"""
Transaction gasPrice exceeds 2^256-1 maximum value
"""
GASLIMIT_PRICE_PRODUCT_OVERFLOW = auto()
"""
Transaction gasPrice * gasLimit exceeds 2^256-1 maximum value
"""
INVALID_SIGNATURE_VRS = auto()
"""
Invalid transaction v, r, s values
"""
RLP_INVALID_SIGNATURE_R = auto()
"""
Error reading transaction signature R value
"""
RLP_INVALID_SIGNATURE_S = auto()
"""
Error reading transaction signature S value
"""
INVALID_CHAINID = auto()
"""
Transaction chain id encoding is incorrect
"""
RLP_INVALID_DATA = auto()
"""
Transaction data field is invalid rlp
"""
RLP_INVALID_GASLIMIT = auto()
"""
Transaction gaslimit field is invalid rlp
"""
RLP_INVALID_NONCE = auto()
"""
Transaction nonce field is invalid rlp
"""
RLP_INVALID_TO = auto()
"""
Transaction to field is invalid rlp
"""
EC_RECOVERY_FAIL = auto()
"""
Transaction has correct signature, but ec recovery failed
"""

INSUFFICIENT_ACCOUNT_FUNDS = auto()
"""
Transaction's sender does not have enough funds to pay for the transaction.
Expand All @@ -100,6 +169,10 @@ class TransactionException(ExceptionBase):
"""
Transaction's max-fee-per-gas is lower than the block base-fee.
"""
PRIORITY_OVERFLOW = auto()
"""
Transaction's max-priority-fee-per-gas is exceeds 2^256-1 maximum value
"""
PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS = auto()
"""
Transaction's max-priority-fee-per-gas is greater than the max-fee-per-gas.
Expand Down Expand Up @@ -159,6 +232,26 @@ class BlockException(ExceptionBase):
block header contains an invalid field.
"""

EXTRA_DATA_TOO_BIG = auto()
"""
Block header's extra data >32 bytes
"""
GASLIMIT_TOO_BIG = auto()
"""
Block header's gas limit > 0x7fffffffffffffff
"""
INVALID_DIFFICULTY = auto()
"""
Block header's difficulty does not match the difficulty formula calculated from previous block
"""
INVALID_GASLIMIT = auto()
"""
Block header's gas limit does not match the gas limit formula calculated from previous block
"""
INVALID_WITHDRAWALS_ROOT = auto()
"""
Block header's withdrawals root does not match calculated withdrawals root
"""
INCORRECT_BLOCK_FORMAT = auto()
"""
Block's format is incorrect, contains invalid fields, is missing fields, or contains fields of
Expand Down

0 comments on commit d02b67c

Please sign in to comment.