1717 RLPSerializable ,
1818 StorageKey ,
1919)
20+ from ethereum_test_base_types .serialization import to_serializable_element
2021
2122
2223class BalNonceChange (CamelModel , RLPSerializable ):
@@ -123,9 +124,6 @@ class BlockAccessList(CamelModel, RLPSerializable):
123124 """
124125 Expected Block Access List for verification.
125126
126- This follows the same pattern as AccessList and AuthorizationTuple -
127- a simple data class that can be used directly in tests.
128-
129127 Example:
130128 expected_block_access_list = BlockAccessList(
131129 account_changes=[
@@ -142,7 +140,10 @@ class BlockAccessList(CamelModel, RLPSerializable):
142140 address=bob,
143141 balance_changes=[
144142 BalBalanceChange(tx_index=0, post_balance=100)
145- ]
143+ ],
144+ code_changes=[
145+ BalCodeChange(tx_index=0, new_code=b"0x1234")
146+ ],
146147 ),
147148 ]
148149 )
@@ -163,8 +164,6 @@ def to_list(self, signing: bool = False) -> List[Any]:
163164 that contains a list, per EIP-7928.
164165 """
165166 # Return the list of accounts directly, not wrapped in another list
166- from ethereum_test_base_types .serialization import to_serializable_element
167-
168167 return to_serializable_element (self .account_changes )
169168
170169 def to_dict (self ) -> Dict [str , Any ]:
@@ -242,13 +241,13 @@ def _compare_account_changes(
242241 extra = actual_set - expected_set
243242 msg = "Storage reads mismatch."
244243 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 } ."
248248 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 } ."
252251 raise AssertionError (msg )
253252
254253 elif isinstance (expected_value , list ):
0 commit comments