Skip to content

Commit 87df96b

Browse files
committed
- bindings diff
1 parent f1b63b7 commit 87df96b

File tree

14 files changed

+200
-200
lines changed

14 files changed

+200
-200
lines changed

lightning-c-bindings/src/chain/chainmonitor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extern "C" fn ChainMonitor_free_void(this_ptr: *mut c_void) {
6464
#[allow(unused)]
6565
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
6666
impl ChainMonitor {
67-
pub(crate) fn take_ptr(mut self) -> *mut nativeChainMonitor {
67+
pub(crate) fn take_inner(mut self) -> *mut nativeChainMonitor {
6868
assert!(self.is_owned);
6969
let ret = self.inner;
7070
self.inner = std::ptr::null_mut();
@@ -140,13 +140,13 @@ pub extern "C" fn ChainMonitor_as_Watch(this_arg: *const ChainMonitor) -> crate:
140140
use lightning::chain::Watch as WatchTraitImport;
141141
#[must_use]
142142
extern "C" fn ChainMonitor_Watch_watch_channel(this_arg: *const c_void, mut funding_outpoint: crate::chain::transaction::OutPoint, mut monitor: crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ {
143-
let mut ret = unsafe { &mut *(this_arg as *mut nativeChainMonitor) }.watch_channel(*unsafe { Box::from_raw(funding_outpoint.take_ptr()) }, *unsafe { Box::from_raw(monitor.take_ptr()) });
143+
let mut ret = unsafe { &mut *(this_arg as *mut nativeChainMonitor) }.watch_channel(*unsafe { Box::from_raw(funding_outpoint.take_inner()) }, *unsafe { Box::from_raw(monitor.take_inner()) });
144144
let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { 0u8 /*o*/ }), Err(mut e) => crate::c_types::CResultTempl::err( { crate::chain::channelmonitor::ChannelMonitorUpdateErr::native_into(e) }) };
145145
local_ret
146146
}
147147
#[must_use]
148148
extern "C" fn ChainMonitor_Watch_update_channel(this_arg: *const c_void, mut funding_txo: crate::chain::transaction::OutPoint, mut update: crate::chain::channelmonitor::ChannelMonitorUpdate) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ {
149-
let mut ret = unsafe { &mut *(this_arg as *mut nativeChainMonitor) }.update_channel(*unsafe { Box::from_raw(funding_txo.take_ptr()) }, *unsafe { Box::from_raw(update.take_ptr()) });
149+
let mut ret = unsafe { &mut *(this_arg as *mut nativeChainMonitor) }.update_channel(*unsafe { Box::from_raw(funding_txo.take_inner()) }, *unsafe { Box::from_raw(update.take_inner()) });
150150
let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { 0u8 /*o*/ }), Err(mut e) => crate::c_types::CResultTempl::err( { crate::chain::channelmonitor::ChannelMonitorUpdateErr::native_into(e) }) };
151151
local_ret
152152
}

lightning-c-bindings/src/chain/channelmonitor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extern "C" fn ChannelMonitorUpdate_free_void(this_ptr: *mut c_void) {
4949
#[allow(unused)]
5050
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
5151
impl ChannelMonitorUpdate {
52-
pub(crate) fn take_ptr(mut self) -> *mut nativeChannelMonitorUpdate {
52+
pub(crate) fn take_inner(mut self) -> *mut nativeChannelMonitorUpdate {
5353
assert!(self.is_owned);
5454
let ret = self.inner;
5555
self.inner = std::ptr::null_mut();
@@ -259,7 +259,7 @@ extern "C" fn MonitorUpdateError_free_void(this_ptr: *mut c_void) {
259259
#[allow(unused)]
260260
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
261261
impl MonitorUpdateError {
262-
pub(crate) fn take_ptr(mut self) -> *mut nativeMonitorUpdateError {
262+
pub(crate) fn take_inner(mut self) -> *mut nativeMonitorUpdateError {
263263
assert!(self.is_owned);
264264
let ret = self.inner;
265265
self.inner = std::ptr::null_mut();
@@ -297,7 +297,7 @@ extern "C" fn MonitorEvent_free_void(this_ptr: *mut c_void) {
297297
#[allow(unused)]
298298
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
299299
impl MonitorEvent {
300-
pub(crate) fn take_ptr(mut self) -> *mut nativeMonitorEvent {
300+
pub(crate) fn take_inner(mut self) -> *mut nativeMonitorEvent {
301301
assert!(self.is_owned);
302302
let ret = self.inner;
303303
self.inner = std::ptr::null_mut();
@@ -356,7 +356,7 @@ extern "C" fn HTLCUpdate_free_void(this_ptr: *mut c_void) {
356356
#[allow(unused)]
357357
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
358358
impl HTLCUpdate {
359-
pub(crate) fn take_ptr(mut self) -> *mut nativeHTLCUpdate {
359+
pub(crate) fn take_inner(mut self) -> *mut nativeHTLCUpdate {
360360
assert!(self.is_owned);
361361
let ret = self.inner;
362362
self.inner = std::ptr::null_mut();
@@ -442,7 +442,7 @@ extern "C" fn ChannelMonitor_free_void(this_ptr: *mut c_void) {
442442
#[allow(unused)]
443443
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
444444
impl ChannelMonitor {
445-
pub(crate) fn take_ptr(mut self) -> *mut nativeChannelMonitor {
445+
pub(crate) fn take_inner(mut self) -> *mut nativeChannelMonitor {
446446
assert!(self.is_owned);
447447
let ret = self.inner;
448448
self.inner = std::ptr::null_mut();

lightning-c-bindings/src/chain/keysinterface.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl SpendableOutputDescriptor {
8282
let mut outpoint_nonref = (*outpoint).clone();
8383
let mut output_nonref = (*output).clone();
8484
nativeSpendableOutputDescriptor::StaticOutput {
85-
outpoint: *unsafe { Box::from_raw(outpoint_nonref.take_ptr()) },
85+
outpoint: *unsafe { Box::from_raw(outpoint_nonref.take_inner()) },
8686
output: output_nonref.into_rust(),
8787
}
8888
},
@@ -95,7 +95,7 @@ impl SpendableOutputDescriptor {
9595
let (mut orig_key_derivation_params_nonref_0, mut orig_key_derivation_params_nonref_1) = key_derivation_params_nonref.to_rust(); let mut local_key_derivation_params_nonref = (orig_key_derivation_params_nonref_0, orig_key_derivation_params_nonref_1);
9696
let mut revocation_pubkey_nonref = (*revocation_pubkey).clone();
9797
nativeSpendableOutputDescriptor::DynamicOutputP2WSH {
98-
outpoint: *unsafe { Box::from_raw(outpoint_nonref.take_ptr()) },
98+
outpoint: *unsafe { Box::from_raw(outpoint_nonref.take_inner()) },
9999
per_commitment_point: per_commitment_point_nonref.into_rust(),
100100
to_self_delay: to_self_delay_nonref,
101101
output: output_nonref.into_rust(),
@@ -109,7 +109,7 @@ impl SpendableOutputDescriptor {
109109
let mut key_derivation_params_nonref = (*key_derivation_params).clone();
110110
let (mut orig_key_derivation_params_nonref_0, mut orig_key_derivation_params_nonref_1) = key_derivation_params_nonref.to_rust(); let mut local_key_derivation_params_nonref = (orig_key_derivation_params_nonref_0, orig_key_derivation_params_nonref_1);
111111
nativeSpendableOutputDescriptor::StaticOutputCounterpartyPayment {
112-
outpoint: *unsafe { Box::from_raw(outpoint_nonref.take_ptr()) },
112+
outpoint: *unsafe { Box::from_raw(outpoint_nonref.take_inner()) },
113113
output: output_nonref.into_rust(),
114114
key_derivation_params: local_key_derivation_params_nonref,
115115
}
@@ -121,14 +121,14 @@ impl SpendableOutputDescriptor {
121121
match self {
122122
SpendableOutputDescriptor::StaticOutput {mut outpoint, mut output, } => {
123123
nativeSpendableOutputDescriptor::StaticOutput {
124-
outpoint: *unsafe { Box::from_raw(outpoint.take_ptr()) },
124+
outpoint: *unsafe { Box::from_raw(outpoint.take_inner()) },
125125
output: output.into_rust(),
126126
}
127127
},
128128
SpendableOutputDescriptor::DynamicOutputP2WSH {mut outpoint, mut per_commitment_point, mut to_self_delay, mut output, mut key_derivation_params, mut revocation_pubkey, } => {
129129
let (mut orig_key_derivation_params_0, mut orig_key_derivation_params_1) = key_derivation_params.to_rust(); let mut local_key_derivation_params = (orig_key_derivation_params_0, orig_key_derivation_params_1);
130130
nativeSpendableOutputDescriptor::DynamicOutputP2WSH {
131-
outpoint: *unsafe { Box::from_raw(outpoint.take_ptr()) },
131+
outpoint: *unsafe { Box::from_raw(outpoint.take_inner()) },
132132
per_commitment_point: per_commitment_point.into_rust(),
133133
to_self_delay: to_self_delay,
134134
output: output.into_rust(),
@@ -139,7 +139,7 @@ impl SpendableOutputDescriptor {
139139
SpendableOutputDescriptor::StaticOutputCounterpartyPayment {mut outpoint, mut output, mut key_derivation_params, } => {
140140
let (mut orig_key_derivation_params_0, mut orig_key_derivation_params_1) = key_derivation_params.to_rust(); let mut local_key_derivation_params = (orig_key_derivation_params_0, orig_key_derivation_params_1);
141141
nativeSpendableOutputDescriptor::StaticOutputCounterpartyPayment {
142-
outpoint: *unsafe { Box::from_raw(outpoint.take_ptr()) },
142+
outpoint: *unsafe { Box::from_raw(outpoint.take_inner()) },
143143
output: output.into_rust(),
144144
key_derivation_params: local_key_derivation_params,
145145
}
@@ -547,7 +547,7 @@ impl rustKeysInterface for KeysInterface {
547547
fn read_chan_signer(&self, reader: &[u8]) -> Result<crate::chain::keysinterface::ChannelKeys, lightning::ln::msgs::DecodeError> {
548548
let mut local_reader = crate::c_types::u8slice::from_slice(reader);
549549
let mut ret = (self.read_chan_signer)(self.this_arg, local_reader);
550-
let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(ret.contents.err.take_ptr()) }).take_ptr()) } })};
550+
let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(ret.contents.err.take_ptr()) }).take_inner()) } })};
551551
local_ret
552552
}
553553
}
@@ -601,7 +601,7 @@ extern "C" fn InMemoryChannelKeys_free_void(this_ptr: *mut c_void) {
601601
#[allow(unused)]
602602
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
603603
impl InMemoryChannelKeys {
604-
pub(crate) fn take_ptr(mut self) -> *mut nativeInMemoryChannelKeys {
604+
pub(crate) fn take_inner(mut self) -> *mut nativeInMemoryChannelKeys {
605605
assert!(self.is_owned);
606606
let ret = self.inner;
607607
self.inner = std::ptr::null_mut();
@@ -895,7 +895,7 @@ extern "C" fn KeysManager_free_void(this_ptr: *mut c_void) {
895895
#[allow(unused)]
896896
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
897897
impl KeysManager {
898-
pub(crate) fn take_ptr(mut self) -> *mut nativeKeysManager {
898+
pub(crate) fn take_inner(mut self) -> *mut nativeKeysManager {
899899
assert!(self.is_owned);
900900
let ret = self.inner;
901901
self.inner = std::ptr::null_mut();

lightning-c-bindings/src/chain/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl rustWatch for Watch {
168168
}
169169
fn release_pending_monitor_events(&self) -> Vec<lightning::chain::channelmonitor::MonitorEvent> {
170170
let mut ret = (self.release_pending_monitor_events)(self.this_arg);
171-
let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
171+
let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
172172
local_ret
173173
}
174174
}

lightning-c-bindings/src/chain/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern "C" fn OutPoint_free_void(this_ptr: *mut c_void) {
3838
#[allow(unused)]
3939
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
4040
impl OutPoint {
41-
pub(crate) fn take_ptr(mut self) -> *mut nativeOutPoint {
41+
pub(crate) fn take_inner(mut self) -> *mut nativeOutPoint {
4242
assert!(self.is_owned);
4343
let ret = self.inner;
4444
self.inner = std::ptr::null_mut();

lightning-c-bindings/src/ln/chan_utils.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extern "C" fn TxCreationKeys_free_void(this_ptr: *mut c_void) {
113113
#[allow(unused)]
114114
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
115115
impl TxCreationKeys {
116-
pub(crate) fn take_ptr(mut self) -> *mut nativeTxCreationKeys {
116+
pub(crate) fn take_inner(mut self) -> *mut nativeTxCreationKeys {
117117
assert!(self.is_owned);
118118
let ret = self.inner;
119119
self.inner = std::ptr::null_mut();
@@ -257,7 +257,7 @@ extern "C" fn PreCalculatedTxCreationKeys_free_void(this_ptr: *mut c_void) {
257257
#[allow(unused)]
258258
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
259259
impl PreCalculatedTxCreationKeys {
260-
pub(crate) fn take_ptr(mut self) -> *mut nativePreCalculatedTxCreationKeys {
260+
pub(crate) fn take_inner(mut self) -> *mut nativePreCalculatedTxCreationKeys {
261261
assert!(self.is_owned);
262262
let ret = self.inner;
263263
self.inner = std::ptr::null_mut();
@@ -285,7 +285,7 @@ pub extern "C" fn PreCalculatedTxCreationKeys_clone(orig: &PreCalculatedTxCreati
285285
#[must_use]
286286
#[no_mangle]
287287
pub extern "C" fn PreCalculatedTxCreationKeys_new(mut keys: crate::ln::chan_utils::TxCreationKeys) -> PreCalculatedTxCreationKeys {
288-
let mut ret = lightning::ln::chan_utils::PreCalculatedTxCreationKeys::new(*unsafe { Box::from_raw(keys.take_ptr()) });
288+
let mut ret = lightning::ln::chan_utils::PreCalculatedTxCreationKeys::new(*unsafe { Box::from_raw(keys.take_inner()) });
289289
PreCalculatedTxCreationKeys { inner: Box::into_raw(Box::new(ret)), is_owned: true }
290290
}
291291

@@ -337,7 +337,7 @@ extern "C" fn ChannelPublicKeys_free_void(this_ptr: *mut c_void) {
337337
#[allow(unused)]
338338
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
339339
impl ChannelPublicKeys {
340-
pub(crate) fn take_ptr(mut self) -> *mut nativeChannelPublicKeys {
340+
pub(crate) fn take_inner(mut self) -> *mut nativeChannelPublicKeys {
341341
assert!(self.is_owned);
342342
let ret = self.inner;
343343
self.inner = std::ptr::null_mut();
@@ -510,7 +510,7 @@ extern "C" fn HTLCOutputInCommitment_free_void(this_ptr: *mut c_void) {
510510
#[allow(unused)]
511511
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
512512
impl HTLCOutputInCommitment {
513-
pub(crate) fn take_ptr(mut self) -> *mut nativeHTLCOutputInCommitment {
513+
pub(crate) fn take_inner(mut self) -> *mut nativeHTLCOutputInCommitment {
514514
assert!(self.is_owned);
515515
let ret = self.inner;
516516
self.inner = std::ptr::null_mut();
@@ -659,7 +659,7 @@ extern "C" fn HolderCommitmentTransaction_free_void(this_ptr: *mut c_void) {
659659
#[allow(unused)]
660660
/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
661661
impl HolderCommitmentTransaction {
662-
pub(crate) fn take_ptr(mut self) -> *mut nativeHolderCommitmentTransaction {
662+
pub(crate) fn take_inner(mut self) -> *mut nativeHolderCommitmentTransaction {
663663
assert!(self.is_owned);
664664
let ret = self.inner;
665665
self.inner = std::ptr::null_mut();
@@ -729,7 +729,7 @@ pub extern "C" fn HolderCommitmentTransaction_set_feerate_per_kw(this_ptr: &mut
729729
/// those for which transaction_output_index.is_some().
730730
#[no_mangle]
731731
pub extern "C" fn HolderCommitmentTransaction_set_per_htlc(this_ptr: &mut HolderCommitmentTransaction, mut val: crate::c_types::derived::CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ) {
732-
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { let (mut orig_val_0_0, mut orig_val_0_1) = item.to_rust(); let mut local_orig_val_0_1 = if orig_val_0_1.is_null() { None } else { Some( { orig_val_0_1.into_rust() }) }; let mut local_val_0 = (*unsafe { Box::from_raw(orig_val_0_0.take_ptr()) }, local_orig_val_0_1); local_val_0 }); };
732+
let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { let (mut orig_val_0_0, mut orig_val_0_1) = item.to_rust(); let mut local_orig_val_0_1 = if orig_val_0_1.is_null() { None } else { Some( { orig_val_0_1.into_rust() }) }; let mut local_val_0 = (*unsafe { Box::from_raw(orig_val_0_0.take_inner()) }, local_orig_val_0_1); local_val_0 }); };
733733
unsafe { &mut *this_ptr.inner }.per_htlc = local_val;
734734
}
735735
/// Generate a new HolderCommitmentTransaction based on a raw commitment transaction,
@@ -740,8 +740,8 @@ pub extern "C" fn HolderCommitmentTransaction_set_per_htlc(this_ptr: &mut Holder
740740
#[must_use]
741741
#[no_mangle]
742742
pub extern "C" fn HolderCommitmentTransaction_new_missing_holder_sig(mut unsigned_tx: crate::c_types::Transaction, mut counterparty_sig: crate::c_types::Signature, mut holder_funding_key: crate::c_types::PublicKey, mut counterparty_funding_key: crate::c_types::PublicKey, mut keys: crate::ln::chan_utils::TxCreationKeys, mut feerate_per_kw: u32, mut htlc_data: crate::c_types::derived::CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ) -> crate::ln::chan_utils::HolderCommitmentTransaction {
743-
let mut local_htlc_data = Vec::new(); for mut item in htlc_data.into_rust().drain(..) { local_htlc_data.push( { let (mut orig_htlc_data_0_0, mut orig_htlc_data_0_1) = item.to_rust(); let mut local_orig_htlc_data_0_1 = if orig_htlc_data_0_1.is_null() { None } else { Some( { orig_htlc_data_0_1.into_rust() }) }; let mut local_htlc_data_0 = (*unsafe { Box::from_raw(orig_htlc_data_0_0.take_ptr()) }, local_orig_htlc_data_0_1); local_htlc_data_0 }); };
744-
let mut ret = lightning::ln::chan_utils::HolderCommitmentTransaction::new_missing_holder_sig(unsigned_tx.into_bitcoin(), counterparty_sig.into_rust(), &holder_funding_key.into_rust(), &counterparty_funding_key.into_rust(), *unsafe { Box::from_raw(keys.take_ptr()) }, feerate_per_kw, local_htlc_data);
743+
let mut local_htlc_data = Vec::new(); for mut item in htlc_data.into_rust().drain(..) { local_htlc_data.push( { let (mut orig_htlc_data_0_0, mut orig_htlc_data_0_1) = item.to_rust(); let mut local_orig_htlc_data_0_1 = if orig_htlc_data_0_1.is_null() { None } else { Some( { orig_htlc_data_0_1.into_rust() }) }; let mut local_htlc_data_0 = (*unsafe { Box::from_raw(orig_htlc_data_0_0.take_inner()) }, local_orig_htlc_data_0_1); local_htlc_data_0 }); };
744+
let mut ret = lightning::ln::chan_utils::HolderCommitmentTransaction::new_missing_holder_sig(unsigned_tx.into_bitcoin(), counterparty_sig.into_rust(), &holder_funding_key.into_rust(), &counterparty_funding_key.into_rust(), *unsafe { Box::from_raw(keys.take_inner()) }, feerate_per_kw, local_htlc_data);
745745
crate::ln::chan_utils::HolderCommitmentTransaction { inner: Box::into_raw(Box::new(ret)), is_owned: true }
746746
}
747747

0 commit comments

Comments
 (0)