From 4e918a5fe949ca763122455175f47649939d90e5 Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 28 Apr 2026 08:51:08 +0200 Subject: [PATCH 1/5] ci: avoid broken setup-just action --- .github/workflows/cont_integration.yml | 7 ++----- .github/workflows/kotlin.yml | 4 +--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index ecdbd5bc1..ecf554d67 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -43,10 +43,7 @@ jobs: - uses: dtolnay/rust-toolchain@1.85.0 with: targets: x86_64-apple-ios,aarch64-apple-ios,aarch64-apple-ios-sim,aarch64-apple-darwin - - uses: extractions/setup-just@v2 - with: - just-version: 1.5.0 # optional semver specification, otherwise latest - - run: brew install xcodegen + - run: brew install just xcodegen - run: just swift csharp: @@ -55,7 +52,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - uses: extractions/setup-just@v2 + - run: choco install just - run: just csharp-windows - run: ls target/release/csharp - uses: actions/setup-dotnet@v4 diff --git a/.github/workflows/kotlin.yml b/.github/workflows/kotlin.yml index 14f18d9dd..40d1397df 100644 --- a/.github/workflows/kotlin.yml +++ b/.github/workflows/kotlin.yml @@ -30,9 +30,7 @@ jobs: with: targets: x86_64-linux-android, aarch64-linux-android, armv7-linux-androideabi, i686-linux-android, aarch64-apple-ios, aarch64-apple-ios-sim, x86_64-apple-ios - - uses: extractions/setup-just@v2 - with: - just-version: 1.5.0 # optional semver specification, otherwise latest + - run: brew install just - name: "Install NDK" run: | From 6a467cc29db40f5f93d779f8021f200b72eb7832 Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 28 Apr 2026 08:51:38 +0200 Subject: [PATCH 2/5] ci: switch jdk provider --- .github/workflows/kotlin.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/kotlin.yml b/.github/workflows/kotlin.yml index 40d1397df..58245d390 100644 --- a/.github/workflows/kotlin.yml +++ b/.github/workflows/kotlin.yml @@ -22,9 +22,8 @@ jobs: - name: "Set up JDK" uses: actions/setup-java@v5 with: - distribution: jetbrains + distribution: temurin java-version: 21 - token: ${{ secrets.GITHUB_TOKEN }} - uses: dtolnay/rust-toolchain@1.85.0 with: @@ -51,4 +50,3 @@ jobs: name: lwk-artifact path: lwk_bindings/android_bindings retention-days: 1 - From 7db28533371244f6ed307b985a1453ef8ce75fe5 Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 28 Apr 2026 08:52:16 +0200 Subject: [PATCH 3/5] ci: bump csharp version --- .github/workflows/bindings.yml | 2 +- .github/workflows/cont_integration.yml | 3 +-- lwk_bindings/csharp/LiquidWalletKit.csproj | 1 + lwk_bindings/tests/test_data/test-dotnet.csproj | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 947fa3684..777157366 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -164,7 +164,7 @@ jobs: - name: Setup dotnet uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - name: Build the project working-directory: csharp diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index ecf554d67..8578610f3 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -57,10 +57,9 @@ jobs: - run: ls target/release/csharp - uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: '8.0.x' - run: cd target/release/csharp && dotnet run && cd - - uses: actions/upload-artifact@v4 with: name: csharp-windows path: target/release/csharp - diff --git a/lwk_bindings/csharp/LiquidWalletKit.csproj b/lwk_bindings/csharp/LiquidWalletKit.csproj index 2cfc1ba5d..2b87a86f8 100644 --- a/lwk_bindings/csharp/LiquidWalletKit.csproj +++ b/lwk_bindings/csharp/LiquidWalletKit.csproj @@ -5,6 +5,7 @@ Blockstream C# Liquid Wallet Kit net6.0 + 12.0 enable enable true diff --git a/lwk_bindings/tests/test_data/test-dotnet.csproj b/lwk_bindings/tests/test_data/test-dotnet.csproj index 39d5f6941..bf5eaf1a8 100644 --- a/lwk_bindings/tests/test_data/test-dotnet.csproj +++ b/lwk_bindings/tests/test_data/test-dotnet.csproj @@ -3,6 +3,7 @@ Exe net6.0 + 12.0 test_dotnet enable enable From e566d44deca607c90dc5dde29de4d4740cb1349c Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 28 Apr 2026 08:52:41 +0200 Subject: [PATCH 4/5] bindings: fix csharp test --- lwk_bindings/tests/bindings/list_transactions.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lwk_bindings/tests/bindings/list_transactions.cs b/lwk_bindings/tests/bindings/list_transactions.cs index 4d9c65be3..5fbadda11 100644 --- a/lwk_bindings/tests/bindings/list_transactions.cs +++ b/lwk_bindings/tests/bindings/list_transactions.cs @@ -31,13 +31,12 @@ static void Main(string[] args) Update update = client.FullScan(wollet)!; wollet.ApplyUpdate(update); - List txList = wollet.Transactions(); + WalletTx[] txList = wollet.Transactions(); - Console.WriteLine("Transactions {0}:", txList.Count); + Console.WriteLine("Transactions {0}:", txList.Length); foreach (WalletTx tx in txList) { Console.WriteLine(tx.Txid()); } } } - From 1b0807acb70979bb20d2e0de405a319fc9a56186 Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 28 Apr 2026 08:53:05 +0200 Subject: [PATCH 5/5] bindings: patch csharp to avoid finalize keyword --- .github/workflows/bindings.yml | 1 + justfile | 1 + scripts/patch_csharp_finalize.py | 39 ++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 scripts/patch_csharp_finalize.py diff --git a/.github/workflows/bindings.yml b/.github/workflows/bindings.yml index 777157366..67c7b516f 100644 --- a/.github/workflows/bindings.yml +++ b/.github/workflows/bindings.yml @@ -102,6 +102,7 @@ jobs: - run: | cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.10.0+v0.29.4 uniffi-bindgen-cs --library target/liblwk.so --out-dir target + - run: python3 scripts/patch_csharp_finalize.py target/lwk.cs - run: ls -l target - name: Archive csharp language interface uses: actions/upload-artifact@v4 diff --git a/justfile b/justfile index c20e58bb7..2a93b4f97 100644 --- a/justfile +++ b/justfile @@ -134,6 +134,7 @@ swift: ios ios-sim csharp-windows: build-bindings-lib cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.10.0+v0.29.4 uniffi-bindgen-cs --library target/release/lwk.dll --out-dir target/release/csharp + python scripts/patch_csharp_finalize.py target/release/csharp/lwk.cs cp target/release/lwk.dll target/release/csharp cp lwk_bindings/tests/test_data/test-dotnet.csproj target/release/csharp cp lwk_bindings/tests/bindings/list_transactions.cs target/release/csharp diff --git a/scripts/patch_csharp_finalize.py b/scripts/patch_csharp_finalize.py new file mode 100644 index 000000000..878308b62 --- /dev/null +++ b/scripts/patch_csharp_finalize.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 + +"""Patch generated C# bindings to avoid the special `Finalize` member name.""" + +# Use Python instead of `sed` because this patch step runs in both Linux and +# Windows CI, and a small cross-platform script is simpler than maintaining +# shell-specific in-place replacement variants. + +from __future__ import annotations + +import re +import sys +from pathlib import Path + + +PATTERN = re.compile(r"\bFinalize(\s*\()") +REPLACEMENT = r"FinalizeLwk\1" + + +def main() -> int: + if len(sys.argv) != 2: + print("usage: patch_csharp_finalize.py ", file=sys.stderr) + return 1 + + path = Path(sys.argv[1]) + content = path.read_text(encoding="utf-8") + patched, replacements = PATTERN.subn(REPLACEMENT, content) + + if replacements == 0: + print(f"error: no Finalize members found in {path}", file=sys.stderr) + return 1 + + path.write_text(patched, encoding="utf-8") + print(f"patched {replacements} Finalize occurrences in {path}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())