(
network: Network,
operator_public_key: &PublicKey,
connector_0: &Connector0,
connector_4: &Connector4,
connector_5: &Connector5,
connector_c: &Connect
| 113 | |
| 114 | #[allow(clippy::too_many_arguments)] |
| 115 | pub fn new_for_validation( |
| 116 | network: Network, |
| 117 | operator_public_key: &PublicKey, |
| 118 | connector_0: &Connector0, |
| 119 | connector_4: &Connector4, |
| 120 | connector_5: &Connector5, |
| 121 | connector_c: &ConnectorC, |
| 122 | input_0: Input, |
| 123 | input_1: Input, |
| 124 | input_2: Input, |
| 125 | input_3: Input, |
| 126 | ) -> Self { |
| 127 | let input_0_leaf = 1; |
| 128 | let _input_0 = connector_0.generate_taproot_leaf_tx_in(input_0_leaf, &input_0); |
| 129 | |
| 130 | let _input_1 = connector_4.generate_tx_in(&input_1); |
| 131 | |
| 132 | let input_2_leaf = 0; |
| 133 | let _input_2 = connector_5.generate_taproot_leaf_tx_in(input_2_leaf, &input_2); |
| 134 | |
| 135 | let _input_3 = generate_default_tx_in(&input_3); |
| 136 | |
| 137 | let total_output_amount = input_0.amount + input_1.amount + input_2.amount + input_3.amount |
| 138 | - Amount::from_sat(MIN_RELAY_FEE_TAKE_2); |
| 139 | |
| 140 | let _output_0 = TxOut { |
| 141 | value: total_output_amount, |
| 142 | script_pubkey: generate_pay_to_pubkey_script_address(network, operator_public_key) |
| 143 | .script_pubkey(), |
| 144 | }; |
| 145 | |
| 146 | Take2Transaction { |
| 147 | tx: Transaction { |
| 148 | version: bitcoin::transaction::Version(2), |
| 149 | lock_time: absolute::LockTime::ZERO, |
| 150 | input: vec![_input_0, _input_1, _input_2, _input_3], |
| 151 | output: vec![_output_0], |
| 152 | }, |
| 153 | prev_outs: vec![ |
| 154 | TxOut { |
| 155 | value: input_0.amount, |
| 156 | script_pubkey: connector_0.generate_taproot_address().script_pubkey(), |
| 157 | }, |
| 158 | TxOut { |
| 159 | value: input_1.amount, |
| 160 | script_pubkey: connector_4.generate_address().script_pubkey(), |
| 161 | }, |
| 162 | TxOut { |
| 163 | value: input_2.amount, |
| 164 | script_pubkey: connector_5.generate_taproot_address().script_pubkey(), |
| 165 | }, |
| 166 | TxOut { |
| 167 | value: input_3.amount, |
| 168 | script_pubkey: connector_c.generate_taproot_address().script_pubkey(), |
| 169 | }, |
| 170 | ], |
| 171 | prev_scripts: vec![ |
| 172 | connector_0.generate_taproot_leaf_script(input_0_leaf), |
nothing calls this directly
no test coverage detected