17
17
RLPSerializable ,
18
18
StorageKey ,
19
19
)
20
+ from ethereum_test_base_types .serialization import to_serializable_element
20
21
21
22
22
23
class BalNonceChange (CamelModel , RLPSerializable ):
@@ -123,9 +124,6 @@ class BlockAccessList(CamelModel, RLPSerializable):
123
124
"""
124
125
Expected Block Access List for verification.
125
126
126
- This follows the same pattern as AccessList and AuthorizationTuple -
127
- a simple data class that can be used directly in tests.
128
-
129
127
Example:
130
128
expected_block_access_list = BlockAccessList(
131
129
account_changes=[
@@ -142,7 +140,10 @@ class BlockAccessList(CamelModel, RLPSerializable):
142
140
address=bob,
143
141
balance_changes=[
144
142
BalBalanceChange(tx_index=0, post_balance=100)
145
- ]
143
+ ],
144
+ code_changes=[
145
+ BalCodeChange(tx_index=0, new_code=b"0x1234")
146
+ ],
146
147
),
147
148
]
148
149
)
@@ -163,8 +164,6 @@ def to_list(self, signing: bool = False) -> List[Any]:
163
164
that contains a list, per EIP-7928.
164
165
"""
165
166
# Return the list of accounts directly, not wrapped in another list
166
- from ethereum_test_base_types .serialization import to_serializable_element
167
-
168
167
return to_serializable_element (self .account_changes )
169
168
170
169
def to_dict (self ) -> Dict [str , Any ]:
@@ -242,13 +241,13 @@ def _compare_account_changes(
242
241
extra = actual_set - expected_set
243
242
msg = "Storage reads mismatch."
244
243
if missing :
245
- msg += f" Missing: {
246
- [v .hex () if isinstance (v , bytes ) else str (v ) for v in missing ]
247
- } ."
244
+ missing_str = [
245
+ v .hex () if isinstance (v , bytes ) else str (v ) for v in missing
246
+ ]
247
+ msg += f" Missing: { missing_str } ."
248
248
if extra :
249
- msg += f" Extra: {
250
- [v .hex () if isinstance (v , bytes ) else str (v ) for v in extra ]
251
- } ."
249
+ extra_str = [v .hex () if isinstance (v , bytes ) else str (v ) for v in extra ]
250
+ msg += f" Extra: { extra_str } ."
252
251
raise AssertionError (msg )
253
252
254
253
elif isinstance (expected_value , list ):
0 commit comments