|
5 | 5 | these are simple data classes that can be composed together.
|
6 | 6 | """
|
7 | 7 |
|
8 |
| -from typing import Any, ClassVar, Dict, List |
| 8 | +from typing import Any, ClassVar, List |
9 | 9 |
|
| 10 | +import ethereum_rlp as eth_rlp |
10 | 11 | from pydantic import Field
|
11 | 12 |
|
12 | 13 | from ethereum_test_base_types import (
|
@@ -98,7 +99,7 @@ class BalAccountChange(CamelModel, RLPSerializable):
|
98 | 99 | ]
|
99 | 100 |
|
100 | 101 |
|
101 |
| -class BlockAccessList(CamelModel, RLPSerializable): |
| 102 | +class BlockAccessList(CamelModel): |
102 | 103 | """
|
103 | 104 | Expected Block Access List for verification.
|
104 | 105 |
|
@@ -132,21 +133,19 @@ class BlockAccessList(CamelModel, RLPSerializable):
|
132 | 133 | default_factory=list, description="List of account changes in the block"
|
133 | 134 | )
|
134 | 135 |
|
135 |
| - rlp_fields: ClassVar[List[str]] = ["account_changes"] |
136 |
| - |
137 |
| - def to_list(self, signing: bool = False) -> List[Any]: |
| 136 | + def to_list(self) -> List[Any]: |
138 | 137 | """
|
139 |
| - Override to_list to return the account changes list directly. |
| 138 | + Return the account changes list directly for RLP encoding. |
140 | 139 |
|
141 | 140 | The BlockAccessList IS the list of account changes, not a container
|
142 | 141 | that contains a list, per EIP-7928.
|
143 | 142 | """
|
144 | 143 | # Return the list of accounts directly, not wrapped in another list
|
145 | 144 | return to_serializable_element(self.account_changes)
|
146 | 145 |
|
147 |
| - def to_dict(self) -> Dict[str, Any]: |
148 |
| - """Convert to dictionary for serialization.""" |
149 |
| - return self.model_dump(exclude_none=True) |
| 146 | + def rlp(self) -> Bytes: |
| 147 | + """Return the RLP encoded block access list for hash verification.""" |
| 148 | + return Bytes(eth_rlp.encode(self.to_list())) |
150 | 149 |
|
151 | 150 | def verify_against(self, actual_bal: "BlockAccessList") -> None:
|
152 | 151 | """
|
|
0 commit comments