tx_out(989_870, change(1))
],
})
)
}
#[test]
#[should_panic(expected = "invariant: excess postage is stripped")]
fn invariant_excess_postage_is_stripped() {
let utxos = vec![(outpoint(1), Amount::from_sat(1_000_000))];
TransactionBuilder::new(
satpoint(1, 0),
BTreeMap::new(),
utxos.into_iter().collect(),
BTreeSet::new(),
recipient(),
[change(0), change(1)],
FeeRate::try_from(1.0).unwrap(),
Target::Postage,
)
.select_outgoing()
.unwrap()
.build()
.unwrap();
}
#[test]
fn sat_is_aligned() {
let utxos = vec![(outpoint(1), Amount::from_sat(10_000))];
pretty_assert_eq!(
TransactionBuilder::new(
satpoint(1, 3_333),
BTreeMap::new(),
utxos.into_iter().collect(),
BTreeSet::new(),
recipient(),
[change(0), change(1)],
FeeRate::try_from(1.0).unwrap(),
Target::Postage,
)
.build_transaction(),
Ok(Transaction {