Skip to content

chore: testkit API surface refactor + gomobile artefact regen#25

Merged
TaprootFreak merged 2 commits into
developfrom
chore/testkit-cleanups
May 18, 2026
Merged

chore: testkit API surface refactor + gomobile artefact regen#25
TaprootFreak merged 2 commits into
developfrom
chore/testkit-cleanups

Conversation

@TaprootFreak
Copy link
Copy Markdown

Summary

Two deferred follow-ups from the v0.5.0 / Go-module-rename work, both addressing consistency drift inside the testkit + native binding layer. Independent commits, related theme (post-rename housekeeping), bundled to share one CI run.

Commit 1 — refactor(testing): drop redundant SimulatedBitboxPlatform.install() static

The testkit had three places declaring the same ~20-parameter list:
the constructor, a static SimulatedBitboxPlatform.install(), and the top-level installSimulatedBitboxPlatform(). Static and top-level did the same thing (build + assign to BitboxUsbPlatform.instance), so any new parameter had to land in three places.

Removed the static — callers use the top-level function exclusively. The remaining two-way duplication between constructor and top-level wrapper is structural in Dart (no way to forward named args generically without losing IDE parameter hints).

Net: 89 lines deleted, 38 inserted. From 3 maintenance points per parameter down to 2.

Commit 2 — chore(bindings): regenerate gomobile artefacts with DFXswiss module path

After the Go module rename in v0.0.7, the checked-in iOS xcframework and Android api-sources.jar still referenced konstantinullrich/... in their generated header comments. Binary code path was fine (Java package stays api, ObjC class names stay Api*) but the docstrings drifted from the go/go.mod declaration.

Regenerated from go/api/:

  • ios/Api.xcframework via gomobile bind -target=ios,iossimulator
  • android/libs/api.aar + api-sources.jar via gomobile bind -target=android -androidapi 24

All four iOS header files (Api.{h,objc.h} × {arm64, simulator}) and the Android sources JAR now consistently reference github.com/DFXswiss/bitbox_flutter/api. JNI binaries refreshed for the four Android architectures (armeabi-v7a, arm64-v8a, x86, x86_64).

Verified post-regen: grep -rln konstantinullrich . returns nothing.

Local validation

Check Result
dart format --set-exit-if-changed 16 files, 0 changed
flutter analyze --fatal-infos No issues found
flutter test 12/12 pass
go vet ./... + go test -race -timeout 60s ./... pass

Closes deferred follow-ups

…tatic

The testkit had three places declaring the same ~20-parameter list:
the constructor, a static `SimulatedBitboxPlatform.install()`, and the
top-level `installSimulatedBitboxPlatform()`. Static and top-level did
the same thing (build + assign to BitboxUsbPlatform.instance), so any
new parameter had to land in three places.

The static was unused (callers use the top-level function exclusively),
so removed it. The remaining two-way duplication between constructor
and top-level wrapper is structural in Dart — no way to forward named
args generically without losing the IDE parameter hints that make the
wrapper useful in the first place.

Net: 66 lines deleted, one place to maintain per parameter is now two
instead of three.
After the Go module rename to github.com/DFXswiss/bitbox_flutter
(commit e81cf8c, v0.0.7), the checked-in gomobile artefacts still
referenced the old konstantinullrich/... path in their generated
header comments and JAR source files. The native binary code path
itself was fine — Java package stays `api`, ObjC class names stay
`Api*` — but the doc-strings drifted from the Go module statement.

Regenerated both surfaces from go/api/ with the current toolchain:

  ios/Api.xcframework
    gomobile bind -target=ios,iossimulator -o ios/Api.xcframework ./api

  android/libs/api.aar + api-sources.jar
    gomobile bind -target=android -androidapi 24 -o android/libs/api.aar ./api

All four iOS header files (Api.h + Api.objc.h × {arm64, simulator})
and the api-sources.jar now consistently reference
github.com/DFXswiss/bitbox_flutter/api. JNI binaries refreshed for the
same four Android architectures as before (armeabi-v7a, arm64-v8a,
x86, x86_64); minor size delta from newer Go runtime + transitive
dependencies.

Verified post-regen: `grep -rln konstantinullrich .` returns nothing.
Dart format / analyze --fatal-infos / flutter test / go vet + go test
-race all green.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 18, 2026 19:56
@TaprootFreak TaprootFreak merged commit 70fbf49 into develop May 18, 2026
3 checks passed
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