Skip to content

Commit 31edc45

Browse files
committed
- bindings update
1 parent 9424734 commit 31edc45

File tree

12 files changed

+148
-148
lines changed

12 files changed

+148
-148
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct ChainMonitor {
4949

5050
impl Drop for ChainMonitor {
5151
fn drop(&mut self) {
52-
if self.is_owned && !self.inner.is_null() {
52+
if self.is_owned && !<*mut nativeChainMonitor>::is_null(self.inner) {
5353
let _ = unsafe { Box::from_raw(self.inner) };
5454
}
5555
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub struct ChannelMonitorUpdate {
3434

3535
impl Drop for ChannelMonitorUpdate {
3636
fn drop(&mut self) {
37-
if self.is_owned && !self.inner.is_null() {
37+
if self.is_owned && !<*mut nativeChannelMonitorUpdate>::is_null(self.inner) {
3838
let _ = unsafe { Box::from_raw(self.inner) };
3939
}
4040
}
@@ -94,7 +94,7 @@ pub extern "C" fn ChannelMonitorUpdate_set_update_id(this_ptr: &mut ChannelMonit
9494
impl Clone for ChannelMonitorUpdate {
9595
fn clone(&self) -> Self {
9696
Self {
97-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
97+
inner: if <*mut nativeChannelMonitorUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
9898
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
9999
is_owned: true,
100100
}
@@ -243,7 +243,7 @@ pub struct MonitorUpdateError {
243243

244244
impl Drop for MonitorUpdateError {
245245
fn drop(&mut self) {
246-
if self.is_owned && !self.inner.is_null() {
246+
if self.is_owned && !<*mut nativeMonitorUpdateError>::is_null(self.inner) {
247247
let _ = unsafe { Box::from_raw(self.inner) };
248248
}
249249
}
@@ -268,7 +268,7 @@ impl MonitorUpdateError {
268268
impl Clone for MonitorUpdateError {
269269
fn clone(&self) -> Self {
270270
Self {
271-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
271+
inner: if <*mut nativeMonitorUpdateError>::is_null(self.inner) { std::ptr::null_mut() } else {
272272
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
273273
is_owned: true,
274274
}
@@ -386,7 +386,7 @@ pub struct HTLCUpdate {
386386

387387
impl Drop for HTLCUpdate {
388388
fn drop(&mut self) {
389-
if self.is_owned && !self.inner.is_null() {
389+
if self.is_owned && !<*mut nativeHTLCUpdate>::is_null(self.inner) {
390390
let _ = unsafe { Box::from_raw(self.inner) };
391391
}
392392
}
@@ -411,7 +411,7 @@ impl HTLCUpdate {
411411
impl Clone for HTLCUpdate {
412412
fn clone(&self) -> Self {
413413
Self {
414-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
414+
inner: if <*mut nativeHTLCUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
415415
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
416416
is_owned: true,
417417
}
@@ -471,7 +471,7 @@ pub struct ChannelMonitor {
471471

472472
impl Drop for ChannelMonitor {
473473
fn drop(&mut self) {
474-
if self.is_owned && !self.inner.is_null() {
474+
if self.is_owned && !<*mut nativeChannelMonitor>::is_null(self.inner) {
475475
let _ = unsafe { Box::from_raw(self.inner) };
476476
}
477477
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct DelayedPaymentOutputDescriptor {
2323

2424
impl Drop for DelayedPaymentOutputDescriptor {
2525
fn drop(&mut self) {
26-
if self.is_owned && !self.inner.is_null() {
26+
if self.is_owned && !<*mut nativeDelayedPaymentOutputDescriptor>::is_null(self.inner) {
2727
let _ = unsafe { Box::from_raw(self.inner) };
2828
}
2929
}
@@ -140,7 +140,7 @@ pub extern "C" fn DelayedPaymentOutputDescriptor_new(mut outpoint_arg: crate::ch
140140
impl Clone for DelayedPaymentOutputDescriptor {
141141
fn clone(&self) -> Self {
142142
Self {
143-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
143+
inner: if <*mut nativeDelayedPaymentOutputDescriptor>::is_null(self.inner) { std::ptr::null_mut() } else {
144144
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
145145
is_owned: true,
146146
}
@@ -172,7 +172,7 @@ pub struct StaticPaymentOutputDescriptor {
172172

173173
impl Drop for StaticPaymentOutputDescriptor {
174174
fn drop(&mut self) {
175-
if self.is_owned && !self.inner.is_null() {
175+
if self.is_owned && !<*mut nativeStaticPaymentOutputDescriptor>::is_null(self.inner) {
176176
let _ = unsafe { Box::from_raw(self.inner) };
177177
}
178178
}
@@ -249,7 +249,7 @@ pub extern "C" fn StaticPaymentOutputDescriptor_new(mut outpoint_arg: crate::cha
249249
impl Clone for StaticPaymentOutputDescriptor {
250250
fn clone(&self) -> Self {
251251
Self {
252-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
252+
inner: if <*mut nativeStaticPaymentOutputDescriptor>::is_null(self.inner) { std::ptr::null_mut() } else {
253253
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
254254
is_owned: true,
255255
}
@@ -790,7 +790,7 @@ pub struct InMemorySigner {
790790

791791
impl Drop for InMemorySigner {
792792
fn drop(&mut self) {
793-
if self.is_owned && !self.inner.is_null() {
793+
if self.is_owned && !<*mut nativeInMemorySigner>::is_null(self.inner) {
794794
let _ = unsafe { Box::from_raw(self.inner) };
795795
}
796796
}
@@ -881,7 +881,7 @@ pub extern "C" fn InMemorySigner_set_commitment_seed(this_ptr: &mut InMemorySign
881881
impl Clone for InMemorySigner {
882882
fn clone(&self) -> Self {
883883
Self {
884-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
884+
inner: if <*mut nativeInMemorySigner>::is_null(self.inner) { std::ptr::null_mut() } else {
885885
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
886886
is_owned: true,
887887
}
@@ -1128,7 +1128,7 @@ pub struct KeysManager {
11281128

11291129
impl Drop for KeysManager {
11301130
fn drop(&mut self) {
1131-
if self.is_owned && !self.inner.is_null() {
1131+
if self.is_owned && !<*mut nativeKeysManager>::is_null(self.inner) {
11321132
let _ = unsafe { Box::from_raw(self.inner) };
11331133
}
11341134
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct OutPoint {
2323

2424
impl Drop for OutPoint {
2525
fn drop(&mut self) {
26-
if self.is_owned && !self.inner.is_null() {
26+
if self.is_owned && !<*mut nativeOutPoint>::is_null(self.inner) {
2727
let _ = unsafe { Box::from_raw(self.inner) };
2828
}
2929
}
@@ -78,7 +78,7 @@ pub extern "C" fn OutPoint_new(mut txid_arg: crate::c_types::ThirtyTwoBytes, mut
7878
impl Clone for OutPoint {
7979
fn clone(&self) -> Self {
8080
Self {
81-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
81+
inner: if <*mut nativeOutPoint>::is_null(self.inner) { std::ptr::null_mut() } else {
8282
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
8383
is_owned: true,
8484
}

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub struct TxCreationKeys {
9797

9898
impl Drop for TxCreationKeys {
9999
fn drop(&mut self) {
100-
if self.is_owned && !self.inner.is_null() {
100+
if self.is_owned && !<*mut nativeTxCreationKeys>::is_null(self.inner) {
101101
let _ = unsafe { Box::from_raw(self.inner) };
102102
}
103103
}
@@ -192,7 +192,7 @@ pub extern "C" fn TxCreationKeys_new(mut per_commitment_point_arg: crate::c_type
192192
impl Clone for TxCreationKeys {
193193
fn clone(&self) -> Self {
194194
Self {
195-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
195+
inner: if <*mut nativeTxCreationKeys>::is_null(self.inner) { std::ptr::null_mut() } else {
196196
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
197197
is_owned: true,
198198
}
@@ -237,7 +237,7 @@ pub struct ChannelPublicKeys {
237237

238238
impl Drop for ChannelPublicKeys {
239239
fn drop(&mut self) {
240-
if self.is_owned && !self.inner.is_null() {
240+
if self.is_owned && !<*mut nativeChannelPublicKeys>::is_null(self.inner) {
241241
let _ = unsafe { Box::from_raw(self.inner) };
242242
}
243243
}
@@ -346,7 +346,7 @@ pub extern "C" fn ChannelPublicKeys_new(mut funding_pubkey_arg: crate::c_types::
346346
impl Clone for ChannelPublicKeys {
347347
fn clone(&self) -> Self {
348348
Self {
349-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
349+
inner: if <*mut nativeChannelPublicKeys>::is_null(self.inner) { std::ptr::null_mut() } else {
350350
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
351351
is_owned: true,
352352
}
@@ -423,7 +423,7 @@ pub struct HTLCOutputInCommitment {
423423

424424
impl Drop for HTLCOutputInCommitment {
425425
fn drop(&mut self) {
426-
if self.is_owned && !self.inner.is_null() {
426+
if self.is_owned && !<*mut nativeHTLCOutputInCommitment>::is_null(self.inner) {
427427
let _ = unsafe { Box::from_raw(self.inner) };
428428
}
429429
}
@@ -500,7 +500,7 @@ pub extern "C" fn HTLCOutputInCommitment_set_payment_hash(this_ptr: &mut HTLCOut
500500
impl Clone for HTLCOutputInCommitment {
501501
fn clone(&self) -> Self {
502502
Self {
503-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
503+
inner: if <*mut nativeHTLCOutputInCommitment>::is_null(self.inner) { std::ptr::null_mut() } else {
504504
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
505505
is_owned: true,
506506
}
@@ -573,7 +573,7 @@ pub struct ChannelTransactionParameters {
573573

574574
impl Drop for ChannelTransactionParameters {
575575
fn drop(&mut self) {
576-
if self.is_owned && !self.inner.is_null() {
576+
if self.is_owned && !<*mut nativeChannelTransactionParameters>::is_null(self.inner) {
577577
let _ = unsafe { Box::from_raw(self.inner) };
578578
}
579579
}
@@ -674,7 +674,7 @@ pub extern "C" fn ChannelTransactionParameters_new(mut holder_pubkeys_arg: crate
674674
impl Clone for ChannelTransactionParameters {
675675
fn clone(&self) -> Self {
676676
Self {
677-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
677+
inner: if <*mut nativeChannelTransactionParameters>::is_null(self.inner) { std::ptr::null_mut() } else {
678678
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
679679
is_owned: true,
680680
}
@@ -705,7 +705,7 @@ pub struct CounterpartyChannelTransactionParameters {
705705

706706
impl Drop for CounterpartyChannelTransactionParameters {
707707
fn drop(&mut self) {
708-
if self.is_owned && !self.inner.is_null() {
708+
if self.is_owned && !<*mut nativeCounterpartyChannelTransactionParameters>::is_null(self.inner) {
709709
let _ = unsafe { Box::from_raw(self.inner) };
710710
}
711711
}
@@ -760,7 +760,7 @@ pub extern "C" fn CounterpartyChannelTransactionParameters_new(mut pubkeys_arg:
760760
impl Clone for CounterpartyChannelTransactionParameters {
761761
fn clone(&self) -> Self {
762762
Self {
763-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
763+
inner: if <*mut nativeCounterpartyChannelTransactionParameters>::is_null(self.inner) { std::ptr::null_mut() } else {
764764
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
765765
is_owned: true,
766766
}
@@ -853,7 +853,7 @@ pub struct DirectedChannelTransactionParameters {
853853

854854
impl Drop for DirectedChannelTransactionParameters {
855855
fn drop(&mut self) {
856-
if self.is_owned && !self.inner.is_null() {
856+
if self.is_owned && !<*mut nativeDirectedChannelTransactionParameters>::is_null(self.inner) {
857857
let _ = unsafe { Box::from_raw(self.inner) };
858858
}
859859
}
@@ -937,7 +937,7 @@ pub struct HolderCommitmentTransaction {
937937

938938
impl Drop for HolderCommitmentTransaction {
939939
fn drop(&mut self) {
940-
if self.is_owned && !self.inner.is_null() {
940+
if self.is_owned && !<*mut nativeHolderCommitmentTransaction>::is_null(self.inner) {
941941
let _ = unsafe { Box::from_raw(self.inner) };
942942
}
943943
}
@@ -979,7 +979,7 @@ pub extern "C" fn HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_pt
979979
impl Clone for HolderCommitmentTransaction {
980980
fn clone(&self) -> Self {
981981
Self {
982-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
982+
inner: if <*mut nativeHolderCommitmentTransaction>::is_null(self.inner) { std::ptr::null_mut() } else {
983983
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
984984
is_owned: true,
985985
}
@@ -1034,7 +1034,7 @@ pub struct BuiltCommitmentTransaction {
10341034

10351035
impl Drop for BuiltCommitmentTransaction {
10361036
fn drop(&mut self) {
1037-
if self.is_owned && !self.inner.is_null() {
1037+
if self.is_owned && !<*mut nativeBuiltCommitmentTransaction>::is_null(self.inner) {
10381038
let _ = unsafe { Box::from_raw(self.inner) };
10391039
}
10401040
}
@@ -1096,7 +1096,7 @@ pub extern "C" fn BuiltCommitmentTransaction_new(mut transaction_arg: crate::c_t
10961096
impl Clone for BuiltCommitmentTransaction {
10971097
fn clone(&self) -> Self {
10981098
Self {
1099-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
1099+
inner: if <*mut nativeBuiltCommitmentTransaction>::is_null(self.inner) { std::ptr::null_mut() } else {
11001100
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
11011101
is_owned: true,
11021102
}
@@ -1165,7 +1165,7 @@ pub struct CommitmentTransaction {
11651165

11661166
impl Drop for CommitmentTransaction {
11671167
fn drop(&mut self) {
1168-
if self.is_owned && !self.inner.is_null() {
1168+
if self.is_owned && !<*mut nativeCommitmentTransaction>::is_null(self.inner) {
11691169
let _ = unsafe { Box::from_raw(self.inner) };
11701170
}
11711171
}
@@ -1190,7 +1190,7 @@ impl CommitmentTransaction {
11901190
impl Clone for CommitmentTransaction {
11911191
fn clone(&self) -> Self {
11921192
Self {
1193-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
1193+
inner: if <*mut nativeCommitmentTransaction>::is_null(self.inner) { std::ptr::null_mut() } else {
11941194
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
11951195
is_owned: true,
11961196
}
@@ -1299,7 +1299,7 @@ pub struct TrustedCommitmentTransaction {
12991299

13001300
impl Drop for TrustedCommitmentTransaction {
13011301
fn drop(&mut self) {
1302-
if self.is_owned && !self.inner.is_null() {
1302+
if self.is_owned && !<*mut nativeTrustedCommitmentTransaction>::is_null(self.inner) {
13031303
let _ = unsafe { Box::from_raw(self.inner) };
13041304
}
13051305
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub struct ChannelManager {
6464

6565
impl Drop for ChannelManager {
6666
fn drop(&mut self) {
67-
if self.is_owned && !self.inner.is_null() {
67+
if self.is_owned && !<*mut nativeChannelManager>::is_null(self.inner) {
6868
let _ = unsafe { Box::from_raw(self.inner) };
6969
}
7070
}
@@ -106,7 +106,7 @@ pub struct ChainParameters {
106106

107107
impl Drop for ChainParameters {
108108
fn drop(&mut self) {
109-
if self.is_owned && !self.inner.is_null() {
109+
if self.is_owned && !<*mut nativeChainParameters>::is_null(self.inner) {
110110
let _ = unsafe { Box::from_raw(self.inner) };
111111
}
112112
}
@@ -190,7 +190,7 @@ pub struct ChannelDetails {
190190

191191
impl Drop for ChannelDetails {
192192
fn drop(&mut self) {
193-
if self.is_owned && !self.inner.is_null() {
193+
if self.is_owned && !<*mut nativeChannelDetails>::is_null(self.inner) {
194194
let _ = unsafe { Box::from_raw(self.inner) };
195195
}
196196
}
@@ -329,7 +329,7 @@ pub extern "C" fn ChannelDetails_set_is_live(this_ptr: &mut ChannelDetails, mut
329329
impl Clone for ChannelDetails {
330330
fn clone(&self) -> Self {
331331
Self {
332-
inner: if self.inner.is_null() { std::ptr::null_mut() } else {
332+
inner: if <*mut nativeChannelDetails>::is_null(self.inner) { std::ptr::null_mut() } else {
333333
Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
334334
is_owned: true,
335335
}
@@ -1030,7 +1030,7 @@ pub struct ChannelManagerReadArgs {
10301030

10311031
impl Drop for ChannelManagerReadArgs {
10321032
fn drop(&mut self) {
1033-
if self.is_owned && !self.inner.is_null() {
1033+
if self.is_owned && !<*mut nativeChannelManagerReadArgs>::is_null(self.inner) {
10341034
let _ = unsafe { Box::from_raw(self.inner) };
10351035
}
10361036
}

0 commit comments

Comments
 (0)