@@ -669,6 +669,8 @@ class Transaction(
669
669
670
670
authorization_list : List [AuthorizationTuple ] | None = None
671
671
672
+ initcodes : List [Bytes ] | None = None
673
+
672
674
secret_key : Hash | None = None
673
675
error : List [TransactionException ] | TransactionException | None = Field (None , exclude = True )
674
676
@@ -710,7 +712,9 @@ def model_post_init(self, __context):
710
712
711
713
if "ty" not in self .model_fields_set :
712
714
# Try to deduce transaction type from included fields
713
- if self .authorization_list is not None :
715
+ if self .initcodes is not None :
716
+ self .ty = 6
717
+ elif self .authorization_list is not None :
714
718
self .ty = 4
715
719
elif self .max_fee_per_blob_gas is not None or self .blob_versioned_hashes is not None :
716
720
self .ty = 3
@@ -758,6 +762,11 @@ def model_post_init(self, __context):
758
762
if self .ty != 4 :
759
763
assert self .authorization_list is None , "authorization_list must be None"
760
764
765
+ if self .ty == 6 and self .initcodes is None :
766
+ self .initcodes = []
767
+ if self .ty != 6 :
768
+ assert self .initcodes is None , "initcodes must be None"
769
+
761
770
if "nonce" not in self .model_fields_set and self .sender is not None :
762
771
self .nonce = HexNumber (self .sender .get_nonce ())
763
772
@@ -911,7 +920,21 @@ def get_rlp_signing_fields(self) -> List[str]:
911
920
the transaction type.
912
921
"""
913
922
field_list : List [str ]
914
- if self .ty == 4 :
923
+ if self .ty == 6 :
924
+ # EIP-7873: https://eips.ethereum.org/EIPS/eip-7873
925
+ field_list = [
926
+ "chain_id" ,
927
+ "nonce" ,
928
+ "max_priority_fee_per_gas" ,
929
+ "max_fee_per_gas" ,
930
+ "gas_limit" ,
931
+ "to" ,
932
+ "value" ,
933
+ "data" ,
934
+ "access_list" ,
935
+ "initcodes" ,
936
+ ]
937
+ elif self .ty == 4 :
915
938
# EIP-7702: https://eips.ethereum.org/EIPS/eip-7702
916
939
field_list = [
917
940
"chain_id" ,
0 commit comments