@@ -16,7 +16,9 @@ class MerkleOracle(Protocol):
16
16
Oracle interface for Merkle Patricia Trie based state.
17
17
"""
18
18
19
- def get_account (self , address : Address ) -> Account :
19
+ def get_account (
20
+ self , address : Address # noqa: U100
21
+ ) -> Account : # noqa: U100
20
22
"""
21
23
Get account information for the given address.
22
24
@@ -25,7 +27,9 @@ def get_account(self, address: Address) -> Account:
25
27
Returns EMPTY_ACCOUNT if the account doesn't exist.
26
28
"""
27
29
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
29
33
"""
30
34
Get account information for the given address.
31
35
@@ -36,14 +40,17 @@ def get_account_optional(self, address: Address) -> Optional[Account]:
36
40
empty accounts.
37
41
"""
38
42
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
40
46
"""Get storage value at `key` for the given `address`."""
41
47
42
- def state_root (self ) -> Bytes32 :
48
+ def state_root (self ) -> Bytes32 : # noqa: U100
43
49
"""Compute and return the current state root."""
44
50
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
47
54
"""
48
55
Get original storage value before current transaction started.
49
56
@@ -53,7 +60,7 @@ def get_storage_original(self, address: Address, key: Bytes32) -> Bytes32:
53
60
The implementation should use state snapshots/checkpoints to
54
61
track pre-transaction values.
55
62
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.
57
64
58
65
Parameters
59
66
----------
@@ -69,7 +76,7 @@ def get_storage_original(self, address: Address, key: Bytes32) -> Bytes32:
69
76
"""
70
77
71
78
def set_storage_value (
72
- self , address : Address , key : Bytes32 , value : Any
79
+ self , address : Address , key : Bytes32 , value : Any # noqa: U100
73
80
) -> None :
74
81
"""
75
82
Set individual storage value.
@@ -87,55 +94,59 @@ def set_storage_value(
87
94
Storage value (U256 or Bytes32)
88
95
"""
89
96
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
91
100
"""
92
101
Check if account has non-zero code or nonce.
93
102
94
103
Used during contract creation to check if address is available.
95
104
"""
96
105
97
- def account_has_storage (self , address : Address ) -> bool :
106
+ def account_has_storage (self , address : Address ) -> bool : # noqa: U100
98
107
"""
99
108
Check if account has any storage slots.
100
109
101
110
Used during contract creation to check if address is available.
102
111
"""
103
112
104
- def is_account_alive (self , address : Address ) -> bool :
113
+ def is_account_alive (self , address : Address ) -> bool : # noqa: U100
105
114
"""
106
115
Check if account is alive (exists and not marked for deletion).
107
116
108
117
Used in CALL instructions and SELFDESTRUCT.
109
118
"""
110
119
111
- def account_exists (self , address : Address ) -> bool :
120
+ def account_exists (self , address : Address ) -> bool : # noqa: U100
112
121
"""
113
122
Check if account exists in the state.
114
123
"""
115
124
116
- def increment_nonce (self , address : Address ) -> None :
125
+ def increment_nonce (self , address : Address ) -> None : # noqa: U100
117
126
"""
118
127
Increment account nonce.
119
128
120
129
Used during contract creation and transaction processing.
121
130
"""
122
131
123
- def set_code (self , address : Address , code : Any ) -> None :
132
+ def set_code (self , address : Address , code : Any ) -> None : # noqa: U100
124
133
"""
125
134
Set account code.
126
135
127
136
Used during contract creation and EOA delegation.
128
137
"""
129
138
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
131
142
"""
132
143
Set account balance.
133
144
134
145
Used in SELFDESTRUCT and other balance transfer operations.
135
146
"""
136
147
137
148
def move_ether (
138
- self , sender : Bytes20 , recipient : Bytes20 , amount : Any
149
+ self , sender : Bytes20 , recipient : Bytes20 , amount : Any # noqa: U100
139
150
) -> None :
140
151
"""
141
152
Transfer ether between accounts.
@@ -144,37 +155,41 @@ def move_ether(
144
155
Used in CALL instructions and contract transfers.
145
156
"""
146
157
147
- def add_created_account (self , address : Address ) -> None :
158
+ def add_created_account (self , address : Address ) -> None : # noqa: U100
148
159
"""
149
160
Mark account as created in current transaction.
150
161
151
162
Used for tracking accounts created during transaction execution.
152
163
"""
153
164
154
- def is_created_account (self , address : Address ) -> bool :
165
+ def is_created_account (self , address : Address ) -> bool : # noqa: U100
155
166
"""
156
167
Check if account was created in current transaction.
157
168
158
169
Used in SELFDESTRUCT and other operations that need to know
159
170
if account was created in current transaction.
160
171
"""
161
172
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
163
176
"""
164
177
Check if account exists and is empty.
165
178
166
179
Used for account cleanup logic.
167
180
"""
168
181
169
- def destroy_account (self , address : Address ) -> None :
182
+ def destroy_account (self , address : Address ) -> None : # noqa: U100
170
183
"""
171
184
Mark account for destruction.
172
185
173
186
Used in SELFDESTRUCT and account cleanup.
174
187
"""
175
188
176
189
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
178
193
) -> None :
179
194
"""
180
195
Modify an account using a modifier function.
0 commit comments