@@ -143,9 +143,10 @@ const computeNetImplicitSelectionValues = (
143
143
* each needed token type, and then filling in with smaller UTxOs as needed.
144
144
*/
145
145
export class LargestFirstInputSelector implements IInputSelector {
146
- // Change outputs will be computed
147
- // dummy output field is used to indicate that these outputs are not real
148
- // and so we will not check whether there is enough value to cover min utxo value
146
+ // Change outputs will be computed, and an indicator will be
147
+ // returned to indicate whether the value is fully fulfilled or not.
148
+ // If the value is not fully fulfilled, it means that inputs were not enough
149
+ // to cover the required value
149
150
private computeChangeOutputs = (
150
151
remainingValue : Value ,
151
152
changeAddress : string ,
@@ -155,7 +156,7 @@ export class LargestFirstInputSelector implements IInputSelector {
155
156
let valueFulfilled = true ;
156
157
const valueAssets = remainingValue
157
158
. entries ( )
158
- . filter ( ( [ unit , quantity ] ) => quantity > 0n )
159
+ . filter ( ( [ _ , quantity ] ) => quantity > 0n )
159
160
. map ( ( [ unit , quantity ] ) => ( {
160
161
unit,
161
162
quantity : String ( quantity ) ,
@@ -234,7 +235,8 @@ export class LargestFirstInputSelector implements IInputSelector {
234
235
amount : valueAssets ,
235
236
} ) ;
236
237
if ( lovelaceAvailable < 0n ) {
237
- // If there's not enough lovelace to cover the min UTxO value, we set valueFulfilled to false
238
+ // lovelaceAvailable being negative means that we didn't have enough
239
+ // lovelaces to cover fees, we set valueFulfilled to false
238
240
valueFulfilled = false ;
239
241
}
240
242
}
0 commit comments