Skip to content

Commit 134b2f7

Browse files
committed
Avoid collision of description on Offer, Refund, Bolt12Invoice
Swift will auto-generate a `description` accessor. We here avoid any conflicting methods in our API.
1 parent 15a1b90 commit 134b2f7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bindings/ldk_node.udl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ interface Offer {
771771
constructor([ByRef] string offer_str);
772772
OfferId id();
773773
boolean is_expired();
774-
string? description();
774+
string? offer_description();
775775
string? issuer();
776776
OfferAmount? amount();
777777
boolean is_valid_quantity(u64 quantity);
@@ -787,7 +787,7 @@ interface Offer {
787787
interface Refund {
788788
[Throws=NodeError, Name=from_str]
789789
constructor([ByRef] string refund_str);
790-
string description();
790+
string refund_description();
791791
u64? absolute_expiry_seconds();
792792
boolean is_expired();
793793
string? issuer();
@@ -810,7 +810,7 @@ interface Bolt12Invoice {
810810
u64? absolute_expiry_seconds();
811811
u64 relative_expiry();
812812
boolean is_expired();
813-
string? description();
813+
string? invoice_description();
814814
string? issuer();
815815
string? payer_note();
816816
sequence<u8>? metadata();

src/ffi/types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Offer {
159159
/// A complete description of the purpose of the payment.
160160
///
161161
/// Intended to be displayed to the user but with the caveat that it has not been verified in any way.
162-
pub fn description(&self) -> Option<String> {
162+
pub fn offer_description(&self) -> Option<String> {
163163
self.inner.description().map(|printable| printable.to_string())
164164
}
165165

@@ -288,7 +288,7 @@ impl Refund {
288288
/// A complete description of the purpose of the refund.
289289
///
290290
/// Intended to be displayed to the user but with the caveat that it has not been verified in any way.
291-
pub fn description(&self) -> String {
291+
pub fn refund_description(&self) -> String {
292292
self.inner.description().to_string()
293293
}
294294

@@ -466,7 +466,7 @@ impl Bolt12Invoice {
466466
///
467467
/// [`Offer::description`]: lightning::offers::offer::Offer::description
468468
/// [`Refund::description`]: lightning::offers::refund::Refund::description
469-
pub fn description(&self) -> Option<String> {
469+
pub fn invoice_description(&self) -> Option<String> {
470470
self.inner.description().map(|printable| printable.to_string())
471471
}
472472

0 commit comments

Comments
 (0)