Skip to content

Commit 6c038e8

Browse files
souradeep-dasSamWilsn
authored andcommitted
lint
1 parent 915b1ad commit 6c038e8

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

src/ethereum/cancun/fork.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ def check_transaction(
421421

422422
blob_gas_price = calculate_blob_gas_price(block_env.excess_blob_gas)
423423
if Uint(tx.max_fee_per_blob_gas) < blob_gas_price:
424-
raise InsufficientMaxFeePerBlobGasError("insufficient max fee per blob gas")
424+
raise InsufficientMaxFeePerBlobGasError(
425+
"insufficient max fee per blob gas"
426+
)
425427

426428
max_gas_fee += Uint(calculate_total_blob_gas(tx)) * Uint(
427429
tx.max_fee_per_blob_gas

src/ethereum/exceptions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ class InvalidSignatureError(InvalidTransaction):
4343

4444
class InsufficientBalanceError(InvalidTransaction):
4545
"""
46-
Thrown when a transaction cannot be executed due to insufficient sender funds.
46+
Thrown when a transaction cannot be executed due to insufficient sender
47+
funds.
4748
"""
4849

4950

5051
class NonceMismatchError(InvalidTransaction):
5152
"""
52-
Thrown when a transaction's nonce does not match the expected nonce for the sender.
53+
Thrown when a transaction's nonce does not match the expected nonce for the
54+
sender.
5355
"""

src/ethereum/prague/exceptions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ class TransactionTypeContractCreationError(InvalidTransaction):
3535
"""
3636

3737
def __init__(self, transaction_type: int):
38-
super().__init__(f"transaction type `{transaction_type}` not allowed for contract creation")
38+
super().__init__(
39+
f"transaction type `{transaction_type}` not allowed for "
40+
"contract creation"
41+
)
3942
self.transaction_type = transaction_type
4043

4144

@@ -78,4 +81,4 @@ class PriorityFeeGreaterThanMaxFeeError(InvalidTransaction):
7881
class EmptyAuthorizationListError(InvalidTransaction):
7982
"""
8083
The authorization list in the transaction is empty.
81-
"""
84+
"""

src/ethereum/prague/fork.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@
2222
from ethereum.crypto.hash import Hash32, keccak256
2323
from ethereum.exceptions import (
2424
EthereumException,
25+
InsufficientBalanceError,
2526
InvalidBlock,
2627
InvalidSenderError,
27-
InsufficientBalanceError,
28-
NonceMismatchError
28+
NonceMismatchError,
2929
)
3030

3131
from . import vm
3232
from .blocks import Block, Header, Log, Receipt, Withdrawal, encode_receipt
3333
from .bloom import logs_bloom
3434
from .exceptions import (
35-
TransactionTypeContractCreationError,
3635
BlobGasLimitExceededError,
36+
EmptyAuthorizationListError,
3737
InsufficientMaxFeePerBlobGasError,
3838
InsufficientMaxFeePerGasError,
3939
InvalidBlobVersionedHashError,
4040
NoBlobDataError,
4141
PriorityFeeGreaterThanMaxFeeError,
42-
EmptyAuthorizationListError
42+
TransactionTypeContractCreationError,
4343
)
4444
from .fork_types import Account, Address, Authorization, VersionedHash
4545
from .requests import (
@@ -430,7 +430,9 @@ def check_transaction(
430430
tx, (FeeMarketTransaction, BlobTransaction, SetCodeTransaction)
431431
):
432432
if tx.max_fee_per_gas < tx.max_priority_fee_per_gas:
433-
raise PriorityFeeGreaterThanMaxFeeError("priority fee greater than max fee")
433+
raise PriorityFeeGreaterThanMaxFeeError(
434+
"priority fee greater than max fee"
435+
)
434436
if tx.max_fee_per_gas < block_env.base_fee_per_gas:
435437
raise InsufficientMaxFeePerGasError("insufficient max fee per gas")
436438

@@ -451,11 +453,15 @@ def check_transaction(
451453
raise NoBlobDataError("no blob data in transaction")
452454
for blob_versioned_hash in tx.blob_versioned_hashes:
453455
if blob_versioned_hash[0:1] != VERSIONED_HASH_VERSION_KZG:
454-
raise InvalidBlobVersionedHashError("invalid blob versioned hash")
456+
raise InvalidBlobVersionedHashError(
457+
"invalid blob versioned hash"
458+
)
455459

456460
blob_gas_price = calculate_blob_gas_price(block_env.excess_blob_gas)
457461
if Uint(tx.max_fee_per_blob_gas) < blob_gas_price:
458-
raise InsufficientMaxFeePerBlobGasError("insufficient max fee per blob gas")
462+
raise InsufficientMaxFeePerBlobGasError(
463+
"insufficient max fee per blob gas"
464+
)
459465

460466
max_gas_fee += Uint(calculate_total_blob_gas(tx)) * Uint(
461467
tx.max_fee_per_blob_gas
@@ -473,7 +479,7 @@ def check_transaction(
473479
raise EmptyAuthorizationListError("empty authorization list")
474480

475481
if sender_account.nonce != tx.nonce:
476-
if sender_account.nonce > tx.nonce:
482+
if sender_account.nonce > Uint(tx.nonce):
477483
raise NonceMismatchError("nonce too low")
478484
else:
479485
raise NonceMismatchError("nonce too high")

0 commit comments

Comments
 (0)