Skip to content

test(swift-sdk): first swift sdk integration tests with local network#3712

Draft
ZocoLini wants to merge 2 commits into
v3.1-devfrom
feat/swift-sdk-integration-tests
Draft

test(swift-sdk): first swift sdk integration tests with local network#3712
ZocoLini wants to merge 2 commits into
v3.1-devfrom
feat/swift-sdk-integration-tests

Conversation

@ZocoLini
Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a61b6881-709b-40c5-98c3-ffe558007e6e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/swift-sdk-integration-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added this to the v3.1.0 milestone May 20, 2026
@ZocoLini ZocoLini changed the title Feat/swift sdk integration tests test(swift-sdk): first swift sdk integration tests with local network May 20, 2026
@ZocoLini ZocoLini force-pushed the feat/swift-sdk-integration-tests branch 2 times, most recently from 4133325 to 93ee976 Compare May 21, 2026 19:50
…vnet

New `SwiftDashSDKIntegrationTests` target gated by
`RUN_INTEGRATION_TESTS=1` (skips otherwise so `swift test` stays a
no-op for callers that haven't opted in). Mirrors the pattern used by
rust-dashcore/dash-spv: spin up a real node, drive the SDK against
it, assert on observable state.

Framework (Support/):
- `Shell`: subprocess wrapper used by the dashmate driver.
- `CoreRPCClient`: minimal JSON-RPC client for dashd.
- `LocalDevnet`: dashmate lifecycle + port discovery via
  `yarn dashmate config get` (picks up the merged base/local/preset
  chain that `~/.dashmate/config.json` alone would miss).
- `Wait`: async polling helper with timeout + message.
- `IntegrationTestEnv`: suite-shared env (Core RPC client, SDK
  pointed at local DAPI, suite-shared `PlatformWalletManager`, SPV
  start latch, fund / mine / makeTestWallet helpers).
- `IntegrationTestCase`: base XCTestCase with the gate and a
  success-or-failure latch around `IntegrationTestEnv.bootstrap`.
- `TestWallet`: fresh wallet wrapper exposing receive / balance /
  fund / waitForSpendable / send.

Tests (14 total):
- `CoreRPCIntegrationTests` (3): chain tip, mine, fund + confirm
  round-trip via Core RPC.
- `WalletLifecycleIntegrationTests` (3): mnemonic-backed wallet
  creation, zero initial balance, multi-wallet independence.
- `WalletFromSeedIntegrationTests` (1): raw 64-byte seed ctor.
- `AddressDerivationIntegrationTests` (2): BIP-44 receive↔change
  pool distinctness (the two pools go through separate FFI paths).
- `CoreSendIntegrationTests` (4): SPV-funded balance observation,
  full Core→Core round-trip, wallet↔wallet via the shared SPV UTXO
  matcher, insufficient-funds error path.
- `SDKBootstrapIntegrationTests` (1): floor that every
  Platform-side test layers on — `SDK.getStatus()` against local
  DAPI.

Also: `run_integration_tests.sh` builds the macOS xcframework slice
and runs the suite; new test target wired into `Package.swift`;
README documents one-time dashmate setup, env vars, and the surface
`env` exposes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ZocoLini ZocoLini force-pushed the feat/swift-sdk-integration-tests branch from 93ee976 to 7c54dac Compare May 22, 2026 00:06
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