.collect(), BTreeSet::new(), recipient(), [change(0), change(1)], FeeRate::try_from(1.0).unwrap(), Target::Postage, ) .build() .unwrap(); } #[test] #[should_panic(expected = "invariant: outgoing sat is sent to recipient")] fn invariant_sat_is_sent_to_recipient() { let mut builder = TransactionBuilder::new( satpoint(1, 2), BTreeMap::new(), vec![(outpoint(1), Amount::from_sat(5))] .into_iter() .collect(), BTreeSet::new(), recipient(), [change(0), change(1)], FeeRate::try_from(1.0).unwrap(), Target::Postage, ) .select_outgoing() .unwrap(); builder.outputs[0].0 = "tb1qx4gf3ya0cxfcwydpq8vr2lhrysneuj5d7lqatw" .parse::
>() .unwrap() .assume_checked(); builder.build().unwrap(); } #[test] #[should_panic(expected = "invariant: outgoing sat is found in outputs")] fn invariant_sat_is_found_in_outputs() { let mut builder = TransactionBuilder::new(