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