Merge pull request #801 from TheBlueMatt/2021-02-789-bindings
[rust-lightning] / lightning / src / ln / functional_tests.rs
index 6273604c63850e3fc63bf5bb33f31fcd9db7b45d..f491120835cba301de07e5aec78a57537a3d7e1f 100644 (file)
@@ -4694,16 +4694,15 @@ macro_rules! check_spendable_outputs {
                                match event {
                                        Event::SpendableOutputs { mut outputs } => {
                                                for outp in outputs.drain(..) {
-                                                       let mut outputs = vec![outp];
-                                                       txn.push($keysinterface.backing.spend_spendable_outputs(&outputs, Vec::new(), Builder::new().push_opcode(opcodes::all::OP_RETURN).into_script(), 253, &secp_ctx).unwrap());
-                                                       all_outputs.push(outputs.pop().unwrap());
+                                                       txn.push($keysinterface.backing.spend_spendable_outputs(&[&outp], Vec::new(), Builder::new().push_opcode(opcodes::all::OP_RETURN).into_script(), 253, &secp_ctx).unwrap());
+                                                       all_outputs.push(outp);
                                                }
                                        },
                                        _ => panic!("Unexpected event"),
                                };
                        }
                        if all_outputs.len() > 1 {
-                               if let Ok(tx) = $keysinterface.backing.spend_spendable_outputs(&all_outputs, Vec::new(), Builder::new().push_opcode(opcodes::all::OP_RETURN).into_script(), 253, &secp_ctx) {
+                               if let Ok(tx) = $keysinterface.backing.spend_spendable_outputs(&all_outputs.iter().map(|a| a).collect::<Vec<_>>(), Vec::new(), Builder::new().push_opcode(opcodes::all::OP_RETURN).into_script(), 253, &secp_ctx) {
                                        txn.push(tx);
                                }
                        }