Skip to content

Commit 8705214

Browse files
authored
Merge pull request #688 from tnull/2025-10-add-swift-CI
Add simple workflow to generate Swift bindings in CI
2 parents cf0cb2f + c554a24 commit 8705214

File tree

7 files changed

+47
-10
lines changed

7 files changed

+47
-10
lines changed

.github/workflows/cln-integration.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: CI Checks - CLN Integration Tests
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
59
jobs:
610
check-cln:
711
runs-on: ubuntu-latest

.github/workflows/kotlin.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: CI Checks - Kotlin Tests
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
59
jobs:
610
check-kotlin:
711
runs-on: ubuntu-latest

.github/workflows/lnd-integration.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: CI Checks - LND Integration Tests
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
59
jobs:
610
check-lnd:
711
runs-on: ubuntu-latest
@@ -49,4 +53,4 @@ jobs:
4953
run: LND_CERT_PATH=$LND_DATA_DIR/tls.cert LND_MACAROON_PATH=$LND_DATA_DIR/data/chain/bitcoin/regtest/admin.macaroon
5054
RUSTFLAGS="--cfg lnd_test" cargo test --test integration_tests_lnd -- --exact --show-output
5155
env:
52-
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}
56+
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}

.github/workflows/python.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: CI Checks - Python Tests
22

33
on: [push, pull_request]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
59
jobs:
610
check-python:
711
runs-on: ubuntu-latest

.github/workflows/swift.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI Checks - Swift Tests
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
check-swift:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set default Rust version to stable
18+
run: rustup default stable
19+
20+
- name: Generate Swift bindings
21+
run: ./scripts/uniffi_bindgen_generate_swift.sh

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: 6 additions & 6 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

@@ -1359,7 +1359,7 @@ mod tests {
13591359
#[test]
13601360
fn test_offer() {
13611361
let (ldk_offer, wrapped_offer) = create_test_offer();
1362-
match (ldk_offer.description(), wrapped_offer.description()) {
1362+
match (ldk_offer.description(), wrapped_offer.offer_description()) {
13631363
(Some(ldk_desc), Some(wrapped_desc)) => {
13641364
assert_eq!(ldk_desc.to_string(), wrapped_desc);
13651365
},
@@ -1481,7 +1481,7 @@ mod tests {
14811481
fn test_refund_properties() {
14821482
let (ldk_refund, wrapped_refund) = create_test_refund();
14831483

1484-
assert_eq!(ldk_refund.description().to_string(), wrapped_refund.description());
1484+
assert_eq!(ldk_refund.description().to_string(), wrapped_refund.refund_description());
14851485
assert_eq!(ldk_refund.amount_msats(), wrapped_refund.amount_msats());
14861486
assert_eq!(ldk_refund.is_expired(), wrapped_refund.is_expired());
14871487

@@ -1572,7 +1572,7 @@ mod tests {
15721572

15731573
assert_eq!(ldk_invoice.relative_expiry().as_secs(), wrapped_invoice.relative_expiry());
15741574

1575-
match (ldk_invoice.description(), wrapped_invoice.description()) {
1575+
match (ldk_invoice.description(), wrapped_invoice.invoice_description()) {
15761576
(Some(ldk_desc), Some(wrapped_desc)) => {
15771577
assert_eq!(ldk_desc.to_string(), wrapped_desc);
15781578
},

0 commit comments

Comments
 (0)