File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ class TransactionBuilder:
129
129
130
130
required_signers : Optional [List [VerificationKeyHash ]] = field (default = None )
131
131
132
- collaterals : List [UTxO ] = field (default_factory = lambda : [] )
132
+ collaterals : set [UTxO ] = field (default_factory = lambda : set () )
133
133
134
134
certificates : Optional [List [Certificate ]] = field (default = None )
135
135
@@ -870,7 +870,7 @@ def _required_signer_vkey_hashes(self) -> Set[VerificationKeyHash]:
870
870
871
871
def _input_vkey_hashes (self ) -> Set [VerificationKeyHash ]:
872
872
results = set ()
873
- for i in self .inputs + self .collaterals :
873
+ for i in self .inputs + list ( self .collaterals ) :
874
874
if isinstance (i .output .address .payment_part , VerificationKeyHash ):
875
875
results .add (i .output .address .payment_part )
876
876
return results
@@ -1526,8 +1526,9 @@ def _add_collateral_input(cur_total, candidate_inputs):
1526
1526
"SCRIPT"
1527
1527
)
1528
1528
and candidate .output .amount .coin > 2000000
1529
+ and candidate not in self .collaterals
1529
1530
):
1530
- self .collaterals .append (candidate )
1531
+ self .collaterals .add (candidate )
1531
1532
cur_total += candidate .output .amount
1532
1533
cur_collateral_return = cur_total - collateral_amount
1533
1534
You can’t perform that action at this time.
0 commit comments