+ let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { let mut local_ret_0 = Vec::new(); for mut item in o.drain(..) { local_ret_0.push( { crate::c_types::ECDSASignature::from_rust(&item) }); }; local_ret_0.into() }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };
+ local_ret
+}
+
+/// Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
+/// the broadcaster, in the built transaction, if any exists.
+///
+/// There are two cases where this may return `None`:
+/// - The balance of the revokeable output is below the dust limit (only found on commitments
+/// early in the channel's lifetime, i.e. before the channel reserve is met).
+/// - This commitment was created before LDK 0.0.117. In this case, the
+/// commitment transaction previously didn't contain enough information to locate the
+/// revokeable output.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn TrustedCommitmentTransaction_revokeable_output_index(this_arg: &crate::lightning::ln::chan_utils::TrustedCommitmentTransaction) -> crate::c_types::derived::COption_usizeZ {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.revokeable_output_index();
+ let mut local_ret = if ret.is_none() { crate::c_types::derived::COption_usizeZ::None } else { crate::c_types::derived::COption_usizeZ::Some( { ret.unwrap() }) };
+ local_ret
+}
+
+/// Helper method to build an unsigned justice transaction spending the revokeable
+/// `to_local` output to a destination script. Fee estimation accounts for the expected
+/// revocation witness data that will be added when signed.
+///
+/// This method will error if the given fee rate results in a fee greater than the value
+/// of the output being spent, or if there exists no revokeable `to_local` output on this
+/// commitment transaction. See [`Self::revokeable_output_index`] for more details.
+///
+/// The built transaction will allow fee bumping with RBF, and this method takes
+/// `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
+/// fee rates may be built.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn TrustedCommitmentTransaction_build_to_local_justice_tx(this_arg: &crate::lightning::ln::chan_utils::TrustedCommitmentTransaction, mut feerate_per_kw: u64, mut destination_script: crate::c_types::derived::CVec_u8Z) -> crate::c_types::derived::CResult_TransactionNoneZ {
+ let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.build_to_local_justice_tx(feerate_per_kw, ::bitcoin::blockdata::script::Script::from(destination_script.into_rust()));
+ let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::Transaction::from_bitcoin(&o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { () /*e*/ }).into() };