Skip to content

Commit

Permalink
Merge pull request #771 from breez/ok300-rustdoc-fixes
Browse files Browse the repository at this point in the history
Fix rustdoc warnings
  • Loading branch information
ok300 authored Feb 3, 2024
2 parents 8427490 + d4c6ad2 commit f9cb6a3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions libs/sdk-core/src/breez_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1131,9 +1131,9 @@ impl BreezServices {
}
}

/// Get the static backup data from the peristent storage.
/// Get the static backup data from the persistent storage.
/// This data enables the user to recover the node in an external core ligntning node.
/// See here for instructions on how to recover using this data: https://docs.corelightning.org/docs/backup-and-recovery#backing-up-using-static-channel-backup
/// See here for instructions on how to recover using this data: <https://docs.corelightning.org/docs/backup-and-recovery#backing-up-using-static-channel-backup>
pub fn static_backup(req: StaticBackupRequest) -> SdkResult<StaticBackupResponse> {
let storage = SqliteStorage::new(req.working_dir);
Ok(StaticBackupResponse {
Expand Down
15 changes: 8 additions & 7 deletions libs/sdk-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{

pub type SdkResult<T, E = SdkError> = Result<T, E>;

/// Error returned by [BreezServices::lnurl_auth]
/// Error returned by [crate::breez_services::BreezServices::lnurl_auth]
#[derive(Debug, Error)]
pub enum LnUrlAuthError {
#[error("Generic: {err}")]
Expand Down Expand Up @@ -50,7 +50,7 @@ impl From<SdkError> for LnUrlAuthError {
}
}

/// Error returned by [BreezServices::lnurl_pay]
/// Error returned by [crate::breez_services::BreezServices::lnurl_pay]
#[derive(Debug, Error)]
pub enum LnUrlPayError {
#[error("Invoice already paid")]
Expand Down Expand Up @@ -175,7 +175,7 @@ impl From<SendPaymentError> for LnUrlPayError {
}
}

/// Error returned by [BreezServices::lnurl_withdraw]
/// Error returned by [crate::breez_services::BreezServices::lnurl_withdraw]
#[derive(Debug, Error)]
pub enum LnUrlWithdrawError {
#[error("Generic: {err}")]
Expand Down Expand Up @@ -245,7 +245,8 @@ impl From<SdkError> for LnUrlWithdrawError {
}
}

/// Error returned by [BreezServices::receive_onchain] and [BreezServices::buy_bitcoin]
/// Error returned by [crate::breez_services::BreezServices::receive_onchain] and
/// [crate::breez_services::BreezServices::buy_bitcoin]
#[derive(Debug, Error)]
pub enum ReceiveOnchainError {
#[error("Generic: {err}")]
Expand Down Expand Up @@ -290,7 +291,7 @@ impl From<SwapError> for ReceiveOnchainError {
}
}

/// Error returned by [BreezServices::receive_payment]
/// Error returned by [crate::breez_services::BreezServices::receive_payment]
#[derive(Debug, Error)]
pub enum ReceivePaymentError {
#[error("Generic: {err}")]
Expand Down Expand Up @@ -492,7 +493,7 @@ impl From<SendPaymentError> for SdkError {
}
}

/// Error returned by [BreezServices::send_onchain]
/// Error returned by [crate::breez_services::BreezServices::send_onchain]
#[derive(Debug, Error)]
pub enum SendOnchainError {
#[error("Generic: {err}")]
Expand Down Expand Up @@ -569,7 +570,7 @@ impl From<ReverseSwapError> for SendOnchainError {
}
}

/// Error returned by [BreezServices::send_payment] and [BreezServices::send_spontaneous_payment]
/// Error returned by [crate::breez_services::BreezServices::send_payment] and [crate::breez_services::BreezServices::send_spontaneous_payment]
#[derive(Clone, Debug, Error)]
pub enum SendPaymentError {
#[error("Invoice already paid")]
Expand Down
8 changes: 4 additions & 4 deletions libs/sdk-core/src/input_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ pub struct LnUrlErrorData {
///
/// It represents the endpoint's parameters for the LNURL workflow.
///
/// See https://github.com/lnurl/luds/blob/luds/06.md
/// See <https://github.com/lnurl/luds/blob/luds/06.md>
#[derive(Clone, Deserialize, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LnUrlPayRequestData {
Expand All @@ -507,7 +507,7 @@ pub struct LnUrlPayRequestData {
pub metadata_str: String,
/// The comment length accepted by this endpoint
///
/// See https://github.com/lnurl/luds/blob/luds/12.md
/// See <https://github.com/lnurl/luds/blob/luds/12.md>
#[serde(default)]
pub comment_allowed: u16,

Expand Down Expand Up @@ -547,7 +547,7 @@ impl LnUrlPayRequestData {
///
/// It represents the endpoint's parameters for the LNURL workflow.
///
/// See https://github.com/lnurl/luds/blob/luds/03.md
/// See <https://github.com/lnurl/luds/blob/luds/03.md>
#[derive(Deserialize, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LnUrlWithdrawRequestData {
Expand Down Expand Up @@ -576,7 +576,7 @@ impl LnUrlWithdrawRequestData {
///
/// It represents the endpoint's parameters for the LNURL workflow.
///
/// See https://github.com/lnurl/luds/blob/luds/04.md
/// See <https://github.com/lnurl/luds/blob/luds/04.md>
#[derive(Deserialize, Debug, Serialize)]
pub struct LnUrlAuthRequestData {
/// Hex encoded 32 bytes of challenge
Expand Down
10 changes: 5 additions & 5 deletions libs/sdk-core/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub trait SwapperAPI: Send + Sync {

/// Details about the BTC/BTC reverse swap pair, at this point in time
///
/// Maps the result of https://docs.boltz.exchange/en/latest/api/#getting-pairs for the BTC/BTC pair
/// Maps the result of <https://docs.boltz.exchange/en/latest/api/#getting-pairs> for the BTC/BTC pair
#[derive(Clone, PartialEq, Debug, Serialize)]
pub struct ReverseSwapPairInfo {
/// Minimum amount of sats a reverse swap is allowed to have on this endpoint
Expand Down Expand Up @@ -626,7 +626,7 @@ pub struct NodeState {
pub inbound_liquidity_msats: u64,
}

/// Internal response to a [NodeAPI::pull_changed] call
/// Internal response to a [crate::node_api::NodeAPI::pull_changed] call
pub struct SyncResponse {
pub node_state: NodeState,
pub payments: Vec<crate::models::Payment>,
Expand Down Expand Up @@ -749,7 +749,7 @@ pub struct LnPaymentDetails {
/// Only set for [PaymentType::Sent] payments that were sent in the context of a reverse swap
pub reverse_swap_info: Option<ReverseSwapInfo>,

/// Only set for [PaymentType::Pending] payments that are inflight.
/// Only set for [PaymentStatus::Pending] payments that are inflight.
pub pending_expiration_block: Option<u32>,
}

Expand Down Expand Up @@ -809,7 +809,7 @@ pub struct ReceivePaymentRequest {
///
/// Breez SDK may have to open a new channel to receive this payment. In that case, the channel will
/// be opened automatically when the invoice is paid, and the fees will be described in the
/// [opening_fee_params] and [opening_fee_msat] fields.
/// `opening_fee_params` and `opening_fee_msat` fields.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ReceivePaymentResponse {
/// The generated invoice, including any necessary routing hints
Expand Down Expand Up @@ -1366,7 +1366,7 @@ pub struct LnUrlWithdrawRequest {
/// Represents a LNURL-pay request.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct LnUrlPayRequest {
/// The [LnUrlPayRequestData] returned by [BreezServices::parse_input]
/// The [LnUrlPayRequestData] returned by [crate::input_parser::parse]
pub data: LnUrlPayRequestData,
/// The amount in millisatoshis for this payment
pub amount_msat: u64,
Expand Down
16 changes: 8 additions & 8 deletions libs/sdk-flutter/lib/bridge_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ class LnPaymentDetails {
/// Only set for [PaymentType::Sent] payments that were sent in the context of a reverse swap
final ReverseSwapInfo? reverseSwapInfo;

/// Only set for [PaymentType::Pending] payments that are inflight.
/// Only set for [PaymentStatus::Pending] payments that are inflight.
final int? pendingExpirationBlock;

const LnPaymentDetails({
Expand All @@ -762,7 +762,7 @@ class LnPaymentDetails {
///
/// It represents the endpoint's parameters for the LNURL workflow.
///
/// See https://github.com/lnurl/luds/blob/luds/04.md
/// See <https://github.com/lnurl/luds/blob/luds/04.md>
class LnUrlAuthRequestData {
/// Hex encoded 32 bytes of challenge
final String k1;
Expand Down Expand Up @@ -818,7 +818,7 @@ class LnUrlPayErrorData {

/// Represents a LNURL-pay request.
class LnUrlPayRequest {
/// The [LnUrlPayRequestData] returned by [BreezServices::parse_input]
/// The [LnUrlPayRequestData] returned by [crate::input_parser::parse]
final LnUrlPayRequestData data;

/// The amount in millisatoshis for this payment
Expand All @@ -838,7 +838,7 @@ class LnUrlPayRequest {
///
/// It represents the endpoint's parameters for the LNURL workflow.
///
/// See https://github.com/lnurl/luds/blob/luds/06.md
/// See <https://github.com/lnurl/luds/blob/luds/06.md>
class LnUrlPayRequestData {
final String callback;

Expand All @@ -854,7 +854,7 @@ class LnUrlPayRequestData {

/// The comment length accepted by this endpoint
///
/// See https://github.com/lnurl/luds/blob/luds/12.md
/// See <https://github.com/lnurl/luds/blob/luds/12.md>
final int commentAllowed;

/// Indicates the domain of the LNURL-pay service, to be shown to the user when asking for
Expand Down Expand Up @@ -925,7 +925,7 @@ class LnUrlWithdrawRequest {
///
/// It represents the endpoint's parameters for the LNURL workflow.
///
/// See https://github.com/lnurl/luds/blob/luds/03.md
/// See <https://github.com/lnurl/luds/blob/luds/03.md>
class LnUrlWithdrawRequestData {
final String callback;
final String k1;
Expand Down Expand Up @@ -1378,7 +1378,7 @@ class ReceivePaymentRequest {
///
/// Breez SDK may have to open a new channel to receive this payment. In that case, the channel will
/// be opened automatically when the invoice is paid, and the fees will be described in the
/// [opening_fee_params] and [opening_fee_msat] fields.
/// `opening_fee_params` and `opening_fee_msat` fields.
class ReceivePaymentResponse {
/// The generated invoice, including any necessary routing hints
final LNInvoice lnInvoice;
Expand Down Expand Up @@ -1504,7 +1504,7 @@ class ReverseSwapInfo {

/// Details about the BTC/BTC reverse swap pair, at this point in time
///
/// Maps the result of https://docs.boltz.exchange/en/latest/api/#getting-pairs for the BTC/BTC pair
/// Maps the result of <https://docs.boltz.exchange/en/latest/api/#getting-pairs> for the BTC/BTC pair
class ReverseSwapPairInfo {
/// Minimum amount of sats a reverse swap is allowed to have on this endpoint
final int min;
Expand Down

0 comments on commit f9cb6a3

Please sign in to comment.