File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,15 @@ class Felt(NumberAsHex):
8989 REGEX_PATTERN = r"^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$"
9090
9191
92+ class EthAddress (NumberAsHex ):
93+ """
94+ Field used to serialize and deserialize ETH address type.
95+ """
96+
97+ MAX_VALUE = 2 ** 160
98+ REGEX_PATTERN = r"^0x[a-fA-F0-9]{40}$"
99+
100+
92101class Uint64 (NumberAsHex ):
93102 """
94103 Field used to serialize and deserialize RPC u64 type.
Original file line number Diff line number Diff line change 2727)
2828from starknet_py .net .schemas .common import (
2929 DAModeField ,
30+ EthAddress ,
3031 ExecutionStatusField ,
3132 Felt ,
3233 FinalityStatusField ,
4546
4647class L2toL1MessageSchema (Schema ):
4748 l2_address = Felt (data_key = "from_address" , required = True )
48- l1_address = Felt (data_key = "to_address" , required = True )
49+ l1_address = EthAddress (data_key = "to_address" , required = True )
4950 payload = fields .List (Felt (), data_key = "payload" , required = True )
5051
5152 @post_load
You can’t perform that action at this time.
0 commit comments