diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7eb4ba41..135a9e7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,11 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Pin syn and quote to meet MSRV + working-directory: lightning-c-bindings + run: | + cargo update -p syn --precise "2.0.106" --verbose + cargo update -p quote --precise "1.0.41" --verbose - name: Sanity test bindings against Cargo.toml RL working-directory: lightning-c-bindings run: | @@ -47,6 +52,8 @@ jobs: git clone https://github.com/rust-bitcoin/rust-lightning cd rust-lightning git checkout 0.1-bindings + cargo update -p syn --precise "2.0.106" --verbose + cargo update -p quote --precise "1.0.41" --verbose - name: Fix Github Actions to not be broken run: git config --global --add safe.directory /__w/ldk-c-bindings/ldk-c-bindings - name: Pin proc-macro and quote to meet MSRV @@ -89,6 +96,11 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Pin syn and quote to meet MSRV + working-directory: lightning-c-bindings + run: | + cargo update -p syn --precise "2.0.106" --verbose + cargo update -p quote --precise "1.0.41" --verbose - name: Sanity test bindings against Cargo.toml RL working-directory: lightning-c-bindings run: | @@ -107,8 +119,15 @@ jobs: git clone https://github.com/rust-bitcoin/rust-lightning cd rust-lightning git checkout 0.1-bindings + cargo update -p syn --precise "2.0.106" --verbose + cargo update -p quote --precise "1.0.41" --verbose - name: Fix Github Actions to not be broken run: git config --global --add safe.directory /__w/ldk-c-bindings/ldk-c-bindings + - name: Pin proc-macro and quote to meet MSRV + run: | + cd c-bindings-gen + cargo update -p quote --precise "1.0.30" --verbose + cargo update -p proc-macro2 --precise "1.0.65" --verbose - name: Fetch MacOS SDK run: | wget https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 17ef4459..6bbe5d69 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -13500,7 +13500,7 @@ typedef struct LDKMessageRouter { * [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future * [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync * [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync - * [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor + * [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor * [`list_channels`]: Self::list_channels * [`list_usable_channels`]: Self::list_usable_channels * [`create_channel`]: Self::create_channel @@ -20711,7 +20711,7 @@ typedef enum LDKEvent_Tag { * To accept the request (and in the case of a dual-funded channel, not contribute funds), * call [`ChannelManager::accept_inbound_channel`]. * To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`]. - * Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected. + * Note that a [`ChannelClosed`] event will _not_ be triggered if the channel is rejected. * * The event is only triggered when a new open channel request is received and the * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. @@ -20721,6 +20721,7 @@ typedef enum LDKEvent_Tag { * returning `Err(ReplayEvent ())`) and won't be persisted across restarts. * * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`ChannelClosed`]: Event::ChannelClosed * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels */ @@ -42796,7 +42797,7 @@ MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const * * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction. * Will fail if a shutdown script has already been set for this channel by - * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must + * [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must * also be compatible with our and the counterparty's features. * * May generate a [`SendShutdown`] message event on success, which should be relayed. @@ -42808,6 +42809,7 @@ MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const * * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee + * [`ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]: crate::util::config::ChannelHandshakeConfig::commit_upfront_shutdown_pubkey * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown * * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None @@ -43604,7 +43606,7 @@ MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_ /** * Pays for an [`Offer`] looked up using [BIP 353] Human Readable Names resolved by the DNS - * resolver(s) at `dns_resolvers` which resolve names according to bLIP 32. + * resolver(s) at `dns_resolvers` which resolve names according to [bLIP 32]. * * If the wallet supports paying on-chain schemes, you should instead use * [`OMNameResolver::resolve_name`] and [`OMNameResolver::handle_dnssec_proof_for_uri`] (by @@ -43622,18 +43624,19 @@ MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_ * * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the - * payment will fail with an [`Event::InvoiceRequestFailed`]. + * payment will fail with an [`PaymentFailureReason::UserAbandoned`] or + * [`PaymentFailureReason::InvoiceRequestExpired`], respectively. * * # Privacy * * For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`] - * to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the + * to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the * docs of the parameterized [`Router`], which implements [`MessageRouter`]. * * # Limitations * * Requires a direct connection to the given [`Destination`] as well as an introduction node in - * [`Offer::paths`] or to [`Offer::signing_pubkey`], if empty. A similar restriction applies to + * [`Offer::paths`] or to [`Offer::issuer_signing_pubkey`], if empty. A similar restriction applies to * the responding [`Bolt12Invoice::payment_paths`]. * * # Errors @@ -43641,8 +43644,13 @@ MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_ * Errors if: * - a duplicate `payment_id` is provided given the caveats in the aforementioned link, * + * [BIP 353]: https://github.com/bitcoin/bips/blob/master/bip-0353.mediawiki + * [bLIP 32]: https://github.com/lightning/blips/blob/master/blip-0032.md * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments + * [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath + * [`PaymentFailureReason::UserAbandoned`]: crate::events::PaymentFailureReason::UserAbandoned + * [`PaymentFailureReason::InvoiceRequestRejected`]: crate::events::PaymentFailureReason::InvoiceRequestRejected */ MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelManager_pay_for_offer_from_human_readable_name(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKHumanReadableName name, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat, struct LDKCVec_DestinationZ dns_resolvers); @@ -50845,6 +50853,8 @@ MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards * [`send_data`]: SocketDescriptor::send_data + * [`lightning-net-tokio`]: https://docs.rs/lightning-net-tokio/latest/lightning_net_tokio + * [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor */ void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg); diff --git a/lightning-c-bindings/src/lightning/events/mod.rs b/lightning-c-bindings/src/lightning/events/mod.rs index ff28906c..f1435b68 100644 --- a/lightning-c-bindings/src/lightning/events/mod.rs +++ b/lightning-c-bindings/src/lightning/events/mod.rs @@ -2566,7 +2566,7 @@ pub enum Event { /// To accept the request (and in the case of a dual-funded channel, not contribute funds), /// call [`ChannelManager::accept_inbound_channel`]. /// To reject the request, call [`ChannelManager::force_close_without_broadcasting_txn`]. - /// Note that a ['ChannelClosed`] event will _not_ be triggered if the channel is rejected. + /// Note that a [`ChannelClosed`] event will _not_ be triggered if the channel is rejected. /// /// The event is only triggered when a new open channel request is received and the /// [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. @@ -2576,6 +2576,7 @@ pub enum Event { /// returning `Err(ReplayEvent ())`) and won't be persisted across restarts. /// /// [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + /// [`ChannelClosed`]: Event::ChannelClosed /// [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn /// [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels OpenChannelRequest { diff --git a/lightning-c-bindings/src/lightning/ln/channelmanager.rs b/lightning-c-bindings/src/lightning/ln/channelmanager.rs index 7f7c8f25..319ba853 100644 --- a/lightning-c-bindings/src/lightning/ln/channelmanager.rs +++ b/lightning-c-bindings/src/lightning/ln/channelmanager.rs @@ -1828,7 +1828,7 @@ pub(crate) type nativeChannelManager = nativeChannelManagerImport crate::c_types::derived::CResult_NoneNoneZ { diff --git a/lightning-c-bindings/src/lightning/ln/peer_handler.rs b/lightning-c-bindings/src/lightning/ln/peer_handler.rs index 4f512759..209e2054 100644 --- a/lightning-c-bindings/src/lightning/ln/peer_handler.rs +++ b/lightning-c-bindings/src/lightning/ln/peer_handler.rs @@ -1743,6 +1743,8 @@ pub extern "C" fn PeerManager_read_event(this_arg: &crate::lightning::ln::peer_h /// [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment /// [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards /// [`send_data`]: SocketDescriptor::send_data +/// [`lightning-net-tokio`]: https://docs.rs/lightning-net-tokio/latest/lightning_net_tokio +/// [`lightning-background-processor`]: https://docs.rs/lightning-background-processor/latest/lightning_background_processor #[no_mangle] pub extern "C" fn PeerManager_process_events(this_arg: &crate::lightning::ln::peer_handler::PeerManager) { unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.process_events()