File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ class TransactionBuilder:
129129
130130 required_signers : Optional [List [VerificationKeyHash ]] = field (default = None )
131131
132- collaterals : List [UTxO ] = field (default_factory = lambda : [] )
132+ collaterals : set [UTxO ] = field (default_factory = lambda : set () )
133133
134134 certificates : Optional [List [Certificate ]] = field (default = None )
135135
@@ -870,7 +870,7 @@ def _required_signer_vkey_hashes(self) -> Set[VerificationKeyHash]:
870870
871871 def _input_vkey_hashes (self ) -> Set [VerificationKeyHash ]:
872872 results = set ()
873- for i in self .inputs + self .collaterals :
873+ for i in self .inputs + list ( self .collaterals ) :
874874 if isinstance (i .output .address .payment_part , VerificationKeyHash ):
875875 results .add (i .output .address .payment_part )
876876 return results
@@ -1526,8 +1526,9 @@ def _add_collateral_input(cur_total, candidate_inputs):
15261526 "SCRIPT"
15271527 )
15281528 and candidate .output .amount .coin > 2000000
1529+ and candidate not in self .collaterals
15291530 ):
1530- self .collaterals .append (candidate )
1531+ self .collaterals .add (candidate )
15311532 cur_total += candidate .output .amount
15321533 cur_collateral_return = cur_total - collateral_amount
15331534
You can’t perform that action at this time.
0 commit comments