@@ -916,6 +916,20 @@ def build(
916
916
auto_ttl_offset = 10_000
917
917
self .ttl = max (0 , last_slot + auto_ttl_offset )
918
918
919
+ # Automatically set the required signers for smart transactions
920
+ if (
921
+ is_smart or auto_required_signers is not None
922
+ ) and self .required_signers is None :
923
+ # Collect all signatories from explicitly defined
924
+ # transaction inputs and collateral inputs, and input addresses
925
+ input_addresses = [i .output .address for i in self .inputs + self .collaterals ] + [Address .from_primitive (a ) for a in self .input_addresses ]
926
+ required_signers = set (
927
+ a .payment_part
928
+ for a in input_addresses
929
+ if isinstance (a .payment_part , VerificationKeyHash )
930
+ )
931
+ self .required_signers = list (required_signers )
932
+
919
933
selected_utxos = []
920
934
selected_amount = Value ()
921
935
for i in self .inputs :
@@ -1047,18 +1061,6 @@ def build(
1047
1061
1048
1062
self .inputs [:] = selected_utxos [:]
1049
1063
1050
- # Automatically set the required signers for smart transactions
1051
- if (
1052
- is_smart or auto_required_signers is not None
1053
- ) and self .required_signers is None :
1054
- # Collect all signatories from explicitly defined transaction inputs and collateral inputs
1055
- required_signers = set (
1056
- i .output .address .payment_part
1057
- for i in self .inputs + self .collaterals
1058
- if isinstance (i .output .address .payment_part , VerificationKeyHash )
1059
- )
1060
- self .required_signers = list (required_signers )
1061
-
1062
1064
self ._set_redeemer_index ()
1063
1065
1064
1066
self ._set_collateral_return (collateral_change_address or change_address )
0 commit comments