(&mut self, connectors_e: &AssertCommit2ConnectorsE, witnesses: Vec<RawWitness>)
| 98 | } |
| 99 | |
| 100 | pub fn sign(&mut self, connectors_e: &AssertCommit2ConnectorsE, witnesses: Vec<RawWitness>) { |
| 101 | assert_eq!(witnesses.len(), connectors_e.connectors_num()); |
| 102 | for (input_index, witness) in (0..connectors_e.connectors_num()).zip(witnesses) { |
| 103 | let taproot_spend_info = connectors_e |
| 104 | .get_connector_e(input_index) |
| 105 | .generate_taproot_spend_info(); |
| 106 | let script = &self.prev_scripts()[input_index].clone(); |
| 107 | let res = execute_raw_script_with_inputs(script.clone().to_bytes(), witness.clone()); |
| 108 | assert!( |
| 109 | res.success, |
| 110 | "script: {:?}, res: {:?}: stack: {:?}, variable name: {:?}", |
| 111 | script, |
| 112 | res, |
| 113 | res.final_stack, |
| 114 | connectors_e |
| 115 | .get_connector_e(input_index) |
| 116 | .commitment_public_keys |
| 117 | .keys() |
| 118 | ); |
| 119 | populate_taproot_input_witness( |
| 120 | self.tx_mut(), |
| 121 | input_index, |
| 122 | &taproot_spend_info, |
| 123 | script, |
| 124 | witness, |
| 125 | ); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | pub fn merge(&mut self, assert_commit_2: &AssertCommit2Transaction) { |
| 130 | merge_transactions(&mut self.tx, &assert_commit_2.tx); |
nothing calls this directly
no test coverage detected