//! raw socket events into your non-internet-facing system and then send routing events back to
//! track the network on the less-secure system.
+use std::str::FromStr;
use std::ffi::c_void;
use bitcoin::hashes::Hash;
use crate::c_types::*;
#[no_mangle]
pub extern "C" fn Init_get_features(this_ptr: &Init) -> crate::lightning::ln::features::InitFeatures {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.features;
- crate::lightning::ln::features::InitFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+ crate::lightning::ln::features::InitFeatures { inner: unsafe { ( (&(*inner_val) as *const _) as *mut _) }, is_owned: false }
}
/// The relevant features which the sender supports
#[no_mangle]
#[no_mangle]
pub extern "C" fn ErrorMessage_get_channel_id(this_ptr: &ErrorMessage) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID involved in the error
#[no_mangle]
#[no_mangle]
pub extern "C" fn ErrorMessage_get_data(this_ptr: &ErrorMessage) -> crate::c_types::Str {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.data;
- (*inner_val).as_str().into()
+ inner_val.as_str().into()
}
/// A possibly human-readable error description.
/// The string should be sanitized before it is used (e.g. emitted to logs
/// or printed to stdout). Otherwise, a well crafted error message may trigger a security
/// vulnerability in the terminal emulator or the logging subsystem.
#[no_mangle]
-pub extern "C" fn ErrorMessage_set_data(this_ptr: &mut ErrorMessage, mut val: crate::c_types::derived::CVec_u8Z) {
- unsafe { &mut *this_ptr.inner }.data = String::from_utf8(val.into_rust()).unwrap();
+pub extern "C" fn ErrorMessage_set_data(this_ptr: &mut ErrorMessage, mut val: crate::c_types::Str) {
+ unsafe { &mut *this_ptr.inner }.data = val.into_string();
}
/// Constructs a new ErrorMessage given each field
#[must_use]
#[no_mangle]
-pub extern "C" fn ErrorMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut data_arg: crate::c_types::derived::CVec_u8Z) -> ErrorMessage {
+pub extern "C" fn ErrorMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwoBytes, mut data_arg: crate::c_types::Str) -> ErrorMessage {
ErrorMessage { inner: Box::into_raw(Box::new(nativeErrorMessage {
channel_id: channel_id_arg.data,
- data: String::from_utf8(data_arg.into_rust()).unwrap(),
+ data: data_arg.into_string(),
})), is_owned: true }
}
impl Clone for ErrorMessage {
#[no_mangle]
pub extern "C" fn Ping_get_ponglen(this_ptr: &Ping) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.ponglen;
- (*inner_val)
+ *inner_val
}
/// The desired response length
#[no_mangle]
#[no_mangle]
pub extern "C" fn Ping_get_byteslen(this_ptr: &Ping) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.byteslen;
- (*inner_val)
+ *inner_val
}
/// The ping packet size.
/// This field is not sent on the wire. byteslen zeros are sent.
#[no_mangle]
pub extern "C" fn Pong_get_byteslen(this_ptr: &Pong) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.byteslen;
- (*inner_val)
+ *inner_val
}
/// The pong packet size.
/// This field is not sent on the wire. byteslen zeros are sent.
#[no_mangle]
pub extern "C" fn OpenChannel_get_chain_hash(this_ptr: &OpenChannel) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain where the channel is to be opened
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_temporary_channel_id(this_ptr: &OpenChannel) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.temporary_channel_id;
- &(*inner_val)
+ inner_val
}
/// A temporary channel ID, until the funding outpoint is announced
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_funding_satoshis(this_ptr: &OpenChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.funding_satoshis;
- (*inner_val)
+ *inner_val
}
/// The channel value
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_push_msat(this_ptr: &OpenChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.push_msat;
- (*inner_val)
+ *inner_val
}
/// The amount to push to the counterparty as part of the open, in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_dust_limit_satoshis(this_ptr: &OpenChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.dust_limit_satoshis;
- (*inner_val)
+ *inner_val
}
/// The threshold below which outputs on transactions broadcast by sender will be omitted
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr: &OpenChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.max_htlc_value_in_flight_msat;
- (*inner_val)
+ *inner_val
}
/// The maximum inbound HTLC value in flight towards sender, in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_channel_reserve_satoshis(this_ptr: &OpenChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_reserve_satoshis;
- (*inner_val)
+ *inner_val
}
/// The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_htlc_minimum_msat(this_ptr: &OpenChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_minimum_msat;
- (*inner_val)
+ *inner_val
}
/// The minimum HTLC size incoming to sender, in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_feerate_per_kw(this_ptr: &OpenChannel) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.feerate_per_kw;
- (*inner_val)
+ *inner_val
}
/// The feerate per 1000-weight of sender generated transactions, until updated by update_fee
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_to_self_delay(this_ptr: &OpenChannel) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.to_self_delay;
- (*inner_val)
+ *inner_val
}
/// The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_max_accepted_htlcs(this_ptr: &OpenChannel) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.max_accepted_htlcs;
- (*inner_val)
+ *inner_val
}
/// The maximum number of inbound HTLCs towards sender
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_funding_pubkey(this_ptr: &OpenChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.funding_pubkey;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The sender's key controlling the funding transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_revocation_basepoint(this_ptr: &OpenChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.revocation_basepoint;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// Used to derive a revocation key for transactions broadcast by counterparty
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_payment_point(this_ptr: &OpenChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.payment_point;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// A payment key to sender for transactions broadcast by counterparty
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_delayed_payment_basepoint(this_ptr: &OpenChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.delayed_payment_basepoint;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// Used to derive a payment key to sender for transactions broadcast by sender
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_htlc_basepoint(this_ptr: &OpenChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_basepoint;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// Used to derive an HTLC payment key to sender
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_first_per_commitment_point(this_ptr: &OpenChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_per_commitment_point;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The first to-be-broadcast-by-sender transaction's per commitment point
#[no_mangle]
#[no_mangle]
pub extern "C" fn OpenChannel_get_channel_flags(this_ptr: &OpenChannel) -> u8 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_flags;
- (*inner_val)
+ *inner_val
}
/// Channel flags
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_temporary_channel_id(this_ptr: &AcceptChannel) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.temporary_channel_id;
- &(*inner_val)
+ inner_val
}
/// A temporary channel ID, until the funding outpoint is announced
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_dust_limit_satoshis(this_ptr: &AcceptChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.dust_limit_satoshis;
- (*inner_val)
+ *inner_val
}
/// The threshold below which outputs on transactions broadcast by sender will be omitted
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr: &AcceptChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.max_htlc_value_in_flight_msat;
- (*inner_val)
+ *inner_val
}
/// The maximum inbound HTLC value in flight towards sender, in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_channel_reserve_satoshis(this_ptr: &AcceptChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_reserve_satoshis;
- (*inner_val)
+ *inner_val
}
/// The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_htlc_minimum_msat(this_ptr: &AcceptChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_minimum_msat;
- (*inner_val)
+ *inner_val
}
/// The minimum HTLC size incoming to sender, in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_minimum_depth(this_ptr: &AcceptChannel) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.minimum_depth;
- (*inner_val)
+ *inner_val
}
/// Minimum depth of the funding transaction before the channel is considered open
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_to_self_delay(this_ptr: &AcceptChannel) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.to_self_delay;
- (*inner_val)
+ *inner_val
}
/// The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_max_accepted_htlcs(this_ptr: &AcceptChannel) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.max_accepted_htlcs;
- (*inner_val)
+ *inner_val
}
/// The maximum number of inbound HTLCs towards sender
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_funding_pubkey(this_ptr: &AcceptChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.funding_pubkey;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The sender's key controlling the funding transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_revocation_basepoint(this_ptr: &AcceptChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.revocation_basepoint;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// Used to derive a revocation key for transactions broadcast by counterparty
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_payment_point(this_ptr: &AcceptChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.payment_point;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// A payment key to sender for transactions broadcast by counterparty
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_delayed_payment_basepoint(this_ptr: &AcceptChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.delayed_payment_basepoint;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// Used to derive a payment key to sender for transactions broadcast by sender
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_htlc_basepoint(this_ptr: &AcceptChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_basepoint;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
#[no_mangle]
#[no_mangle]
pub extern "C" fn AcceptChannel_get_first_per_commitment_point(this_ptr: &AcceptChannel) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_per_commitment_point;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The first to-be-broadcast-by-sender transaction's per commitment point
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingCreated_get_temporary_channel_id(this_ptr: &FundingCreated) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.temporary_channel_id;
- &(*inner_val)
+ inner_val
}
/// A temporary channel ID, until the funding is established
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingCreated_get_funding_txid(this_ptr: &FundingCreated) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.funding_txid;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The funding transaction ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingCreated_get_funding_output_index(this_ptr: &FundingCreated) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.funding_output_index;
- (*inner_val)
+ *inner_val
}
/// The specific output index funding this channel
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingCreated_get_signature(this_ptr: &FundingCreated) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// The signature of the channel initiator (funder) on the funding transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingSigned_get_channel_id(this_ptr: &FundingSigned) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingSigned_get_signature(this_ptr: &FundingSigned) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// The signature of the channel acceptor (fundee) on the funding transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingLocked_get_channel_id(this_ptr: &FundingLocked) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn FundingLocked_get_next_per_commitment_point(this_ptr: &FundingLocked) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.next_per_commitment_point;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The per-commitment point of the second commitment transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn Shutdown_get_channel_id(this_ptr: &Shutdown) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn Shutdown_get_scriptpubkey(this_ptr: &Shutdown) -> crate::c_types::u8slice {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.scriptpubkey;
- crate::c_types::u8slice::from_slice(&(*inner_val)[..])
+ crate::c_types::u8slice::from_slice(&inner_val[..])
}
/// The destination of this peer's funds on closing.
/// Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
#[no_mangle]
pub extern "C" fn ClosingSigned_get_channel_id(this_ptr: &ClosingSigned) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn ClosingSigned_get_fee_satoshis(this_ptr: &ClosingSigned) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.fee_satoshis;
- (*inner_val)
+ *inner_val
}
/// The proposed total fee for the closing transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn ClosingSigned_get_signature(this_ptr: &ClosingSigned) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// A signature on the closing transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateAddHTLC_get_channel_id(this_ptr: &UpdateAddHTLC) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateAddHTLC_get_htlc_id(this_ptr: &UpdateAddHTLC) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_id;
- (*inner_val)
+ *inner_val
}
/// The HTLC ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateAddHTLC_get_amount_msat(this_ptr: &UpdateAddHTLC) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.amount_msat;
- (*inner_val)
+ *inner_val
}
/// The HTLC value in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateAddHTLC_get_payment_hash(this_ptr: &UpdateAddHTLC) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.payment_hash;
- &(*inner_val).0
+ &inner_val.0
}
/// The payment hash, the pre-image of which controls HTLC redemption
#[no_mangle]
pub extern "C" fn UpdateAddHTLC_set_payment_hash(this_ptr: &mut UpdateAddHTLC, mut val: crate::c_types::ThirtyTwoBytes) {
- unsafe { &mut *this_ptr.inner }.payment_hash = ::lightning::ln::channelmanager::PaymentHash(val.data);
+ unsafe { &mut *this_ptr.inner }.payment_hash = ::lightning::ln::PaymentHash(val.data);
}
/// The expiry height of the HTLC
#[no_mangle]
pub extern "C" fn UpdateAddHTLC_get_cltv_expiry(this_ptr: &UpdateAddHTLC) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.cltv_expiry;
- (*inner_val)
+ *inner_val
}
/// The expiry height of the HTLC
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFulfillHTLC_get_channel_id(this_ptr: &UpdateFulfillHTLC) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFulfillHTLC_get_htlc_id(this_ptr: &UpdateFulfillHTLC) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_id;
- (*inner_val)
+ *inner_val
}
/// The HTLC ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFulfillHTLC_get_payment_preimage(this_ptr: &UpdateFulfillHTLC) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.payment_preimage;
- &(*inner_val).0
+ &inner_val.0
}
/// The pre-image of the payment hash, allowing HTLC redemption
#[no_mangle]
pub extern "C" fn UpdateFulfillHTLC_set_payment_preimage(this_ptr: &mut UpdateFulfillHTLC, mut val: crate::c_types::ThirtyTwoBytes) {
- unsafe { &mut *this_ptr.inner }.payment_preimage = ::lightning::ln::channelmanager::PaymentPreimage(val.data);
+ unsafe { &mut *this_ptr.inner }.payment_preimage = ::lightning::ln::PaymentPreimage(val.data);
}
/// Constructs a new UpdateFulfillHTLC given each field
#[must_use]
UpdateFulfillHTLC { inner: Box::into_raw(Box::new(nativeUpdateFulfillHTLC {
channel_id: channel_id_arg.data,
htlc_id: htlc_id_arg,
- payment_preimage: ::lightning::ln::channelmanager::PaymentPreimage(payment_preimage_arg.data),
+ payment_preimage: ::lightning::ln::PaymentPreimage(payment_preimage_arg.data),
})), is_owned: true }
}
impl Clone for UpdateFulfillHTLC {
#[no_mangle]
pub extern "C" fn UpdateFailHTLC_get_channel_id(this_ptr: &UpdateFailHTLC) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFailHTLC_get_htlc_id(this_ptr: &UpdateFailHTLC) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_id;
- (*inner_val)
+ *inner_val
}
/// The HTLC ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFailMalformedHTLC_get_channel_id(this_ptr: &UpdateFailMalformedHTLC) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFailMalformedHTLC_get_htlc_id(this_ptr: &UpdateFailMalformedHTLC) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_id;
- (*inner_val)
+ *inner_val
}
/// The HTLC ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFailMalformedHTLC_get_failure_code(this_ptr: &UpdateFailMalformedHTLC) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.failure_code;
- (*inner_val)
+ *inner_val
}
/// The failure code
#[no_mangle]
#[no_mangle]
pub extern "C" fn CommitmentSigned_get_channel_id(this_ptr: &CommitmentSigned) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn CommitmentSigned_get_signature(this_ptr: &CommitmentSigned) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// A signature on the commitment transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn RevokeAndACK_get_channel_id(this_ptr: &RevokeAndACK) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn RevokeAndACK_get_per_commitment_secret(this_ptr: &RevokeAndACK) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.per_commitment_secret;
- &(*inner_val)
+ inner_val
}
/// The secret corresponding to the per-commitment point
#[no_mangle]
#[no_mangle]
pub extern "C" fn RevokeAndACK_get_next_per_commitment_point(this_ptr: &RevokeAndACK) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.next_per_commitment_point;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The next sender-broadcast commitment transaction's per-commitment point
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFee_get_channel_id(this_ptr: &UpdateFee) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UpdateFee_get_feerate_per_kw(this_ptr: &UpdateFee) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.feerate_per_kw;
- (*inner_val)
+ *inner_val
}
/// Fee rate per 1000-weight of the transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn DataLossProtect_get_your_last_per_commitment_secret(this_ptr: &DataLossProtect) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.your_last_per_commitment_secret;
- &(*inner_val)
+ inner_val
}
/// Proof that the sender knows the per-commitment secret of a specific commitment transaction
/// belonging to the recipient
#[no_mangle]
pub extern "C" fn DataLossProtect_get_my_current_per_commitment_point(this_ptr: &DataLossProtect) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.my_current_per_commitment_point;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The sender's per-commitment point for their current commitment transaction
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelReestablish_get_channel_id(this_ptr: &ChannelReestablish) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelReestablish_get_next_local_commitment_number(this_ptr: &ChannelReestablish) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.next_local_commitment_number;
- (*inner_val)
+ *inner_val
}
/// The next commitment number for the sender
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelReestablish_get_next_remote_commitment_number(this_ptr: &ChannelReestablish) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.next_remote_commitment_number;
- (*inner_val)
+ *inner_val
}
/// The next commitment number for the recipient
#[no_mangle]
#[no_mangle]
pub extern "C" fn AnnouncementSignatures_get_channel_id(this_ptr: &AnnouncementSignatures) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_id;
- &(*inner_val)
+ inner_val
}
/// The channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn AnnouncementSignatures_get_short_channel_id(this_ptr: &AnnouncementSignatures) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.short_channel_id;
- (*inner_val)
+ *inner_val
}
/// The short channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn AnnouncementSignatures_get_node_signature(this_ptr: &AnnouncementSignatures) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.node_signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// A signature by the node key
#[no_mangle]
#[no_mangle]
pub extern "C" fn AnnouncementSignatures_get_bitcoin_signature(this_ptr: &AnnouncementSignatures) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.bitcoin_signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// A signature by the funding key
#[no_mangle]
let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { let mut local_res_0 = match o { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::NetAddress::native_into(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { e }).into() }; local_res_0 }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
local_res
}
+#[no_mangle]
+/// Read a NetAddress from a byte array, created by NetAddress_write
+pub extern "C" fn NetAddress_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NetAddressDecodeErrorZ {
+ let res = crate::c_types::deserialize_obj(ser);
+ let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::ln::msgs::NetAddress::native_into(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+ local_res
+}
use lightning::ln::msgs::UnsignedNodeAnnouncement as nativeUnsignedNodeAnnouncementImport;
type nativeUnsignedNodeAnnouncement = nativeUnsignedNodeAnnouncementImport;
#[no_mangle]
pub extern "C" fn UnsignedNodeAnnouncement_get_features(this_ptr: &UnsignedNodeAnnouncement) -> crate::lightning::ln::features::NodeFeatures {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.features;
- crate::lightning::ln::features::NodeFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+ crate::lightning::ln::features::NodeFeatures { inner: unsafe { ( (&(*inner_val) as *const _) as *mut _) }, is_owned: false }
}
/// The advertised features
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedNodeAnnouncement_get_timestamp(this_ptr: &UnsignedNodeAnnouncement) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.timestamp;
- (*inner_val)
+ *inner_val
}
/// A strictly monotonic announcement counter, with gaps allowed
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedNodeAnnouncement_get_node_id(this_ptr: &UnsignedNodeAnnouncement) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.node_id;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The node_id this announcement originated from (don't rebroadcast the node_announcement back
/// to this node).
#[no_mangle]
pub extern "C" fn UnsignedNodeAnnouncement_get_rgb(this_ptr: &UnsignedNodeAnnouncement) -> *const [u8; 3] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.rgb;
- &(*inner_val)
+ inner_val
}
/// An RGB color for UI purposes
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedNodeAnnouncement_get_alias(this_ptr: &UnsignedNodeAnnouncement) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.alias;
- &(*inner_val)
+ inner_val
}
/// An alias, for UI purposes. This should be sanitized before use. There is no guarantee
/// of uniqueness.
#[no_mangle]
pub extern "C" fn NodeAnnouncement_get_signature(this_ptr: &NodeAnnouncement) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// The signature by the node key
#[no_mangle]
#[no_mangle]
pub extern "C" fn NodeAnnouncement_get_contents(this_ptr: &NodeAnnouncement) -> crate::lightning::ln::msgs::UnsignedNodeAnnouncement {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.contents;
- crate::lightning::ln::msgs::UnsignedNodeAnnouncement { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+ crate::lightning::ln::msgs::UnsignedNodeAnnouncement { inner: unsafe { ( (&(*inner_val) as *const _) as *mut _) }, is_owned: false }
}
/// The actual content of the announcement
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_features(this_ptr: &UnsignedChannelAnnouncement) -> crate::lightning::ln::features::ChannelFeatures {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.features;
- crate::lightning::ln::features::ChannelFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+ crate::lightning::ln::features::ChannelFeatures { inner: unsafe { ( (&(*inner_val) as *const _) as *mut _) }, is_owned: false }
}
/// The advertised channel features
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_chain_hash(this_ptr: &UnsignedChannelAnnouncement) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain where the channel is to be opened
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_short_channel_id(this_ptr: &UnsignedChannelAnnouncement) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.short_channel_id;
- (*inner_val)
+ *inner_val
}
/// The short channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_node_id_1(this_ptr: &UnsignedChannelAnnouncement) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.node_id_1;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// One of the two node_ids which are endpoints of this channel
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_node_id_2(this_ptr: &UnsignedChannelAnnouncement) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.node_id_2;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The other of the two node_ids which are endpoints of this channel
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr: &UnsignedChannelAnnouncement) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.bitcoin_key_1;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The funding key for the first node
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr: &UnsignedChannelAnnouncement) -> crate::c_types::PublicKey {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.bitcoin_key_2;
- crate::c_types::PublicKey::from_rust(&(*inner_val))
+ crate::c_types::PublicKey::from_rust(&inner_val)
}
/// The funding key for the second node
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelAnnouncement_get_node_signature_1(this_ptr: &ChannelAnnouncement) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.node_signature_1;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// Authentication of the announcement by the first public node
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelAnnouncement_get_node_signature_2(this_ptr: &ChannelAnnouncement) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.node_signature_2;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// Authentication of the announcement by the second public node
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelAnnouncement_get_bitcoin_signature_1(this_ptr: &ChannelAnnouncement) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.bitcoin_signature_1;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// Proof of funding UTXO ownership by the first public node
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelAnnouncement_get_bitcoin_signature_2(this_ptr: &ChannelAnnouncement) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.bitcoin_signature_2;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// Proof of funding UTXO ownership by the second public node
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelAnnouncement_get_contents(this_ptr: &ChannelAnnouncement) -> crate::lightning::ln::msgs::UnsignedChannelAnnouncement {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.contents;
- crate::lightning::ln::msgs::UnsignedChannelAnnouncement { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+ crate::lightning::ln::msgs::UnsignedChannelAnnouncement { inner: unsafe { ( (&(*inner_val) as *const _) as *mut _) }, is_owned: false }
}
/// The actual announcement
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_chain_hash(this_ptr: &UnsignedChannelUpdate) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain where the channel is to be opened
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_short_channel_id(this_ptr: &UnsignedChannelUpdate) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.short_channel_id;
- (*inner_val)
+ *inner_val
}
/// The short channel ID
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_timestamp(this_ptr: &UnsignedChannelUpdate) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.timestamp;
- (*inner_val)
+ *inner_val
}
/// A strictly monotonic announcement counter, with gaps allowed, specific to this channel
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_flags(this_ptr: &UnsignedChannelUpdate) -> u8 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.flags;
- (*inner_val)
+ *inner_val
}
/// Channel flags
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr: &UnsignedChannelUpdate) -> u16 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.cltv_expiry_delta;
- (*inner_val)
+ *inner_val
}
/// The number of blocks such that if:
/// `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr: &UnsignedChannelUpdate) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_minimum_msat;
- (*inner_val)
+ *inner_val
}
/// The minimum HTLC size incoming to sender, in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_fee_base_msat(this_ptr: &UnsignedChannelUpdate) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.fee_base_msat;
- (*inner_val)
+ *inner_val
}
/// The base HTLC fee charged by sender, in milli-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr: &UnsignedChannelUpdate) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.fee_proportional_millionths;
- (*inner_val)
+ *inner_val
}
/// The amount to fee multiplier, in micro-satoshi
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelUpdate_get_signature(this_ptr: &ChannelUpdate) -> crate::c_types::Signature {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
- crate::c_types::Signature::from_rust(&(*inner_val))
+ crate::c_types::Signature::from_rust(&inner_val)
}
/// A signature of the channel update
#[no_mangle]
#[no_mangle]
pub extern "C" fn ChannelUpdate_get_contents(this_ptr: &ChannelUpdate) -> crate::lightning::ln::msgs::UnsignedChannelUpdate {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.contents;
- crate::lightning::ln::msgs::UnsignedChannelUpdate { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+ crate::lightning::ln::msgs::UnsignedChannelUpdate { inner: unsafe { ( (&(*inner_val) as *const _) as *mut _) }, is_owned: false }
}
/// The actual channel update
#[no_mangle]
#[no_mangle]
pub extern "C" fn QueryChannelRange_get_chain_hash(this_ptr: &QueryChannelRange) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain being queried
#[no_mangle]
#[no_mangle]
pub extern "C" fn QueryChannelRange_get_first_blocknum(this_ptr: &QueryChannelRange) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_blocknum;
- (*inner_val)
+ *inner_val
}
/// The height of the first block for the channel UTXOs being queried
#[no_mangle]
#[no_mangle]
pub extern "C" fn QueryChannelRange_get_number_of_blocks(this_ptr: &QueryChannelRange) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.number_of_blocks;
- (*inner_val)
+ *inner_val
}
/// The number of blocks to include in the query results
#[no_mangle]
#[no_mangle]
pub extern "C" fn ReplyChannelRange_get_chain_hash(this_ptr: &ReplyChannelRange) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain being queried
#[no_mangle]
#[no_mangle]
pub extern "C" fn ReplyChannelRange_get_first_blocknum(this_ptr: &ReplyChannelRange) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_blocknum;
- (*inner_val)
+ *inner_val
}
/// The height of the first block in the range of the reply
#[no_mangle]
#[no_mangle]
pub extern "C" fn ReplyChannelRange_get_number_of_blocks(this_ptr: &ReplyChannelRange) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.number_of_blocks;
- (*inner_val)
+ *inner_val
}
/// The number of blocks included in the range of the reply
#[no_mangle]
#[no_mangle]
pub extern "C" fn ReplyChannelRange_get_sync_complete(this_ptr: &ReplyChannelRange) -> bool {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.sync_complete;
- (*inner_val)
+ *inner_val
}
/// True when this is the final reply for a query
#[no_mangle]
#[no_mangle]
pub extern "C" fn QueryShortChannelIds_get_chain_hash(this_ptr: &QueryShortChannelIds) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain being queried
#[no_mangle]
#[no_mangle]
pub extern "C" fn ReplyShortChannelIdsEnd_get_chain_hash(this_ptr: &ReplyShortChannelIdsEnd) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain that was queried
#[no_mangle]
#[no_mangle]
pub extern "C" fn ReplyShortChannelIdsEnd_get_full_information(this_ptr: &ReplyShortChannelIdsEnd) -> bool {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.full_information;
- (*inner_val)
+ *inner_val
}
/// Indicates if the query recipient maintains up-to-date channel
/// information for the chain_hash
#[no_mangle]
pub extern "C" fn GossipTimestampFilter_get_chain_hash(this_ptr: &GossipTimestampFilter) -> *const [u8; 32] {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
- (*inner_val).as_inner()
+ inner_val.as_inner()
}
/// The genesis hash of the blockchain for channel and node information
#[no_mangle]
#[no_mangle]
pub extern "C" fn GossipTimestampFilter_get_first_timestamp(this_ptr: &GossipTimestampFilter) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_timestamp;
- (*inner_val)
+ *inner_val
}
/// The starting unix timestamp
#[no_mangle]
#[no_mangle]
pub extern "C" fn GossipTimestampFilter_get_timestamp_range(this_ptr: &GossipTimestampFilter) -> u32 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.timestamp_range;
- (*inner_val)
+ *inner_val
}
/// The range of information in seconds
#[no_mangle]
#[no_mangle]
pub extern "C" fn LightningError_get_err(this_ptr: &LightningError) -> crate::c_types::Str {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.err;
- (*inner_val).as_str().into()
+ inner_val.as_str().into()
}
/// A human-readable message describing the error
#[no_mangle]
-pub extern "C" fn LightningError_set_err(this_ptr: &mut LightningError, mut val: crate::c_types::derived::CVec_u8Z) {
- unsafe { &mut *this_ptr.inner }.err = String::from_utf8(val.into_rust()).unwrap();
+pub extern "C" fn LightningError_set_err(this_ptr: &mut LightningError, mut val: crate::c_types::Str) {
+ unsafe { &mut *this_ptr.inner }.err = val.into_string();
}
/// The action which should be taken against the offending peer.
#[no_mangle]
pub extern "C" fn LightningError_get_action(this_ptr: &LightningError) -> crate::lightning::ln::msgs::ErrorAction {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.action;
- crate::lightning::ln::msgs::ErrorAction::from_native(&(*inner_val))
+ crate::lightning::ln::msgs::ErrorAction::from_native(inner_val)
}
/// The action which should be taken against the offending peer.
#[no_mangle]
/// Constructs a new LightningError given each field
#[must_use]
#[no_mangle]
-pub extern "C" fn LightningError_new(mut err_arg: crate::c_types::derived::CVec_u8Z, mut action_arg: crate::lightning::ln::msgs::ErrorAction) -> LightningError {
+pub extern "C" fn LightningError_new(mut err_arg: crate::c_types::Str, mut action_arg: crate::lightning::ln::msgs::ErrorAction) -> LightningError {
LightningError { inner: Box::into_raw(Box::new(nativeLightningError {
- err: String::from_utf8(err_arg.into_rust()).unwrap(),
+ err: err_arg.into_string(),
action: action_arg.into_native(),
})), is_owned: true }
}
#[no_mangle]
pub extern "C" fn CommitmentUpdate_get_commitment_signed(this_ptr: &CommitmentUpdate) -> crate::lightning::ln::msgs::CommitmentSigned {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.commitment_signed;
- crate::lightning::ln::msgs::CommitmentSigned { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+ crate::lightning::ln::msgs::CommitmentSigned { inner: unsafe { ( (&(*inner_val) as *const _) as *mut _) }, is_owned: false }
}
/// Finally, the commitment_signed message which should be sent
#[no_mangle]
/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
+unsafe impl Send for ChannelMessageHandler {}
+unsafe impl Sync for ChannelMessageHandler {}
impl lightning::util::events::MessageSendEventsProvider for ChannelMessageHandler {
fn get_and_clear_pending_msg_events(&self) -> Vec<lightning::util::events::MessageSendEvent> {
let mut ret = (self.MessageSendEventsProvider.get_and_clear_pending_msg_events)(self.this_arg);
local_ret
}
}
-unsafe impl Send for ChannelMessageHandler {}
-unsafe impl Sync for ChannelMessageHandler {}
use lightning::ln::msgs::ChannelMessageHandler as rustChannelMessageHandler;
impl rustChannelMessageHandler for ChannelMessageHandler {
- fn handle_open_channel(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, their_features: lightning::ln::features::InitFeatures, msg: &lightning::ln::msgs::OpenChannel) {
+ fn handle_open_channel(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut their_features: lightning::ln::features::InitFeatures, mut msg: &lightning::ln::msgs::OpenChannel) {
(self.handle_open_channel)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::lightning::ln::features::InitFeatures { inner: Box::into_raw(Box::new(their_features)), is_owned: true }, &crate::lightning::ln::msgs::OpenChannel { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_accept_channel(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, their_features: lightning::ln::features::InitFeatures, msg: &lightning::ln::msgs::AcceptChannel) {
+ fn handle_accept_channel(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut their_features: lightning::ln::features::InitFeatures, mut msg: &lightning::ln::msgs::AcceptChannel) {
(self.handle_accept_channel)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::lightning::ln::features::InitFeatures { inner: Box::into_raw(Box::new(their_features)), is_owned: true }, &crate::lightning::ln::msgs::AcceptChannel { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_funding_created(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::FundingCreated) {
+ fn handle_funding_created(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::FundingCreated) {
(self.handle_funding_created)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::FundingCreated { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_funding_signed(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::FundingSigned) {
+ fn handle_funding_signed(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::FundingSigned) {
(self.handle_funding_signed)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::FundingSigned { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_funding_locked(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::FundingLocked) {
+ fn handle_funding_locked(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::FundingLocked) {
(self.handle_funding_locked)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::FundingLocked { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_shutdown(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, their_features: &lightning::ln::features::InitFeatures, msg: &lightning::ln::msgs::Shutdown) {
+ fn handle_shutdown(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut their_features: &lightning::ln::features::InitFeatures, mut msg: &lightning::ln::msgs::Shutdown) {
(self.handle_shutdown)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::features::InitFeatures { inner: unsafe { (their_features as *const _) as *mut _ }, is_owned: false }, &crate::lightning::ln::msgs::Shutdown { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_closing_signed(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ClosingSigned) {
+ fn handle_closing_signed(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::ClosingSigned) {
(self.handle_closing_signed)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::ClosingSigned { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_update_add_htlc(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::UpdateAddHTLC) {
+ fn handle_update_add_htlc(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::UpdateAddHTLC) {
(self.handle_update_add_htlc)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::UpdateAddHTLC { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_update_fulfill_htlc(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::UpdateFulfillHTLC) {
+ fn handle_update_fulfill_htlc(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::UpdateFulfillHTLC) {
(self.handle_update_fulfill_htlc)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::UpdateFulfillHTLC { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_update_fail_htlc(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::UpdateFailHTLC) {
+ fn handle_update_fail_htlc(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::UpdateFailHTLC) {
(self.handle_update_fail_htlc)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::UpdateFailHTLC { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_update_fail_malformed_htlc(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::UpdateFailMalformedHTLC) {
+ fn handle_update_fail_malformed_htlc(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::UpdateFailMalformedHTLC) {
(self.handle_update_fail_malformed_htlc)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::UpdateFailMalformedHTLC { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_commitment_signed(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::CommitmentSigned) {
+ fn handle_commitment_signed(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::CommitmentSigned) {
(self.handle_commitment_signed)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::CommitmentSigned { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_revoke_and_ack(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::RevokeAndACK) {
+ fn handle_revoke_and_ack(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::RevokeAndACK) {
(self.handle_revoke_and_ack)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::RevokeAndACK { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_update_fee(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::UpdateFee) {
+ fn handle_update_fee(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::UpdateFee) {
(self.handle_update_fee)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::UpdateFee { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_announcement_signatures(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::AnnouncementSignatures) {
+ fn handle_announcement_signatures(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::AnnouncementSignatures) {
(self.handle_announcement_signatures)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::AnnouncementSignatures { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn peer_disconnected(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, no_connection_possible: bool) {
+ fn peer_disconnected(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut no_connection_possible: bool) {
(self.peer_disconnected)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), no_connection_possible)
}
- fn peer_connected(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::Init) {
+ fn peer_connected(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::Init) {
(self.peer_connected)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::Init { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_channel_reestablish(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ChannelReestablish) {
+ fn handle_channel_reestablish(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::ChannelReestablish) {
(self.handle_channel_reestablish)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::ChannelReestablish { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_channel_update(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ChannelUpdate) {
+ fn handle_channel_update(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::ChannelUpdate) {
(self.handle_channel_update)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::ChannelUpdate { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
- fn handle_error(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ErrorMessage) {
+ fn handle_error(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: &lightning::ln::msgs::ErrorMessage) {
(self.handle_error)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::ErrorMessage { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
}
}
use lightning::ln::msgs::RoutingMessageHandler as rustRoutingMessageHandler;
impl rustRoutingMessageHandler for RoutingMessageHandler {
- fn handle_node_announcement(&self, msg: &lightning::ln::msgs::NodeAnnouncement) -> Result<bool, lightning::ln::msgs::LightningError> {
+ fn handle_node_announcement(&self, mut msg: &lightning::ln::msgs::NodeAnnouncement) -> Result<bool, lightning::ln::msgs::LightningError> {
let mut ret = (self.handle_node_announcement)(self.this_arg, &crate::lightning::ln::msgs::NodeAnnouncement { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false });
let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
local_ret
}
- fn handle_channel_announcement(&self, msg: &lightning::ln::msgs::ChannelAnnouncement) -> Result<bool, lightning::ln::msgs::LightningError> {
+ fn handle_channel_announcement(&self, mut msg: &lightning::ln::msgs::ChannelAnnouncement) -> Result<bool, lightning::ln::msgs::LightningError> {
let mut ret = (self.handle_channel_announcement)(self.this_arg, &crate::lightning::ln::msgs::ChannelAnnouncement { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false });
let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
local_ret
}
- fn handle_channel_update(&self, msg: &lightning::ln::msgs::ChannelUpdate) -> Result<bool, lightning::ln::msgs::LightningError> {
+ fn handle_channel_update(&self, mut msg: &lightning::ln::msgs::ChannelUpdate) -> Result<bool, lightning::ln::msgs::LightningError> {
let mut ret = (self.handle_channel_update)(self.this_arg, &crate::lightning::ln::msgs::ChannelUpdate { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false });
let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
local_ret
}
- fn handle_htlc_fail_channel_update(&self, update: &lightning::ln::msgs::HTLCFailChannelUpdate) {
- (self.handle_htlc_fail_channel_update)(self.this_arg, &crate::lightning::ln::msgs::HTLCFailChannelUpdate::from_native(&update))
+ fn handle_htlc_fail_channel_update(&self, mut update: &lightning::ln::msgs::HTLCFailChannelUpdate) {
+ (self.handle_htlc_fail_channel_update)(self.this_arg, &crate::lightning::ln::msgs::HTLCFailChannelUpdate::from_native(update))
}
- fn get_next_channel_announcements(&self, starting_point: u64, batch_amount: u8) -> Vec<(lightning::ln::msgs::ChannelAnnouncement, Option<lightning::ln::msgs::ChannelUpdate>, Option<lightning::ln::msgs::ChannelUpdate>)> {
+ fn get_next_channel_announcements(&self, mut starting_point: u64, mut batch_amount: u8) -> Vec<(lightning::ln::msgs::ChannelAnnouncement, Option<lightning::ln::msgs::ChannelUpdate>, Option<lightning::ln::msgs::ChannelUpdate>)> {
let mut ret = (self.get_next_channel_announcements)(self.this_arg, starting_point, batch_amount);
let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { let (mut orig_ret_0_0, mut orig_ret_0_1, mut orig_ret_0_2) = item.to_rust(); let mut local_orig_ret_0_1 = if orig_ret_0_1.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(orig_ret_0_1.take_inner()) } }) }; let mut local_orig_ret_0_2 = if orig_ret_0_2.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(orig_ret_0_2.take_inner()) } }) }; let mut local_ret_0 = (*unsafe { Box::from_raw(orig_ret_0_0.take_inner()) }, local_orig_ret_0_1, local_orig_ret_0_2); local_ret_0 }); };
local_ret
}
- fn get_next_node_announcements(&self, starting_point: Option<&bitcoin::secp256k1::key::PublicKey>, batch_amount: u8) -> Vec<lightning::ln::msgs::NodeAnnouncement> {
+ fn get_next_node_announcements(&self, mut starting_point: Option<&bitcoin::secp256k1::key::PublicKey>, mut batch_amount: u8) -> Vec<lightning::ln::msgs::NodeAnnouncement> {
let mut local_starting_point = if starting_point.is_none() { crate::c_types::PublicKey::null() } else { { crate::c_types::PublicKey::from_rust(&(starting_point.unwrap())) } };
let mut ret = (self.get_next_node_announcements)(self.this_arg, local_starting_point, batch_amount);
let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
local_ret
}
- fn sync_routing_table(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, init: &lightning::ln::msgs::Init) {
+ fn sync_routing_table(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut init: &lightning::ln::msgs::Init) {
(self.sync_routing_table)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::lightning::ln::msgs::Init { inner: unsafe { (init as *const _) as *mut _ }, is_owned: false })
}
- fn handle_reply_channel_range(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::ReplyChannelRange) -> Result<(), lightning::ln::msgs::LightningError> {
+ fn handle_reply_channel_range(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: lightning::ln::msgs::ReplyChannelRange) -> Result<(), lightning::ln::msgs::LightningError> {
let mut ret = (self.handle_reply_channel_range)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::lightning::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg)), is_owned: true });
let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
local_ret
}
- fn handle_reply_short_channel_ids_end(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::ReplyShortChannelIdsEnd) -> Result<(), lightning::ln::msgs::LightningError> {
+ fn handle_reply_short_channel_ids_end(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: lightning::ln::msgs::ReplyShortChannelIdsEnd) -> Result<(), lightning::ln::msgs::LightningError> {
let mut ret = (self.handle_reply_short_channel_ids_end)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::lightning::ln::msgs::ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(msg)), is_owned: true });
let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
local_ret
}
- fn handle_query_channel_range(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::QueryChannelRange) -> Result<(), lightning::ln::msgs::LightningError> {
+ fn handle_query_channel_range(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: lightning::ln::msgs::QueryChannelRange) -> Result<(), lightning::ln::msgs::LightningError> {
let mut ret = (self.handle_query_channel_range)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::lightning::ln::msgs::QueryChannelRange { inner: Box::into_raw(Box::new(msg)), is_owned: true });
let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
local_ret
}
- fn handle_query_short_channel_ids(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::QueryShortChannelIds) -> Result<(), lightning::ln::msgs::LightningError> {
+ fn handle_query_short_channel_ids(&self, mut their_node_id: &bitcoin::secp256k1::key::PublicKey, mut msg: lightning::ln::msgs::QueryShortChannelIds) -> Result<(), lightning::ln::msgs::LightningError> {
let mut ret = (self.handle_query_short_channel_ids)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::lightning::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg)), is_owned: true });
let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
local_ret
f(self.this_arg);
}
}
+}
+mod fuzzy_internal_msgs {
+
+use std::str::FromStr;
+use std::ffi::c_void;
+use bitcoin::hashes::Hash;
+use crate::c_types::*;
+
}
#[no_mangle]
/// Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read