}) = self.parent_info.clone()
{
reveal_inputs.insert(0, location.outpoint);
reveal_outputs.insert(
0,
TxOut {
script_pubkey: destination.script_pubkey(),
value: tx_out.value,
},
);
}
let commit_input = if self.parent_info.is_some() { 1 } else { 0 };
let (_, reveal_fee) = Self::build_reveal_transaction(
&control_block,
self.reveal_fee_rate,
reveal_inputs.clone(),
commit_input,
reveal_outputs.clone(),
&reveal_script,
);
let unsigned_commit_tx = TransactionBuilder::new(
satpoint,
wallet_inscriptions,
utxos.clone(),
locked_utxos.clone(),
commit_tx_address.clone(),
change,
self.commit_fee_rate,
Target::Value(reveal_fee + total_postage),
)
.build_transaction()?;
let (vout, _commit_output) = unsigned_commit_tx
.output
.iter()
.enumerate()
.find(|(_vout, output)| output.script_pubkey == commit_tx_address.script_pubkey())