Skip to content

test: add wallet creation SQLite lifecycle coverage#94

Open
j-kon wants to merge 7 commits into
bitcoindevkit:mainfrom
j-kon:codex/wallet-creation-integration
Open

test: add wallet creation SQLite lifecycle coverage#94
j-kon wants to merge 7 commits into
bitcoindevkit:mainfrom
j-kon:codex/wallet-creation-integration

Conversation

@j-kon

@j-kon j-kon commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add deterministic offline SQLite lifecycle/persistence coverage for fresh wallet creation
  • persist external and internal derivation state, dispose the original resources, and reload with a new persister
  • verify network, zero balance, derivation indexes, and address scripts after reopening
  • keep this coverage in the normal offline test suite under test/
  • reuse the repository cleanup retry pattern for cross-platform SQLite file handling

Closes #93

Why

Existing tests cover wallet constructors, loading a prebuilt SQLite fixture, and broad randomized or live-network flows. This adds focused offline coverage for the create-to-persist-to-reload lifecycle against a previously nonexistent SQLite database.

Validation

  • dart format --output=none --set-exit-if-changed lib test example
  • dart analyze --fatal-infos --fatal-warnings lib test example
  • dart test test/wallet_creation_sqlite_lifecycle_test.dart
  • dart test (26 passed, 5 live-network tests skipped by their environment gate)

@reez

reez commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

This seems like a good idea I think.

@Johnosezele

Copy link
Copy Markdown
Collaborator

i'm still looking at this, though upon first glance I don't know if your intention is for this to be an integration test or simple offline persistence test... our test/integration/ suite are env-gated readme, this file lives there and carry the integration tag but isn't. I'd like some clarity on this before proceeding to review.

@j-kon
j-kon force-pushed the codex/wallet-creation-integration branch from 08997e5 to cb61e9e Compare July 13, 2026 17:07
@j-kon j-kon changed the title test: add wallet creation SQLite lifecycle integration coverage test: add wallet creation SQLite lifecycle coverage Jul 13, 2026
@j-kon

j-kon commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Updated this based on the review feedback.

The SQLite wallet creation lifecycle coverage has been moved out of test/integration/ and now lives in the normal offline test suite as test/wallet_creation_sqlite_lifecycle_test.dart.

I also removed the integration tag and updated the PR wording to describe this as offline SQLite lifecycle/persistence coverage rather than live env-gated integration coverage.

Validation run:

  • dart format --output=none --set-exit-if-changed lib test example
  • dart analyze --fatal-infos --fatal-warnings lib test example
  • dart test test/wallet_creation_sqlite_lifecycle_test.dart
  • dart test

@j-kon

j-kon commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Updated the SQLite lifecycle coverage with another cleanup pass.

Changes:

  • removed the unrelated generated lib/bdk.dart whitespace diff
  • tightened native resource cleanup based on the repository’s existing FFI disposal patterns
  • reduced repetitive lifecycle cases so the test remains focused on issue test: add wallet creation SQLite lifecycle integration coverage #93
  • renamed the remaining tests to describe the behavior being verified

The test remains deterministic and offline under the normal test/ suite.

Validation:

  • dart format --output=none --set-exit-if-changed lib test example
  • dart analyze --fatal-infos --fatal-warnings lib test example
  • dart test test/wallet_creation_sqlite_lifecycle_test.dart
  • dart test

@j-kon j-kon closed this Jul 14, 2026
@j-kon
j-kon deleted the codex/wallet-creation-integration branch July 14, 2026 10:37
@j-kon
j-kon restored the codex/wallet-creation-integration branch July 14, 2026 10:40
@j-kon j-kon reopened this Jul 14, 2026
@j-kon j-kon closed this Jul 14, 2026
@j-kon
j-kon deleted the codex/wallet-creation-integration branch July 14, 2026 10:44
@j-kon
j-kon restored the codex/wallet-creation-integration branch July 14, 2026 10:47
@j-kon j-kon reopened this Jul 14, 2026
@j-kon j-kon closed this Jul 14, 2026
@j-kon
j-kon deleted the codex/wallet-creation-integration branch July 14, 2026 10:53
@j-kon
j-kon restored the codex/wallet-creation-integration branch July 14, 2026 10:57
@j-kon j-kon reopened this Jul 14, 2026
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.

test: add wallet creation SQLite lifecycle integration coverage

3 participants