Skip to content

test: add wallet creation SQLite lifecycle integration coverage #93

Description

@j-kon

Summary

Add a deterministic offline integration test covering the complete wallet creation and SQLite persistence lifecycle.

The repository has constructor-focused wallet tests, fixture-based persistence tests, and broad sync canaries. It does not have a focused test that creates a wallet against a fresh SQLite database, persists newly revealed derivation state, fully reopens the wallet, and verifies that state was retained.

Scope

  • Add a focused test under test/integration.
  • Create deterministic receive and change descriptors.
  • Create a wallet using a fresh temporary SQLite database.
  • Reveal external and internal addresses and persist the wallet.
  • Dispose the original wallet and persister before reopening the database.
  • Reload the wallet with a new persister.
  • Verify the network, zero balance, address scripts, and derivation indexes survive the reopen.
  • Clean up temporary SQLite files reliably across supported platforms.
  • Run offline in the normal test suite without environment variables.

Out of scope

  • Electrum or Esplora synchronization.
  • Changes to production wallet APIs.
  • Demo app behavior or UI tests.
  • New test-only dependencies.

Acceptance criteria

  • A wallet is created against a previously nonexistent SQLite path.
  • External and internal derivation state is persisted and restored.
  • The original wallet and persister are disposed before reload.
  • Assertions are deterministic and do not depend on a live network.
  • Temporary resources are cleaned up on macOS, Linux, and Windows.
  • The focused test and the complete Dart test suite pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions