Skip to content

Commit ad9dd18

Browse files
committed
python lint
1 parent ed85d8f commit ad9dd18

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

src/ethereum/state_oracle/interface.py

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ class MerkleOracle(Protocol):
1616
Oracle interface for Merkle Patricia Trie based state.
1717
"""
1818

19-
def get_account(self, address: Address) -> Account:
19+
def get_account(
20+
self, address: Address # noqa: U100
21+
) -> Account: # noqa: U100
2022
"""
2123
Get account information for the given address.
2224
@@ -25,7 +27,9 @@ def get_account(self, address: Address) -> Account:
2527
Returns EMPTY_ACCOUNT if the account doesn't exist.
2628
"""
2729

28-
def get_account_optional(self, address: Address) -> Optional[Account]:
30+
def get_account_optional(
31+
self, address: Address # noqa: U100
32+
) -> Optional[Account]: # noqa: U100
2933
"""
3034
Get account information for the given address.
3135
@@ -36,14 +40,17 @@ def get_account_optional(self, address: Address) -> Optional[Account]:
3640
empty accounts.
3741
"""
3842

39-
def get_storage(self, address: Address, key: Bytes32) -> Bytes32:
43+
def get_storage(
44+
self, address: Address, key: Bytes32 # noqa: U100
45+
) -> Bytes32: # noqa: U100
4046
"""Get storage value at `key` for the given `address`."""
4147

42-
def state_root(self) -> Bytes32:
48+
def state_root(self) -> Bytes32: # noqa: U100
4349
"""Compute and return the current state root."""
4450

45-
# Extensions needed for complete EVM instruction support
46-
def get_storage_original(self, address: Address, key: Bytes32) -> Bytes32:
51+
def get_storage_original(
52+
self, address: Address, key: Bytes32 # noqa: U100
53+
) -> Bytes32: # noqa: U100
4754
"""
4855
Get original storage value before current transaction started.
4956
@@ -53,7 +60,7 @@ def get_storage_original(self, address: Address, key: Bytes32) -> Bytes32:
5360
The implementation should use state snapshots/checkpoints to
5461
track pre-transaction values.
5562
TODO: The oracle does not have a `begin_transaction` method,
56-
so it kind of breaks here.
63+
TODO: so it kind of breaks here.
5764
5865
Parameters
5966
----------
@@ -69,7 +76,7 @@ def get_storage_original(self, address: Address, key: Bytes32) -> Bytes32:
6976
"""
7077

7178
def set_storage_value(
72-
self, address: Address, key: Bytes32, value: Any
79+
self, address: Address, key: Bytes32, value: Any # noqa: U100
7380
) -> None:
7481
"""
7582
Set individual storage value.
@@ -87,55 +94,59 @@ def set_storage_value(
8794
Storage value (U256 or Bytes32)
8895
"""
8996

90-
def account_has_code_or_nonce(self, address: Address) -> bool:
97+
def account_has_code_or_nonce(
98+
self, address: Address # noqa: U100
99+
) -> bool: # noqa: U100
91100
"""
92101
Check if account has non-zero code or nonce.
93102
94103
Used during contract creation to check if address is available.
95104
"""
96105

97-
def account_has_storage(self, address: Address) -> bool:
106+
def account_has_storage(self, address: Address) -> bool: # noqa: U100
98107
"""
99108
Check if account has any storage slots.
100109
101110
Used during contract creation to check if address is available.
102111
"""
103112

104-
def is_account_alive(self, address: Address) -> bool:
113+
def is_account_alive(self, address: Address) -> bool: # noqa: U100
105114
"""
106115
Check if account is alive (exists and not marked for deletion).
107116
108117
Used in CALL instructions and SELFDESTRUCT.
109118
"""
110119

111-
def account_exists(self, address: Address) -> bool:
120+
def account_exists(self, address: Address) -> bool: # noqa: U100
112121
"""
113122
Check if account exists in the state.
114123
"""
115124

116-
def increment_nonce(self, address: Address) -> None:
125+
def increment_nonce(self, address: Address) -> None: # noqa: U100
117126
"""
118127
Increment account nonce.
119128
120129
Used during contract creation and transaction processing.
121130
"""
122131

123-
def set_code(self, address: Address, code: Any) -> None:
132+
def set_code(self, address: Address, code: Any) -> None: # noqa: U100
124133
"""
125134
Set account code.
126135
127136
Used during contract creation and EOA delegation.
128137
"""
129138

130-
def set_account_balance(self, address: Address, balance: Any) -> None:
139+
def set_account_balance(
140+
self, address: Address, balance: Any # noqa: U100
141+
) -> None: # noqa: U100
131142
"""
132143
Set account balance.
133144
134145
Used in SELFDESTRUCT and other balance transfer operations.
135146
"""
136147

137148
def move_ether(
138-
self, sender: Bytes20, recipient: Bytes20, amount: Any
149+
self, sender: Bytes20, recipient: Bytes20, amount: Any # noqa: U100
139150
) -> None:
140151
"""
141152
Transfer ether between accounts.
@@ -144,37 +155,41 @@ def move_ether(
144155
Used in CALL instructions and contract transfers.
145156
"""
146157

147-
def add_created_account(self, address: Address) -> None:
158+
def add_created_account(self, address: Address) -> None: # noqa: U100
148159
"""
149160
Mark account as created in current transaction.
150161
151162
Used for tracking accounts created during transaction execution.
152163
"""
153164

154-
def is_created_account(self, address: Address) -> bool:
165+
def is_created_account(self, address: Address) -> bool: # noqa: U100
155166
"""
156167
Check if account was created in current transaction.
157168
158169
Used in SELFDESTRUCT and other operations that need to know
159170
if account was created in current transaction.
160171
"""
161172

162-
def account_exists_and_is_empty(self, address: Address) -> bool:
173+
def account_exists_and_is_empty(
174+
self, address: Address # noqa: U100
175+
) -> bool: # noqa: U100
163176
"""
164177
Check if account exists and is empty.
165178
166179
Used for account cleanup logic.
167180
"""
168181

169-
def destroy_account(self, address: Address) -> None:
182+
def destroy_account(self, address: Address) -> None: # noqa: U100
170183
"""
171184
Mark account for destruction.
172185
173186
Used in SELFDESTRUCT and account cleanup.
174187
"""
175188

176189
def modify_state(
177-
self, address: Address, modifier_function: Callable[[Account], None]
190+
self,
191+
address: Address, # noqa: U100
192+
modifier_function: Callable[[Account], None], # noqa: U100
178193
) -> None:
179194
"""
180195
Modify an account using a modifier function.

0 commit comments

Comments
 (0)