1111from starknet_py .hash .hash_method import HashMethod
1212from starknet_py .hash .selector import get_selector_from_name
1313from starknet_py .net .client_utils import _to_rpc_felt
14- from starknet_py .net .models .typed_data import DomainDict , Revisionx , TypedDataDict
14+ from starknet_py .net .models .typed_data import DomainDict , Revision , TypedDataDict
1515from starknet_py .net .schemas .common import RevisionField
1616from starknet_py .serialization .data_serializers import ByteArraySerializer
1717from starknet_py .utils .merkle_tree import MerkleTree
@@ -49,16 +49,16 @@ class Domain:
4949 name : str
5050 version : str
5151 chain_id : Union [str , int ]
52- revision : Optional [Revisionx ] = None
52+ revision : Optional [Revision ] = None
5353
5454 def __post_init__ (self ):
5555 self .resolved_revision = (
56- Revisionx (self .revision ) if self .revision else Revisionx .V0
56+ Revision (self .revision ) if self .revision else Revision .V0
5757 )
5858 self .separator_name = self ._resolve_separator_name ()
5959
6060 def _resolve_separator_name (self ):
61- if self .resolved_revision == Revisionx .V0 :
61+ if self .resolved_revision == Revision .V0 :
6262 return "StarkNetDomain"
6363 return "StarknetDomain"
6464
@@ -136,7 +136,7 @@ def _all_types(self):
136136
137137 @property
138138 def _hash_method (self ) -> HashMethod :
139- if self .domain .resolved_revision == Revisionx .V0 :
139+ if self .domain .resolved_revision == Revision .V0 :
140140 return HashMethod .PEDERSEN
141141 return HashMethod .POSEIDON
142142
@@ -230,11 +230,11 @@ def _encode_value(
230230 basic_type = BasicType (type_name )
231231
232232 encoded_value = None
233- if self .domain .resolved_revision == Revisionx .V0 and isinstance (
233+ if self .domain .resolved_revision == Revision .V0 and isinstance (
234234 value , (str , int )
235235 ):
236236 encoded_value = self ._encode_value_v0 (basic_type , value )
237- elif self .domain .resolved_revision == Revisionx .V1 and isinstance (
237+ elif self .domain .resolved_revision == Revision .V1 and isinstance (
238238 value , (str , int , dict )
239239 ):
240240 encoded_value = self ._encode_value_v1 (basic_type , value , type_name , context )
@@ -328,7 +328,7 @@ def _verify_types(self):
328328 self ._validate_enum_type ()
329329
330330 def _validate_enum_type (self ):
331- if self .domain .resolved_revision != Revisionx .V1 :
331+ if self .domain .resolved_revision != Revision .V1 :
332332 raise ValueError (
333333 f"'{ BasicType .ENUM .name } ' basic type is not supported in revision "
334334 f"{ self .domain .resolved_revision .value } ."
@@ -369,7 +369,7 @@ def _encode_type(self, type_name: str) -> str:
369369
370370 def encode_dependency (dependency : str ) -> str :
371371 def escape (s : str ) -> str :
372- if self .domain .resolved_revision == Revisionx .V0 :
372+ if self .domain .resolved_revision == Revision .V0 :
373373 return s
374374 return f'"{ s } "'
375375
@@ -381,7 +381,7 @@ def escape(s: str) -> str:
381381 target_type = (
382382 param .contains
383383 if isinstance (param , EnumParameter )
384- and self .domain .resolved_revision == Revisionx .V1
384+ and self .domain .resolved_revision == Revision .V1
385385 else param .type
386386 )
387387
@@ -617,7 +617,7 @@ def is_in_range(n: int):
617617 raise ValueError (f"Value [{ value } ] is out of range for '{ BasicType .I128 } '." )
618618
619619
620- def _get_basic_type_names (revision : Revisionx ) -> List [str ]:
620+ def _get_basic_type_names (revision : Revision ) -> List [str ]:
621621 basic_types_v0 = [
622622 BasicType .FELT ,
623623 BasicType .SELECTOR ,
@@ -628,14 +628,14 @@ def _get_basic_type_names(revision: Revisionx) -> List[str]:
628628
629629 basic_types_v1 = list (BasicType )
630630
631- basic_types = basic_types_v0 if revision == Revisionx .V0 else basic_types_v1
631+ basic_types = basic_types_v0 if revision == Revision .V0 else basic_types_v1
632632 return [basic_type .value for basic_type in basic_types ]
633633
634634
635635def _get_preset_types (
636- revision : Revisionx ,
636+ revision : Revision ,
637637) -> Dict [str , List [StandardParameter ]]:
638- if revision == Revisionx .V0 :
638+ if revision == Revision .V0 :
639639 return {}
640640
641641 return {
0 commit comments