C# bindings: all generated types are `internal`, `LiquidWalletKit` 0.8.2 has no usable public API
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 領域
- build-system
調査の方向性
The generated C# types are internal because lwk_bindings/uniffi.toml has no [bindings.csharp] section, so the default access modifier applies. The proposed fix is access_modifier = "public" in that file, and PR #211 already contains it. Done means a separate consumer project can reference the packed package and compile against Network and Mnemonic. Check the open PR before starting, since this work is already under way.
索引モデルが issue の本文から書いたものです。
説明
Summary
The LiquidWalletKit 0.8.2 NuGet package (the one the docs install page tells you to use) can't be consumed: every type in uniffi.lwk (Wollet, Signer, Mnemonic, Network, EsploraClient, TxBuilder, Pset, ... and the I* interfaces) is internal.
Reproduction
Tested with dotnet add package LiquidWalletKit --version 0.8.2 on a new net10.0 class library (.NET SDK 10.0.201, macOS 26.6):
using uniffi.lwk;
var network = Network.Mainnet();
var mnemonic = Mnemonic.FromRandom(12);
error CS0122: 'Network' is inaccessible due to its protection level
error CS0122: 'Mnemonic' is inaccessible due to its protection level
Checking the metadata of LiquidWalletKit.dll confirms it: all 288 TypeDef rows in uniffi.lwk are NotPublic, and I didn't see any InternalsVisibleTo.
Cause
uniffi-bindgen-cs emits internal unless told otherwise (Config::access_modifier() defaults to "internal", documented in its docs/CONFIGURATION.md: "access_modifier - override the default internal access modifier for "exported" uniffi symbols"). lwk_bindings/uniffi.toml has no [bindings.csharp] section, so the published package gets the default.
The C# test (lwk_bindings/tests/bindings/list_transactions.cs) is compiled together with lwk.cs in the same project (justfile, csharp-windows), so it can use internal types and doesn't catch this. build-nuget only runs dotnet build / dotnet pack; nothing consumes the package from outside the assembly.
0.8.2 (2024-11-19) is the only version on NuGet, and master still builds with the same default, so a new release would have the same problem.
Fix
Add this to lwk_bindings/uniffi.toml:
[bindings.csharp]
access_modifier = "public"
I verified it: with the pinned uniffi-bindgen-cs (v0.11.1+v0.31.0), the generated lwk.cs goes from 186 internal declarations to 184 public (the FFI helper types stay internal). A separate consumer project fails with CS0122 before the change and builds and runs after it. Fix: #211
Only a new release will fix the published package, since LiquidWalletKit.csproj and the build-nuget job still hard-code 0.8.2.
A CI step that builds a tiny project against the packed .nupkg would catch this kind of regression, since the current C# test is compiled in the same assembly as lwk.cs. I left it out of the PR; happy to add it if you want it.
- 主要言語
- Rust
- スター
- 114
- フォーク
- 69
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Blockstream/lwk のほかの issue
-
Ignore entry for RUSTSEC-2020-0168 no longer matches anything (`mach` is no longer in `Cargo.lock`)対応中かも @zyl71 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
Blockstream/lwk#213 ·
-
wollet: Waterfalls scan sets `last_unused` to a page-relative index past the first page対応中かも @diorwave が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Blockstream/lwk#209 ·
-
Applying a merged update with a txid in both `txid_height_new` and `txid_height_delete` drops its outputs from `unspent`対応中かも @Jeon1691 が 4 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
Blockstream/lwk#205 ·
-
Cache `unspent` restores an input of a deleted transaction that a known replacement still spendsオープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
Blockstream/lwk#204 ·
-
Cache `unspent` re-adds a spent output when its transaction is deleted and then seen again対応中かも @Jeon1691 が 6 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
Blockstream/lwk#201 ·
Blockstream/lwk の issue をすべて見る
似ている issue
-
Ignore entry for RUSTSEC-2026-0002 no longer matches anything (`lru` is no longer in `Cargo.lock`)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
influxdata/influxdb#27767 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
manuscript-lang/manuscript#6389 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信