Skip to content

test: cover wallet lifecycle and slatepack FFI - #16

Open
parasew wants to merge 2 commits into
cypherstack:mainfrom
parasew:test/ffi-integration
Open

parasew wants to merge 2 commits into
cypherstack:mainfrom
parasew:test/ffi-integration

Conversation

@parasew

@parasew parasew commented Nov 11, 2026 •

Copy link
Copy Markdown

Summary

Move the useful MWC FFI coverage out of Stack Wallet's integration tests and into the plugin that owns the FFI surface. No production code changes.

This relates to Stack Wallet PR #1482, which removes its copy of the MWC test harness.

What the new tests cover

  • generates a 24-word mnemonic
  • rejects an invalid send address
  • creates a wallet in a temporary directory and opens it
  • round-trips a real compact slate from the MWC integration docs
  • requires wallet context for encrypted slatepacks
  • rejects malformed slatepacks

Fixture fixes

The Stack Wallet copy used a compact slate with no transaction and no participant data, and used "abc" as a slate ID in an encryption test. The Rust library correctly rejected both before the assertions could run. The new tests use the real MWC fixture, a valid UUID, and accept the binary slatepack armor the encoder emits (BEGINSLATE_BIN/ENDSLATE_BIN as well as BEGINSLATEPACK).

The example's manual FFI runner is updated with the same fixture and marker handling.

Verification

flutter test test/ffi_test.dart test/native_assets_test.dart

With the pinned prebuilt native asset: 9 tests passed on macOS arm64 (local) and 9 tests passed on Linux x86_64 (ghcr.io/cypherstack/stackwallet-ci:android).

Port the useful MWC FFI coverage out of Stack Wallet into the plugin:

- create/open a wallet in a temporary directory
- validate an invalid send address
- round-trip a real compact slate from the MWC integration docs
- require wallet context for encrypted slatepacks
- reject malformed slatepacks

Fix the example's fixtures to include transaction/participant data and a valid UUID, and accept the binary slatepack armor the Rust encoder emits.
@parasew

parasew commented Nov 11, 2026

Copy link
Copy Markdown
Author

Local verification on macOS arm64 with the pinned prebuilt native asset:

flutter test test/ffi_test.dart test/native_assets_test.dart
# 9 tests passed

The GitHub checks are showing action_required because this PR comes from a fork; a maintainer needs to approve the workflow runs. No production code is changed — this is test coverage only.

Reference both listener methods through a list so the analyzer no longer reports them as unused locals.
@parasew

parasew commented Nov 12, 2026

Copy link
Copy Markdown
Author

Additional validation: the same suite also passes on Linux x86_64:

ghcr.io/cypherstack/stackwallet-ci:android
flutter test test/ffi_test.dart test/native_assets_test.dart
# 9 tests passed

So macOS arm64 and Linux x86_64 are both verified locally. Upstream CI is still action_required pending maintainer approval for the fork workflow.

@parasew

parasew commented Nov 13, 2026

Copy link
Copy Markdown
Author

Fork-side CI evidence for this head: with Actions enabled on parasew/flutter_libmwc, the Tests workflow ran on 8643154cc (this PR's head, unchanged) and passed on all three platforms — ubuntu-24.04, xcode-27 and windows-latest: https://github.com/parasew/flutter_libmwc/actions/runs/43399598924

The upstream runs triggered by this PR are still waiting in action_required for first-contributor approval.

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