[outpoint(1), outpoint(2), outpoint(3), outpoint(4)]
); // value inputs are pushed at the end
assert_eq!(
tx_builder.outputs,
[(recipient(), Amount::from_sat(3_003 + 3_006 + 3_005 + 3_001))]
)
}
#[test]
fn pad_alignment_output_can_select_multiple_utxos() {
let mut utxos = vec![
(outpoint(4), Amount::from_sat(101)), // 4. smallest utxo >= 84 is selected 4th, filling deficit
(outpoint(1), Amount::from_sat(20_000)), // 1. satpoint is selected 1st leaving deficit 293
(outpoint(2), Amount::from_sat(105)), // 2. biggest utxo <= 293 is selected 2nd leaving deficit 188
(outpoint(5), Amount::from_sat(103)),
(outpoint(6), Amount::from_sat(10_000)),
(outpoint(3), Amount::from_sat(104)), // 3. biggest utxo <= 188 is selected 3rd leaving deficit 84
(outpoint(7), Amount::from_sat(102)),
];
let tx_builder = TransactionBuilder::new(
satpoint(1, 1),
BTreeMap::new(),
utxos.clone().into_iter().collect(),
BTreeSet::new(),