X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Fchain%2Fchannelmonitor.rs;fp=lightning-c-bindings%2Fsrc%2Flightning%2Fchain%2Fchannelmonitor.rs;h=df25ef63585ca540c26111113488ee8a90d69d92;hp=0fa366b7aa2c0cc620b8a33bf6be9ac0fbcd7b9f;hb=45ad3320df3768514d968c70fc4b6a9d50028050;hpb=c014ce6a2df808ffec747f9a327c7f97bb1e3d08 diff --git a/lightning-c-bindings/src/lightning/chain/channelmonitor.rs b/lightning-c-bindings/src/lightning/chain/channelmonitor.rs index 0fa366b..df25ef6 100644 --- a/lightning-c-bindings/src/lightning/chain/channelmonitor.rs +++ b/lightning-c-bindings/src/lightning/chain/channelmonitor.rs @@ -156,14 +156,16 @@ pub extern "C" fn ChannelMonitorUpdate_read(ser: crate::c_types::u8slice) -> cra local_res } /// An event to be processed by the ChannelManager. -#[must_use] #[derive(Clone)] +#[must_use] #[repr(C)] pub enum MonitorEvent { /// A monitor event containing an HTLCUpdate. - HTLCEvent(crate::lightning::chain::channelmonitor::HTLCUpdate), + HTLCEvent( + crate::lightning::chain::channelmonitor::HTLCUpdate), /// A monitor event that the Channel's commitment transaction was confirmed. - CommitmentTxConfirmed(crate::lightning::chain::transaction::OutPoint), + CommitmentTxConfirmed( + crate::lightning::chain::transaction::OutPoint), /// Indicates a [`ChannelMonitor`] update has completed. See /// [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used. /// @@ -182,9 +184,12 @@ pub enum MonitorEvent { /// [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used. /// /// [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure - UpdateFailed(crate::lightning::chain::transaction::OutPoint), + UpdateFailed( + crate::lightning::chain::transaction::OutPoint), } -use lightning::chain::channelmonitor::MonitorEvent as nativeMonitorEvent; +use lightning::chain::channelmonitor::MonitorEvent as MonitorEventImport; +pub(crate) type nativeMonitorEvent = MonitorEventImport; + impl MonitorEvent { #[allow(unused)] pub(crate) fn to_native(&self) -> nativeMonitorEvent { @@ -446,8 +451,8 @@ pub static ANTI_REORG_DELAY: u32 = lightning::chain::channelmonitor::ANTI_REORG_ /// /// See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not /// be provided. -#[must_use] #[derive(Clone)] +#[must_use] #[repr(C)] pub enum Balance { /// The channel is not yet closed (or the commitment or closing transaction has not yet @@ -495,7 +500,9 @@ pub enum Balance { claimable_height: u32, }, } -use lightning::chain::channelmonitor::Balance as nativeBalance; +use lightning::chain::channelmonitor::Balance as BalanceImport; +pub(crate) type nativeBalance = BalanceImport; + impl Balance { #[allow(unused)] pub(crate) fn to_native(&self) -> nativeBalance {