Skip to content

fix: normalize ChainPosition ffi byte accounting#47

Draft
reez wants to merge 2 commits intobitcoindevkit:mainfrom
reez:issue-46
Draft

fix: normalize ChainPosition ffi byte accounting#47
reez wants to merge 2 commits intobitcoindevkit:mainfrom
reez:issue-46

Conversation

@reez
Copy link
Collaborator

@reez reez commented Feb 12, 2026

re #46 here's some bdk-dart code changes to fix the wallet.transactions() crashing with UniFfi::UnexpectedEnumCase by normalizing ChainPosition FFI read/write byte accounting (relative offsets) and adding regression tests for non-zero buffer offsets.

this would be a stop gap because I believe the root cause is in uniffi-dart, but just wanted to put this code here in the meantime as I worked through the issue

@reez
Copy link
Collaborator Author

reez commented Feb 12, 2026

cc @OpenOne2925

@reez
Copy link
Collaborator Author

reez commented Feb 12, 2026

I’d prefer to fix this upstream in uniffi-dart, but this bdk-dart branch patch is a temporary workaround. Affected users can pin this branch/commit in pubspec.yaml, run flutter pub get, then fully rebuild/restart the app.

@reez
Copy link
Collaborator Author

reez commented Feb 12, 2026

Note: CI failure here is expected

this PR applies a local patch in generated Dart bindings, but CI regenerates bindings in \scripts/generate_bindings.sh, which overwrites the local fix with current upstream uniffi-dart output... the new regression test then fails against the regenerated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant