From aa3258e748074ed26b21648ac87533a11e232a4b Mon Sep 17 00:00:00 2001 From: pasta Date: Mon, 12 Oct 2026 16:30:31 -0500 Subject: [PATCH 1/3] test(platform-wallet-storage): build the integration tests as one binary Cargo builds every top-level file in tests/ as its own test binary, and each one statically links the crate's whole dependency graph (dpp, drive, grovedb, RocksDB, SQLite). With 75 such files, the 77 storage test binaries were about half of the Rust workspace job's test build. On a Linux runner with GNU ld, linking them eight at a time took about 3 GB of memory per link and pushed a 24 GiB machine into swap. The files move to tests/integration/ as modules of one test crate, with the shared helpers as its `common` module. Test bodies are unchanged; test names gain the file's name as a module prefix. The include_str! paths into src/ and the docs and comments that name the files follow the move. Co-Authored-By: Claude Opus 5.5 --- .../rs-platform-wallet-storage/SECRETS.md | 12 +-- .../src/secrets/mod.rs | 4 +- .../src/secrets/secret.rs | 6 +- .../src/sqlite/schema/dashpay.rs | 2 +- .../tests/{ => integration}/common/mod.rs | 0 .../tests/{ => integration}/fixture_gen.rs | 2 +- .../tests/integration/main.rs | 85 +++++++++++++++++++ .../persistence_error_kind_mapping.rs | 4 +- .../review_4651_concurrent_payment.rs | 2 +- .../tests/{ => integration}/secrets_api.rs | 0 .../secrets_default_on_compiles.rs | 0 .../tests/{ => integration}/secrets_guard.rs | 2 +- .../secrets_mock_store_test_util.rs | 0 .../tests/{ => integration}/secrets_scan.rs | 2 +- .../sqlite_account_zero_attribution.rs | 2 +- .../sqlite_accounts_reader.rs | 2 +- .../sqlite_asset_locks_filter.rs | 2 +- .../{ => integration}/sqlite_auto_backup.rs | 2 +- .../sqlite_backup_restore.rs | 6 +- .../sqlite_blob_roundtrip_coverage.rs | 2 +- .../sqlite_blob_size_gate_on_load.rs | 2 +- .../sqlite_buffer_semantics.rs | 2 +- .../sqlite_check_constraints.rs | 2 +- .../{ => integration}/sqlite_cli_smoke.rs | 2 +- ..._commit_writes_lock_poison_shortcircuit.rs | 2 +- .../{ => integration}/sqlite_compile_time.rs | 2 +- .../sqlite_contacts_keys_rehydration.rs | 2 +- .../sqlite_core_pool_writer.rs | 2 +- .../sqlite_core_state_reader.rs | 2 +- .../sqlite_dashpay_overlay_contract.rs | 2 +- .../sqlite_delete_buffer_reconcile.rs | 2 +- .../sqlite_delete_cross_process_exclusion.rs | 2 +- .../sqlite_delete_partial_commit_window.rs | 2 +- .../sqlite_delete_real_apply_failure.rs | 2 +- .../{ => integration}/sqlite_delete_wallet.rs | 2 +- ...qlite_delete_wallet_constraint_carveout.rs | 2 +- .../sqlite_deleted_wallet_residue.rs | 2 +- .../sqlite_error_classification.rs | 0 .../sqlite_fk_changeset_ordering.rs | 2 +- .../sqlite_foreign_db_rejection.rs | 2 +- .../{ => integration}/sqlite_foreign_keys.rs | 2 +- .../sqlite_identity_hard_delete.rs | 2 +- .../sqlite_identity_index_concurrency.rs | 2 +- .../sqlite_identity_index_uniqueness.rs | 2 +- .../sqlite_identity_keys_reader.rs | 2 +- .../sqlite_identity_scan_state.rs | 2 +- .../sqlite_legacy_state_migration.rs | 2 +- .../sqlite_load_reconstruction.rs | 2 +- .../{ => integration}/sqlite_load_wiring.rs | 2 +- .../sqlite_migration_execution.rs | 2 +- .../{ => integration}/sqlite_migrations.rs | 2 +- .../sqlite_money_column_overflow_on_read.rs | 2 +- .../sqlite_object_metadata.rs | 2 +- .../sqlite_open_integrity_check.rs | 4 +- .../sqlite_open_version_gate.rs | 2 +- .../{ => integration}/sqlite_permissions.rs | 6 +- .../sqlite_persist_roundtrip.rs | 4 +- .../{ => integration}/sqlite_pool_reader.rs | 2 +- .../sqlite_provider_key_accounts.rs | 2 +- .../sqlite_qa_identity_removal.rs | 2 +- .../{ => integration}/sqlite_recovery_mode.rs | 2 +- .../sqlite_recovery_mode_write_block.rs | 2 +- .../sqlite_restore_cross_process_exclusion.rs | 2 +- .../sqlite_restore_open_path_guard.rs | 2 +- .../sqlite_restore_staged_validation.rs | 2 +- .../sqlite_schema_pinning.rs | 0 .../sqlite_second_open_guard.rs | 2 +- .../sqlite_sent_payment_verdict_durability.rs | 2 +- .../sqlite_shielded_viewing_keys.rs | 2 +- .../sqlite_store_flush_seam.rs | 2 +- .../sqlite_store_generation.rs | 2 +- .../sqlite_structural_hardening.rs | 2 +- .../sqlite_trait_dispatch.rs | 2 +- .../sqlite_transaction_sweeps.rs | 2 +- .../sqlite_unowned_identities.rs | 2 +- .../sqlite_used_core_addresses.rs | 2 +- .../sqlite_v008_isolation.rs | 2 +- .../sqlite_v008_migration.rs | 2 +- .../{ => integration}/sqlite_version_bump.rs | 2 +- .../sqlite_wallet_db_identity.rs | 2 +- .../tracked_masternodes_roundtrip.rs | 2 +- 81 files changed, 174 insertions(+), 89 deletions(-) rename packages/rs-platform-wallet-storage/tests/{ => integration}/common/mod.rs (100%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/fixture_gen.rs (99%) create mode 100644 packages/rs-platform-wallet-storage/tests/integration/main.rs rename packages/rs-platform-wallet-storage/tests/{ => integration}/persistence_error_kind_mapping.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/review_4651_concurrent_payment.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/secrets_api.rs (100%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/secrets_default_on_compiles.rs (100%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/secrets_guard.rs (98%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/secrets_mock_store_test_util.rs (100%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/secrets_scan.rs (98%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_account_zero_attribution.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_accounts_reader.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_asset_locks_filter.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_auto_backup.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_backup_restore.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_blob_roundtrip_coverage.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_blob_size_gate_on_load.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_buffer_semantics.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_check_constraints.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_cli_smoke.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_commit_writes_lock_poison_shortcircuit.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_compile_time.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_contacts_keys_rehydration.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_core_pool_writer.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_core_state_reader.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_dashpay_overlay_contract.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_delete_buffer_reconcile.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_delete_cross_process_exclusion.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_delete_partial_commit_window.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_delete_real_apply_failure.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_delete_wallet.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_delete_wallet_constraint_carveout.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_deleted_wallet_residue.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_error_classification.rs (100%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_fk_changeset_ordering.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_foreign_db_rejection.rs (98%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_foreign_keys.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_identity_hard_delete.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_identity_index_concurrency.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_identity_index_uniqueness.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_identity_keys_reader.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_identity_scan_state.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_legacy_state_migration.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_load_reconstruction.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_load_wiring.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_migration_execution.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_migrations.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_money_column_overflow_on_read.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_object_metadata.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_open_integrity_check.rs (98%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_open_version_gate.rs (98%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_permissions.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_persist_roundtrip.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_pool_reader.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_provider_key_accounts.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_qa_identity_removal.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_recovery_mode.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_recovery_mode_write_block.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_restore_cross_process_exclusion.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_restore_open_path_guard.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_restore_staged_validation.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_schema_pinning.rs (100%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_second_open_guard.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_sent_payment_verdict_durability.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_shielded_viewing_keys.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_store_flush_seam.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_store_generation.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_structural_hardening.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_trait_dispatch.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_transaction_sweeps.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_unowned_identities.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_used_core_addresses.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_v008_isolation.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_v008_migration.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_version_bump.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/sqlite_wallet_db_identity.rs (99%) rename packages/rs-platform-wallet-storage/tests/{ => integration}/tracked_masternodes_roundtrip.rs (99%) diff --git a/packages/rs-platform-wallet-storage/SECRETS.md b/packages/rs-platform-wallet-storage/SECRETS.md index 3f5c23c5cc1..46f0806f536 100644 --- a/packages/rs-platform-wallet-storage/SECRETS.md +++ b/packages/rs-platform-wallet-storage/SECRETS.md @@ -536,7 +536,7 @@ respectively (`Io`'s inner OS error boxed as the source). `keyring_core::Error` is safe to `Display` (`{ }`-format), but `{:?}`-format embeds `BadEncoding(Vec)` / `BadDataFormat(Vec, _)` payloads — those variants are NEVER constructed by our backends with -secret bytes, and `tests/secrets_guard.rs` enforces that no debug-format +secret bytes, and `tests/integration/secrets_guard.rs` enforces that no debug-format pairs with `keyring_core::Error` inside `src/secrets/`. ## What the SQLite backend WILL refuse to store @@ -549,21 +549,21 @@ secret-free. ## Audit hooks -- **`tests/secrets_scan.rs`**: greps every file under +- **`tests/integration/secrets_scan.rs`**: greps every file under `src/sqlite/schema/` and `migrations/` for the substrings `private`, `mnemonic`, `seed`, `xpriv`, `secret`. A new column, blob field, or comment that uses any of those words breaks the test — forcing the author to either rename, or add their phrase to the file's allow-list with a rationale. The `src/secrets/` directory is exempt by design (its own positive guard below covers it). -- **`tests/secrets_guard.rs`**: positive secret-leak guard for +- **`tests/integration/secrets_guard.rs`**: positive secret-leak guard for `src/secrets/`. Forbids logging/formatting sinks that pair with `expose_secret(...)` on the same logical statement, AND forbids `{:?}`-debug-format paired with `keyring_core::Error`. -- **`tests/secrets_api.rs`**: shape guards — `CredentialApi::get_secret` +- **`tests/integration/secrets_api.rs`**: shape guards — `CredentialApi::get_secret` re-wraps through `SecretBytes::new`, redacting `Debug` on `SecretBytes`/`SecretString`, no `Box` in `src/secrets/`. -- **`tests/secrets_default_on_compiles.rs`**: build-time guard +- **`tests/integration/secrets_default_on_compiles.rs`**: build-time guard (gated `#![cfg(feature = "secrets")]`) that the default feature set exposes the secrets surface as public re-exports. It names `EncryptedFileStore`, `SecretBytes`, `SecretString`, @@ -575,7 +575,7 @@ secret-free. alone. No test file and **no CI job** cover it: that invocation is a local/manual check, so a regression in the off-state build reaches `main` unnoticed. -- **`tests/sqlite_persist_roundtrip.rs::tc082_no_box_dyn_error_in_src`**: +- **`tests/integration/sqlite_persist_roundtrip.rs::tc082_no_box_dyn_error_in_src`**: all public method signatures use concrete error types (`WalletStorageError`, `PersistenceError`) — never `Box` — so a future leak is caught by `grep`. diff --git a/packages/rs-platform-wallet-storage/src/secrets/mod.rs b/packages/rs-platform-wallet-storage/src/secrets/mod.rs index 217a7ff54e3..1c1add45dd9 100644 --- a/packages/rs-platform-wallet-storage/src/secrets/mod.rs +++ b/packages/rs-platform-wallet-storage/src/secrets/mod.rs @@ -19,8 +19,8 @@ //! [`CredentialStoreApi`]: keyring_core::api::CredentialStoreApi //! //! This `src/secrets/` tree is the sole secret-bearing module: -//! `tests/secrets_scan.rs` exempts it, so it owns its own review -//! discipline via `tests/secrets_guard.rs`. +//! `tests/integration/secrets_scan.rs` exempts it, so it owns its own review +//! discipline via `tests/integration/secrets_guard.rs`. //! //! Cryptographic wire format lives in [`mod@wire`]: the Tier-2 //! envelope (`wire::envelope`) and the three AAD constructions diff --git a/packages/rs-platform-wallet-storage/src/secrets/secret.rs b/packages/rs-platform-wallet-storage/src/secrets/secret.rs index ef34ef8eac0..26a56580bda 100644 --- a/packages/rs-platform-wallet-storage/src/secrets/secret.rs +++ b/packages/rs-platform-wallet-storage/src/secrets/secret.rs @@ -305,7 +305,7 @@ impl SecretString { /// be a vulnerability rather than a simplification. /// /// Takes the text rather than a `SecretString` so it never calls -/// `expose_secret` itself, keeping `tests/secrets_guard.rs`'s +/// `expose_secret` itself, keeping `tests/integration/secrets_guard.rs`'s /// sink-near-plaintext scan honest instead of merely quiet. fn check_edit_range(text: &str, start: usize, end: usize) { assert!( @@ -1096,7 +1096,7 @@ mod tests { let long = "x".repeat(DEFAULT_CAPACITY + 500); let mut one_shot = SecretString::new("seed:"); one_shot.replace_range(5.., &long); - // Built in its own statement: `tests/secrets_guard.rs` rejects a + // Built in its own statement: `tests/integration/secrets_guard.rs` rejects a // formatting sink sharing a statement with `expose_secret`. let expected = format!("seed:{long}"); assert_eq!(one_shot.expose_secret(), expected); @@ -1186,7 +1186,7 @@ mod tests { fn replace_range_panic_message_carries_no_plaintext() { // Bound as a literal, never read back out of the secret: pairing // `expose_secret` with an assertion here would trip - // `tests/secrets_guard.rs`. + // `tests/integration/secrets_guard.rs`. let plaintext = "correct-horse-battery-staple"; let mut s = SecretString::new(plaintext); diff --git a/packages/rs-platform-wallet-storage/src/sqlite/schema/dashpay.rs b/packages/rs-platform-wallet-storage/src/sqlite/schema/dashpay.rs index 0ec8c2bfe10..dad012fd907 100644 --- a/packages/rs-platform-wallet-storage/src/sqlite/schema/dashpay.rs +++ b/packages/rs-platform-wallet-storage/src/sqlite/schema/dashpay.rs @@ -6,7 +6,7 @@ //! DashPay state is rehydrated from the identities `entry_blob`, which is the //! authoritative load source. They exist for future per-profile/per-payment //! indexed queries. Round-trip pinned by -//! `tests/sqlite_dashpay_overlay_contract.rs`. +//! `tests/integration/sqlite_dashpay_overlay_contract.rs`. //! //! # …which is why the payment overlay is also PATCHED into `entry_blob` //! diff --git a/packages/rs-platform-wallet-storage/tests/common/mod.rs b/packages/rs-platform-wallet-storage/tests/integration/common/mod.rs similarity index 100% rename from packages/rs-platform-wallet-storage/tests/common/mod.rs rename to packages/rs-platform-wallet-storage/tests/integration/common/mod.rs diff --git a/packages/rs-platform-wallet-storage/tests/fixture_gen.rs b/packages/rs-platform-wallet-storage/tests/integration/fixture_gen.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/fixture_gen.rs rename to packages/rs-platform-wallet-storage/tests/integration/fixture_gen.rs index 4884b364c0d..da3d8825f58 100644 --- a/packages/rs-platform-wallet-storage/tests/fixture_gen.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/fixture_gen.rs @@ -21,7 +21,7 @@ //! The parent directory chain of `/v42.db` must not be group- or //! world-writable, or the persister refuses it as an insecure parent. -mod common; +use crate::common; use std::path::{Path, PathBuf}; diff --git a/packages/rs-platform-wallet-storage/tests/integration/main.rs b/packages/rs-platform-wallet-storage/tests/integration/main.rs new file mode 100644 index 00000000000..ec0587bd006 --- /dev/null +++ b/packages/rs-platform-wallet-storage/tests/integration/main.rs @@ -0,0 +1,85 @@ +//! The crate's integration tests, built as one test binary. +//! +//! Each file in this directory is a module of a single test crate rather than +//! a test crate of its own. Every separate integration-test binary links the +//! crate's whole dependency graph, and with one binary per file the links +//! dominated CI build time. A new test file must be declared here, or it is +//! not compiled. + +mod common; + +mod fixture_gen; +mod persistence_error_kind_mapping; +mod review_4651_concurrent_payment; +mod secrets_api; +mod secrets_default_on_compiles; +mod secrets_guard; +mod secrets_mock_store_test_util; +mod secrets_scan; +mod sqlite_account_zero_attribution; +mod sqlite_accounts_reader; +mod sqlite_asset_locks_filter; +mod sqlite_auto_backup; +mod sqlite_backup_restore; +mod sqlite_blob_roundtrip_coverage; +mod sqlite_blob_size_gate_on_load; +mod sqlite_buffer_semantics; +mod sqlite_check_constraints; +mod sqlite_cli_smoke; +mod sqlite_commit_writes_lock_poison_shortcircuit; +mod sqlite_compile_time; +mod sqlite_contacts_keys_rehydration; +mod sqlite_core_pool_writer; +mod sqlite_core_state_reader; +mod sqlite_dashpay_overlay_contract; +mod sqlite_delete_buffer_reconcile; +mod sqlite_delete_cross_process_exclusion; +mod sqlite_delete_partial_commit_window; +mod sqlite_delete_real_apply_failure; +mod sqlite_delete_wallet; +mod sqlite_delete_wallet_constraint_carveout; +mod sqlite_deleted_wallet_residue; +mod sqlite_error_classification; +mod sqlite_fk_changeset_ordering; +mod sqlite_foreign_db_rejection; +mod sqlite_foreign_keys; +mod sqlite_identity_hard_delete; +mod sqlite_identity_index_concurrency; +mod sqlite_identity_index_uniqueness; +mod sqlite_identity_keys_reader; +mod sqlite_identity_scan_state; +mod sqlite_legacy_state_migration; +mod sqlite_load_reconstruction; +mod sqlite_load_wiring; +mod sqlite_migration_execution; +mod sqlite_migrations; +mod sqlite_money_column_overflow_on_read; +mod sqlite_object_metadata; +mod sqlite_open_integrity_check; +mod sqlite_open_version_gate; +mod sqlite_permissions; +mod sqlite_persist_roundtrip; +mod sqlite_pool_reader; +mod sqlite_provider_key_accounts; +mod sqlite_qa_identity_removal; +mod sqlite_recovery_mode; +mod sqlite_recovery_mode_write_block; +mod sqlite_restore_cross_process_exclusion; +mod sqlite_restore_open_path_guard; +mod sqlite_restore_staged_validation; +mod sqlite_schema_pinning; +mod sqlite_second_open_guard; +mod sqlite_sent_payment_verdict_durability; +mod sqlite_shielded_viewing_keys; +mod sqlite_store_flush_seam; +mod sqlite_store_generation; +mod sqlite_structural_hardening; +mod sqlite_trait_dispatch; +mod sqlite_transaction_sweeps; +mod sqlite_unowned_identities; +mod sqlite_used_core_addresses; +mod sqlite_v008_isolation; +mod sqlite_v008_migration; +mod sqlite_version_bump; +mod sqlite_wallet_db_identity; +mod tracked_masternodes_roundtrip; diff --git a/packages/rs-platform-wallet-storage/tests/persistence_error_kind_mapping.rs b/packages/rs-platform-wallet-storage/tests/integration/persistence_error_kind_mapping.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/persistence_error_kind_mapping.rs rename to packages/rs-platform-wallet-storage/tests/integration/persistence_error_kind_mapping.rs index 79e7ea60238..98cfc8d0561 100644 --- a/packages/rs-platform-wallet-storage/tests/persistence_error_kind_mapping.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/persistence_error_kind_mapping.rs @@ -374,7 +374,7 @@ fn tc_code_004_b_source_preserves_inner_display_chain() { /// outer `WalletStorageError` match. #[test] fn tc_code_004_e_is_transient_outer_match_is_wildcard_free() { - let src = include_str!("../src/sqlite/error.rs"); + let src = include_str!("../../src/sqlite/error.rs"); let outer = extract_outer_match_self_body(src, "pub fn is_transient(&self) -> bool") .expect("is_transient outer match body must be present"); assert_no_wildcard(&outer, "is_transient"); @@ -385,7 +385,7 @@ fn tc_code_004_e_is_transient_outer_match_is_wildcard_free() { /// match over `ErrorCode` may have its own wildcard. #[test] fn tc_code_004_e_error_kind_str_is_wildcard_free() { - let src = include_str!("../src/sqlite/error.rs"); + let src = include_str!("../../src/sqlite/error.rs"); let outer = extract_outer_match_self_body(src, "pub fn error_kind_str(&self) -> &'static str") .expect("error_kind_str outer match body must be present"); assert_no_wildcard(&outer, "error_kind_str"); diff --git a/packages/rs-platform-wallet-storage/tests/review_4651_concurrent_payment.rs b/packages/rs-platform-wallet-storage/tests/integration/review_4651_concurrent_payment.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/review_4651_concurrent_payment.rs rename to packages/rs-platform-wallet-storage/tests/integration/review_4651_concurrent_payment.rs index 90e24ea2a15..60e2cbb3261 100644 --- a/packages/rs-platform-wallet-storage/tests/review_4651_concurrent_payment.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/review_4651_concurrent_payment.rs @@ -1,5 +1,5 @@ //! Review regression: a concurrent payment must survive an adapter snapshot. -mod common; +use crate::common; use std::collections::BTreeMap; use std::sync::atomic::AtomicBool; diff --git a/packages/rs-platform-wallet-storage/tests/secrets_api.rs b/packages/rs-platform-wallet-storage/tests/integration/secrets_api.rs similarity index 100% rename from packages/rs-platform-wallet-storage/tests/secrets_api.rs rename to packages/rs-platform-wallet-storage/tests/integration/secrets_api.rs diff --git a/packages/rs-platform-wallet-storage/tests/secrets_default_on_compiles.rs b/packages/rs-platform-wallet-storage/tests/integration/secrets_default_on_compiles.rs similarity index 100% rename from packages/rs-platform-wallet-storage/tests/secrets_default_on_compiles.rs rename to packages/rs-platform-wallet-storage/tests/integration/secrets_default_on_compiles.rs diff --git a/packages/rs-platform-wallet-storage/tests/secrets_guard.rs b/packages/rs-platform-wallet-storage/tests/integration/secrets_guard.rs similarity index 98% rename from packages/rs-platform-wallet-storage/tests/secrets_guard.rs rename to packages/rs-platform-wallet-storage/tests/integration/secrets_guard.rs index 2c049a15512..9fa4c979d22 100644 --- a/packages/rs-platform-wallet-storage/tests/secrets_guard.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/secrets_guard.rs @@ -1,6 +1,6 @@ //! Positive secret-leak guard for `src/secrets/` (SEC-REQ-4.5.1). //! -//! `tests/secrets_scan.rs` deliberately exempts `src/secrets/`, so this +//! `tests/integration/secrets_scan.rs` deliberately exempts `src/secrets/`, so this //! module needs its own string-level guard: no `tracing::*` / //! `println!` / `eprintln!` / `format!`-family call may take an //! `expose_secret()` result as an argument. Same spirit as diff --git a/packages/rs-platform-wallet-storage/tests/secrets_mock_store_test_util.rs b/packages/rs-platform-wallet-storage/tests/integration/secrets_mock_store_test_util.rs similarity index 100% rename from packages/rs-platform-wallet-storage/tests/secrets_mock_store_test_util.rs rename to packages/rs-platform-wallet-storage/tests/integration/secrets_mock_store_test_util.rs diff --git a/packages/rs-platform-wallet-storage/tests/secrets_scan.rs b/packages/rs-platform-wallet-storage/tests/integration/secrets_scan.rs similarity index 98% rename from packages/rs-platform-wallet-storage/tests/secrets_scan.rs rename to packages/rs-platform-wallet-storage/tests/integration/secrets_scan.rs index 9f1111f2899..ca0eed00aab 100644 --- a/packages/rs-platform-wallet-storage/tests/secrets_scan.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/secrets_scan.rs @@ -15,7 +15,7 @@ //! carries. Value-level safety is a separate guarantee via the sealed //! `PersistableBlob` trait in `src/sqlite/schema/blob.rs`. Files outside //! `schema/` define no columns and are not scanned; `src/secrets/` is -//! exempt by design and covered by its own `tests/secrets_guard.rs`. +//! exempt by design and covered by its own `tests/integration/secrets_guard.rs`. //! Legitimate uses inside doc comments are allow-listed via `ALLOWLIST`. use std::path::Path; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_account_zero_attribution.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_account_zero_attribution.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_account_zero_attribution.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_account_zero_attribution.rs index ba2eb55f0a7..8e2530a0f09 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_account_zero_attribution.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_account_zero_attribution.rs @@ -3,7 +3,7 @@ //! Genesis-rescan regression for UTXO attribution when a freshly-derived //! gap-limit-edge address has no persisted pool row. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_accounts_reader.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_accounts_reader.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_accounts_reader.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_accounts_reader.rs index 8a3fc4257ed..1c34250397e 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_accounts_reader.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_accounts_reader.rs @@ -4,7 +4,7 @@ //! into a keyless [`AccountRegistrationEntry`] manifest, bit-exact, //! fail-hard on a corrupt blob, and never mints a `Wallet`. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use key_wallet::account::{AccountType, StandardAccountType}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_asset_locks_filter.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_asset_locks_filter.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_asset_locks_filter.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_asset_locks_filter.rs index fda58682e27..2243e7bf277 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_asset_locks_filter.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_asset_locks_filter.rs @@ -4,7 +4,7 @@ //! rows so a spent one-shot lock never resurrects as actionable on //! rehydration, while the historical row stays on disk. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use dashcore::hashes::Hash; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_auto_backup.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_auto_backup.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_auto_backup.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_auto_backup.rs index 5ed597bbffb..171f20404fd 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_auto_backup.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_auto_backup.rs @@ -2,7 +2,7 @@ //! TC-050..TC-055 — automatic backups. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use platform_wallet_storage::{ diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_backup_restore.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_backup_restore.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_backup_restore.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_backup_restore.rs index ddefaa7d1a6..ac2e499496d 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_backup_restore.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_backup_restore.rs @@ -2,7 +2,7 @@ //! TC-031..TC-039 — online backup, restore source validation, retention. -mod common; +use crate::common; use std::fs; @@ -381,7 +381,7 @@ fn tc_code_009_b_backup_to_non_already_exists_maps_to_io() { /// invoked in `backup.rs`. #[test] fn tc_code_014_a_backup_calls_parent_fsync() { - let src = include_str!("../src/sqlite/backup.rs"); + let src = include_str!("../../src/sqlite/backup.rs"); let calls = src.matches("fsync_parent_dir(").count(); assert!( calls >= 3, @@ -394,7 +394,7 @@ fn tc_code_014_a_backup_calls_parent_fsync() { /// aren't misled about durability guarantees. #[test] fn tc_code_014_b_atomicity_doc_mentions_fsync() { - let src = include_str!("../src/sqlite/backup.rs"); + let src = include_str!("../../src/sqlite/backup.rs"); let lower = src.to_lowercase(); assert!( lower.contains("fsync") || lower.contains("sync_all"), diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_blob_roundtrip_coverage.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_blob_roundtrip_coverage.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_blob_roundtrip_coverage.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_blob_roundtrip_coverage.rs index 19c16add348..0aaf9f9eb51 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_blob_roundtrip_coverage.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_blob_roundtrip_coverage.rs @@ -13,7 +13,7 @@ //! variant, not a partial/empty one) is what makes this a guard that would //! actually have caught the bug. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use dashcore::hashes::Hash; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_blob_size_gate_on_load.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_blob_size_gate_on_load.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_blob_size_gate_on_load.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_blob_size_gate_on_load.rs index b9a89b39eaa..71b36ae50aa 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_blob_size_gate_on_load.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_blob_size_gate_on_load.rs @@ -8,7 +8,7 @@ //! directly via raw SQL so the production encode path (which enforces the cap //! on writes) is bypassed — simulating a tampered / corrupted local wallet DB. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use rusqlite::params; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_buffer_semantics.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_buffer_semantics.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_buffer_semantics.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_buffer_semantics.rs index 91626d2693e..a96ec53f41b 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_buffer_semantics.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_buffer_semantics.rs @@ -8,7 +8,7 @@ //! `persister.rs::lock_conn_for_test`; tests that need to inject a //! failure poison the DB through that handle and verify rollback. -mod common; +use crate::common; use std::collections::BTreeMap; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_check_constraints.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_check_constraints.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_check_constraints.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_check_constraints.rs index 68eadff1d13..fea04995908 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_check_constraints.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_check_constraints.rs @@ -8,7 +8,7 @@ //! row carrying a label outside the const array is rejected by SQLite //! with `SqliteFailure(ConstraintCheck, _)`. -mod common; +use crate::common; use common::{fresh_persister, wid}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_cli_smoke.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_cli_smoke.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_cli_smoke.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_cli_smoke.rs index 8d6811e4e83..77ca77e6f9d 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_cli_smoke.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_cli_smoke.rs @@ -2,7 +2,7 @@ //! CLI smoke tests for the maintenance binary. -mod common; +use crate::common; use std::process::Command; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_commit_writes_lock_poison_shortcircuit.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_commit_writes_lock_poison_shortcircuit.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_commit_writes_lock_poison_shortcircuit.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_commit_writes_lock_poison_shortcircuit.rs index 89c8d8960fc..24ddc03e61a 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_commit_writes_lock_poison_shortcircuit.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_commit_writes_lock_poison_shortcircuit.rs @@ -9,7 +9,7 @@ //! `force_next_flush_to_fail` injector. The permanence test poisons the real //! connection mutex from a panicking thread. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister_with_mode, wid}; use platform_wallet::changeset::{ diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_compile_time.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_compile_time.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_compile_time.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_compile_time.rs index 16d225c1813..0e56f58d165 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_compile_time.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_compile_time.rs @@ -4,7 +4,7 @@ //! TC-P1-003 — every writer call site uses `prepare_cached`. //! TC-P4-011 — `ClientStartState` keeps the base public shape. -mod common; +use crate::common; use std::sync::Arc; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_contacts_keys_rehydration.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_contacts_keys_rehydration.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_contacts_keys_rehydration.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_contacts_keys_rehydration.rs index d87421b924d..948d4a981c4 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_contacts_keys_rehydration.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_contacts_keys_rehydration.rs @@ -5,7 +5,7 @@ //! afterwards. store → drop → reopen → `load()` → assert on the //! `ManagedIdentity` fields directly. -mod common; +use crate::common; use std::collections::{BTreeMap, HashSet}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_core_pool_writer.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_core_pool_writer.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_core_pool_writer.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_core_pool_writer.rs index cf385c7cbb4..d20510fd51c 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_core_pool_writer.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_core_pool_writer.rs @@ -5,7 +5,7 @@ //! Covers pool rows with their `used` flags, the pool-resolved account index, //! idempotent per-changeset pool state, and `key_class` survival. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use key_wallet::account::{AccountType, StandardAccountType}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_core_state_reader.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_core_state_reader.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_core_state_reader.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_core_state_reader.rs index 1efad56d87f..bfe588a00f1 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_core_state_reader.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_core_state_reader.rs @@ -4,7 +4,7 @@ //! `CoreChangeSet` (UTXOs, records, IS-locks, sync watermarks), and the //! no-silent-zero balance contract holds end-to-end. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use dashcore::hashes::Hash; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_dashpay_overlay_contract.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_dashpay_overlay_contract.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_dashpay_overlay_contract.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_dashpay_overlay_contract.rs index 2b50173b838..6b716cc9f35 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_dashpay_overlay_contract.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_dashpay_overlay_contract.rs @@ -13,7 +13,7 @@ //! does not corrupt `load()` — load succeeds and surfaces the wallet's //! other state intact. -mod common; +use crate::common; use std::collections::BTreeMap; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_delete_buffer_reconcile.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_buffer_reconcile.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_delete_buffer_reconcile.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_buffer_reconcile.rs index f74d117ea87..e268d535e2e 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_delete_buffer_reconcile.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_buffer_reconcile.rs @@ -12,7 +12,7 @@ //! buffer and abort the delete without producing a backup; the //! flush must not resurrect a deleted wallet. -mod common; +use crate::common; use common::{fresh_persister_with_mode, wid}; use key_wallet::Network; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_delete_cross_process_exclusion.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_cross_process_exclusion.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_delete_cross_process_exclusion.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_cross_process_exclusion.rs index ee25313002c..60eebb3d145 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_delete_cross_process_exclusion.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_cross_process_exclusion.rs @@ -5,7 +5,7 @@ //! Connection (a different process equivalent) can't commit rows //! between the backup snapshot and the cascade. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use rusqlite::{OptionalExtension as _, TransactionBehavior}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_delete_partial_commit_window.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_partial_commit_window.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_delete_partial_commit_window.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_partial_commit_window.rs index 363c53f88a5..95a2aff3725 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_delete_partial_commit_window.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_partial_commit_window.rs @@ -7,7 +7,7 @@ //! left in the buffer when the delete aborts AFTER the pre-flush has //! already committed its changeset. -mod common; +use crate::common; use common::wid; use key_wallet::Network; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_delete_real_apply_failure.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_real_apply_failure.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_delete_real_apply_failure.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_real_apply_failure.rs index e6b67cccf17..f7701592bc1 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_delete_real_apply_failure.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_real_apply_failure.rs @@ -9,7 +9,7 @@ //! real "no such table" failure on the core-state INSERT, and the //! buffered changeset MUST be restored (not lost). -mod common; +use crate::common; use common::wid; use key_wallet::Network; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_delete_wallet.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_wallet.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_delete_wallet.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_wallet.rs index 64eb8c0a627..3db6fd60e98 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_delete_wallet.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_wallet.rs @@ -2,7 +2,7 @@ //! `delete_wallet` cascade + concurrency regressions. -mod common; +use crate::common; use std::sync::Arc; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_delete_wallet_constraint_carveout.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_wallet_constraint_carveout.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_delete_wallet_constraint_carveout.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_wallet_constraint_carveout.rs index 6f37640d277..c7a444c8676 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_delete_wallet_constraint_carveout.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_delete_wallet_constraint_carveout.rs @@ -11,7 +11,7 @@ //! must abort the delete with the buffer intact, not be swallowed at the //! one moment an operator is removing state. -mod common; +use crate::common; use common::{ensure_identity, ensure_wallet_meta, fresh_persister_with_mode}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_deleted_wallet_residue.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_deleted_wallet_residue.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_deleted_wallet_residue.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_deleted_wallet_residue.rs index 79fb8f17519..058d485c73f 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_deleted_wallet_residue.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_deleted_wallet_residue.rs @@ -11,7 +11,7 @@ //! rewriting. A test sized to fit inside one shared page would pass under FAST //! and prove nothing about the guarantee `delete_wallet` claims. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use std::path::{Path, PathBuf}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_error_classification.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_error_classification.rs similarity index 100% rename from packages/rs-platform-wallet-storage/tests/sqlite_error_classification.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_error_classification.rs diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_fk_changeset_ordering.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_fk_changeset_ordering.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_fk_changeset_ordering.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_fk_changeset_ordering.rs index 518efb2fd7b..8d5cac6a6e9 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_fk_changeset_ordering.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_fk_changeset_ordering.rs @@ -11,7 +11,7 @@ //! 2. A changeset carrying parent and child together commits — the fixed //! dispatch order writes the parent first for every FK edge. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, fresh_persister_with_mode, wid}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_foreign_db_rejection.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_foreign_db_rejection.rs similarity index 98% rename from packages/rs-platform-wallet-storage/tests/sqlite_foreign_db_rejection.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_foreign_db_rejection.rs index d419be02fa7..ff5319a79e4 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_foreign_db_rejection.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_foreign_db_rejection.rs @@ -4,7 +4,7 @@ //! but no `refinery_schema_history`) instead of silently grafting wallet //! tables onto a foreign schema. -mod common; +use crate::common; use platform_wallet_storage::{SqlitePersister, SqlitePersisterConfig, WalletStorageError}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_foreign_keys.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_foreign_keys.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_foreign_keys.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_foreign_keys.rs index 15a750ce886..5b067ba6551 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_foreign_keys.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_foreign_keys.rs @@ -2,7 +2,7 @@ //! TC-045..TC-049 — native foreign-key enforcement and the delete cascade. -mod common; +use crate::common; use common::{ensure_identity, ensure_wallet_meta, fresh_persister, wid}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_identity_hard_delete.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_hard_delete.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_identity_hard_delete.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_hard_delete.rs index 4dce03c6a06..7a861e2fa21 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_identity_hard_delete.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_hard_delete.rs @@ -9,7 +9,7 @@ //! dormant once `wallet_id` is NULL), and `contacts` / `ignored_senders` //! (keyed by `owner_id` with no FK to `identities` at all). -mod common; +use crate::common; use std::collections::{BTreeMap, BTreeSet}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_identity_index_concurrency.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_index_concurrency.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_identity_index_concurrency.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_index_concurrency.rs index 18f125498bd..65da2b5943b 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_identity_index_concurrency.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_index_concurrency.rs @@ -28,7 +28,7 @@ //! trade, not a confidence threshold: every attempt builds a database //! and spins six threads. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, release_at_store_seam, wid}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_identity_index_uniqueness.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_index_uniqueness.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_identity_index_uniqueness.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_index_uniqueness.rs index 15ebc2fd157..9021f02dc55 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_identity_index_uniqueness.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_index_uniqueness.rs @@ -9,7 +9,7 @@ //! offending write is refused instead, attributed to the caller that //! made it. -mod common; +use crate::common; use common::{ ensure_identity, ensure_wallet_meta, fresh_persister, fresh_persister_with_mode, wid, diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_identity_keys_reader.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_keys_reader.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_identity_keys_reader.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_keys_reader.rs index b2340a392b0..ceae21c6219 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_identity_keys_reader.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_keys_reader.rs @@ -4,7 +4,7 @@ //! into a keyless `IdentityKeysChangeSet`, bit-exact, fail-hard on a //! corrupt blob. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use dpp::identity::identity_public_key::v0::IdentityPublicKeyV0; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_identity_scan_state.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_scan_state.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_identity_scan_state.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_scan_state.rs index b0b37c2da5e..34f3b589a96 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_identity_scan_state.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_identity_scan_state.rs @@ -16,7 +16,7 @@ //! discovery. Asserting on a reader helper instead would prove the row was //! written and read, never that the decision it exists to change can see it. -mod common; +use crate::common; use std::path::Path; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_legacy_state_migration.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_legacy_state_migration.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_legacy_state_migration.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_legacy_state_migration.rs index 6e282494a7a..d25ba8ebe29 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_legacy_state_migration.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_legacy_state_migration.rs @@ -1,6 +1,6 @@ //! Populated pre-rehydration databases must retain their typed state on upgrade. -mod common; +use crate::common; use key_wallet::account::{AccountType, StandardAccountType}; use key_wallet::managed_account::address_pool::{AddressPoolType, AddressState}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_load_reconstruction.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_load_reconstruction.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_load_reconstruction.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_load_reconstruction.rs index bfd04156869..bbb2c3b8a61 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_load_reconstruction.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_load_reconstruction.rs @@ -5,7 +5,7 @@ //! projection, identities, `Consumed`-filtered asset locks, contacts, //! identity keys) from which the manager re-derives the signing `Wallet`. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use dash_sdk::platform::address_sync::AddressFunds; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_load_wiring.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_load_wiring.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_load_wiring.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_load_wiring.rs index a56487a1cfd..24c5cc9f9a6 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_load_wiring.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_load_wiring.rs @@ -5,7 +5,7 @@ //! manifest, core state, identities, filtered asset locks), carrying no //! `Wallet`/seed. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use key_wallet::wallet::initialization::WalletAccountCreationOptions; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_migration_execution.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_migration_execution.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_migration_execution.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_migration_execution.rs index 426060a28a9..a25039593a0 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_migration_execution.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_migration_execution.rs @@ -6,7 +6,7 @@ //! restorable with a deterministic re-migration, forward-version rejection at //! the new max, idempotent re-entry, and an empty wallet through migration. -mod common; +use crate::common; use std::path::{Path, PathBuf}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_migrations.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_migrations.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_migrations.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_migrations.rs index e341aa0df0d..f2c835cf119 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_migrations.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_migrations.rs @@ -2,7 +2,7 @@ //! Migration discovery, application, and idempotency. -mod common; +use crate::common; use common::fresh_persister; use platform_wallet_storage::sqlite::migrations as mig; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_money_column_overflow_on_read.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_money_column_overflow_on_read.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_money_column_overflow_on_read.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_money_column_overflow_on_read.rs index e792343b834..5b1e9254aa9 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_money_column_overflow_on_read.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_money_column_overflow_on_read.rs @@ -9,7 +9,7 @@ //! the genuine value-bearing columns, with `platform_addresses.balance` //! riding the production `load()` path end-to-end. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use platform_wallet::changeset::{ diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_object_metadata.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_object_metadata.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_object_metadata.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_object_metadata.rs index 6cd617efe19..547b53b818a 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_object_metadata.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_object_metadata.rs @@ -10,7 +10,7 @@ #![cfg(feature = "kv")] -mod common; +use crate::common; use common::{ ensure_contact_established, ensure_contact_received, ensure_contact_sent, ensure_identity, diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_open_integrity_check.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_open_integrity_check.rs similarity index 98% rename from packages/rs-platform-wallet-storage/tests/sqlite_open_integrity_check.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_open_integrity_check.rs index a9a3c93e684..3528464ec1b 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_open_integrity_check.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_open_integrity_check.rs @@ -6,7 +6,7 @@ //! migrated (and snapshotted into the pre-migration auto-backup, //! defeating rollback). -mod common; +use crate::common; use std::fs::OpenOptions; use std::io::{Read, Seek, SeekFrom, Write}; @@ -147,7 +147,7 @@ fn tc_code_016_a_integrity_report_collects_all_rows() { ); // Source-level regression: the helper must use `query_map`, not // `query_row`, so multi-row reports are preserved. - let helper_src = include_str!("../src/sqlite/backup.rs"); + let helper_src = include_str!("../../src/sqlite/backup.rs"); assert!( helper_src.contains("PRAGMA integrity_check") && helper_src.contains("query_map"), "run_integrity_check must use query_map (not query_row) to collect every diagnostic row" diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_open_version_gate.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_open_version_gate.rs similarity index 98% rename from packages/rs-platform-wallet-storage/tests/sqlite_open_version_gate.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_open_version_gate.rs index 97da08e2df3..30596446056 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_open_version_gate.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_open_version_gate.rs @@ -4,7 +4,7 @@ //! older binary would otherwise migration::run() no-op past gets //! caught at open time. -mod common; +use crate::common; use platform_wallet_storage::{SqlitePersister, SqlitePersisterConfig, WalletStorageError}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_permissions.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_permissions.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_permissions.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_permissions.rs index 3875d5cc290..d1bb0b27533 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_permissions.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_permissions.rs @@ -6,7 +6,7 @@ #![cfg(unix)] #![allow(clippy::field_reassign_with_default)] -mod common; +use crate::common; use std::ffi::OsString; use std::os::unix::ffi::{OsStrExt, OsStringExt}; @@ -393,7 +393,7 @@ fn tc_code_011_b_no_sidecars_is_ok() { assert_eq!(mode, 0o600); // Source-level regression: the helper must NOT contain `exists(` // anywhere in its sibling-chmod path. - let src = include_str!("../src/sqlite/util/permissions.rs"); + let src = include_str!("../../src/sqlite/util/permissions.rs"); assert!( !src.contains("sibling.exists("), "permissions.rs must not pre-gate set_permissions on sibling.exists() (TOCTOU)" @@ -408,7 +408,7 @@ fn tc_code_011_b_no_sidecars_is_ok() { /// WAL/SHM-unlink loop (DRY motif). #[test] fn tc_code_011_c_backup_wal_shm_unlink_no_lossy_no_exists_gate() { - let src = include_str!("../src/sqlite/backup.rs"); + let src = include_str!("../../src/sqlite/backup.rs"); // The unlink loop now uses OsString::push, not to_string_lossy. // We can't structurally diff the loop, but the file must not // contain the lossy pattern on the sidecar build path. diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_persist_roundtrip.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_persist_roundtrip.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_persist_roundtrip.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_persist_roundtrip.rs index 9757deee4de..017ebf783ac 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_persist_roundtrip.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_persist_roundtrip.rs @@ -6,7 +6,7 @@ //! CoreChangeSet records and multi-wallet coexistence are covered in //! `sqlite_buffer_semantics.rs`. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use key_wallet::Network; @@ -255,7 +255,7 @@ fn tc007_identity_key_entry_roundtrip() { assert_eq!(decoded, entry); // No runtime substring scan on the blob: bincode wire bytes carry no // field names, so it would be false confidence. The real secret-leak - // guard is the source grep in `tests/secrets_scan.rs`. + // guard is the source grep in `tests/integration/secrets_scan.rs`. drop(tmp); } diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_pool_reader.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_pool_reader.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_pool_reader.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_pool_reader.rs index 45f3dda8283..6d98b1f39de 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_pool_reader.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_pool_reader.rs @@ -17,7 +17,7 @@ //! don't set up. The `load()` → `core_wallet_info` marking path is covered by //! `sqlite_used_core_addresses.rs`. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use dashcore::address::Payload; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_provider_key_accounts.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_provider_key_accounts.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_provider_key_accounts.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_provider_key_accounts.rs index 1a517f6dc80..4abc05471fa 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_provider_key_accounts.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_provider_key_accounts.rs @@ -4,7 +4,7 @@ //! operator-key and EdDSA platform-node-key accounts survive `store()` → //! `load()` on par with the ECDSA `account_registrations` manifest. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use key_wallet::account::AccountType; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_qa_identity_removal.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_qa_identity_removal.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_qa_identity_removal.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_qa_identity_removal.rs index 4ac407883b2..da87c9cc68f 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_qa_identity_removal.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_qa_identity_removal.rs @@ -8,7 +8,7 @@ //! starts from a blank identity, and that a foreign wallet's `removed` //! set cannot reach this wallet's identity. -mod common; +use crate::common; use std::collections::{BTreeMap, BTreeSet}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_recovery_mode.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_recovery_mode.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_recovery_mode.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_recovery_mode.rs index 3bb4c2a5fea..b13d5f79e0c 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_recovery_mode.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_recovery_mode.rs @@ -8,7 +8,7 @@ //! [`SqlitePersister::last_load_degradation`], and the documented degraded //! projection is served instead. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, fresh_recovery_persister, wid}; use dashcore::hashes::Hash; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_recovery_mode_write_block.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_recovery_mode_write_block.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_recovery_mode_write_block.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_recovery_mode_write_block.rs index 6f2798d4f49..f5d09321f10 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_recovery_mode_write_block.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_recovery_mode_write_block.rs @@ -7,7 +7,7 @@ //! projection over the good data. Reads, and `backup_to` (a read of the //! source), stay available. -mod common; +use crate::common; use std::fs; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_restore_cross_process_exclusion.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_cross_process_exclusion.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_restore_cross_process_exclusion.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_cross_process_exclusion.rs index aabdfe48938..eaf431cc1ed 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_restore_cross_process_exclusion.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_cross_process_exclusion.rs @@ -5,7 +5,7 @@ //! An advisory `flock(2)` would not exclude rusqlite peers; //! exclusive locking mode plus `BEGIN EXCLUSIVE` does. -mod common; +use crate::common; use std::collections::HashSet; use std::path::Path; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_restore_open_path_guard.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_open_path_guard.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_restore_open_path_guard.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_open_path_guard.rs index 90ee210b667..c564012bcf3 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_restore_open_path_guard.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_open_path_guard.rs @@ -6,7 +6,7 @@ //! restored bytes. The guard mirrors `open()`'s in-process open-path //! registry and clears once the holder drops. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use platform_wallet_storage::{SqlitePersister, WalletStorageError}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_restore_staged_validation.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_staged_validation.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_restore_staged_validation.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_staged_validation.rs index 34c47aa4d8d..4fc060ab28c 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_restore_staged_validation.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_restore_staged_validation.rs @@ -7,7 +7,7 @@ //! schema-history-missing source is rejected AND the live destination //! is left untouched, closing the validate-then-reopen TOCTOU window. -mod common; +use crate::common; use std::fs; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_schema_pinning.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_schema_pinning.rs similarity index 100% rename from packages/rs-platform-wallet-storage/tests/sqlite_schema_pinning.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_schema_pinning.rs diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_second_open_guard.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_second_open_guard.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_second_open_guard.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_second_open_guard.rs index eaeb56e02f8..8a1726f6e72 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_second_open_guard.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_second_open_guard.rs @@ -4,7 +4,7 @@ //! independent `Mutex` + write buffer). Dropping the first //! releases the claim so a later open succeeds. -mod common; +use crate::common; use platform_wallet_storage::{SqlitePersister, SqlitePersisterConfig, WalletStorageError}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_sent_payment_verdict_durability.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_sent_payment_verdict_durability.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_sent_payment_verdict_durability.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_sent_payment_verdict_durability.rs index 5dc90b1bec8..f0911a20c3f 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_sent_payment_verdict_durability.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_sent_payment_verdict_durability.rs @@ -25,7 +25,7 @@ //! this crate's SQLite persister, then closes the database and reopens it. //! The assertion is on what `load()` hands back. -mod common; +use crate::common; use std::collections::BTreeMap; use std::sync::atomic::AtomicBool; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_shielded_viewing_keys.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_shielded_viewing_keys.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_shielded_viewing_keys.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_shielded_viewing_keys.rs index cd69dd9a2f3..22b1d4cc408 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_shielded_viewing_keys.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_shielded_viewing_keys.rs @@ -1,6 +1,6 @@ #![cfg(feature = "shielded")] -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use platform_wallet::changeset::{ diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_store_flush_seam.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_store_flush_seam.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_store_flush_seam.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_store_flush_seam.rs index 600497e3ddf..170566f8dd6 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_store_flush_seam.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_store_flush_seam.rs @@ -18,7 +18,7 @@ //! parks the bystander exactly in the window, so a regression fails //! every run rather than one run in hundreds. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, release_at_store_seam, ro_conn, wid}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_store_generation.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_store_generation.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_store_generation.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_store_generation.rs index 72039754399..7cdd14cb823 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_store_generation.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_store_generation.rs @@ -4,7 +4,7 @@ //! flush, and regenerated on restore so a restored copy is distinguishable //! from its source. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, ro_conn, wid}; use platform_wallet::changeset::{ diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_structural_hardening.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_structural_hardening.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_structural_hardening.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_structural_hardening.rs index 5778b2694a0..f440152fb35 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_structural_hardening.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_structural_hardening.rs @@ -6,7 +6,7 @@ //! multi-account UTXO bucketing, identity-key typed-vs-blob consistency, //! the truncation guards, and the compaction-marker-only load gate. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_trait_dispatch.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_trait_dispatch.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_trait_dispatch.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_trait_dispatch.rs index 2ec37b19ae7..b0a2449f069 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_trait_dispatch.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_trait_dispatch.rs @@ -2,7 +2,7 @@ //! Trait dispatch for the SQLite persister and default-safe backend methods. -mod common; +use crate::common; use std::sync::Arc; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_transaction_sweeps.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_transaction_sweeps.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_transaction_sweeps.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_transaction_sweeps.rs index 6a7bbc1361d..a28a05b5e92 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_transaction_sweeps.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_transaction_sweeps.rs @@ -8,7 +8,7 @@ //! each case can pre-seed exactly the rows a sweep needs to reason about //! without going through the full changeset-merge/buffer machinery. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid, SqlitePersister, SqlitePersisterConfig}; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_unowned_identities.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_unowned_identities.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_unowned_identities.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_unowned_identities.rs index 029ffa472fa..9e5a5bfe869 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_unowned_identities.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_unowned_identities.rs @@ -6,7 +6,7 @@ //! contract — that the accessor returns them fully keyed, and that a //! round trip does NOT quietly hand them to a wallet. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use dpp::identity::accessors::IdentityGettersV0; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_used_core_addresses.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_used_core_addresses.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_used_core_addresses.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_used_core_addresses.rs index c99ba523bcf..131b38d72bf 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_used_core_addresses.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_used_core_addresses.rs @@ -5,7 +5,7 @@ //! unspent) so the rehydrated wallet never hands it out again as a fresh //! receive address (address reuse). -mod common; +use crate::common; use common::{fresh_persister, wid}; use key_wallet::managed_account::managed_account_trait::ManagedAccountTrait; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_v008_isolation.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_v008_isolation.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_v008_isolation.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_v008_isolation.rs index c02cb1fd9fc..d8b9eb37567 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_v008_isolation.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_v008_isolation.rs @@ -5,7 +5,7 @@ //! fully-overlapping keys must not collide, must not leak across wallets, and //! deleting one must leave the other's V009 rows intact. -mod common; +use crate::common; use common::{ensure_wallet_meta, fresh_persister, wid}; use platform_wallet::wallet::platform_wallet::WalletId; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_v008_migration.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_v008_migration.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_v008_migration.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_v008_migration.rs index 0e7f3e79244..9737a4ce7c6 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_v008_migration.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_v008_migration.rs @@ -8,7 +8,7 @@ //! `meta_data_versions` shape and PK, the `core_address_pool` shape and PK, //! and the store-generation seed. -mod common; +use crate::common; use std::collections::BTreeMap; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_version_bump.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_version_bump.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_version_bump.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_version_bump.rs index 17ad01521aa..6226e96f811 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_version_bump.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_version_bump.rs @@ -4,7 +4,7 @@ //! is atomic (data and bump are all-or-nothing), every domain maps to its own //! bump with none silently excluded, and the seq saturates rather than wrapping. -mod common; +use crate::common; use std::collections::BTreeMap; diff --git a/packages/rs-platform-wallet-storage/tests/sqlite_wallet_db_identity.rs b/packages/rs-platform-wallet-storage/tests/integration/sqlite_wallet_db_identity.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/sqlite_wallet_db_identity.rs rename to packages/rs-platform-wallet-storage/tests/integration/sqlite_wallet_db_identity.rs index 5f83eefb605..d5ff122191c 100644 --- a/packages/rs-platform-wallet-storage/tests/sqlite_wallet_db_identity.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/sqlite_wallet_db_identity.rs @@ -11,7 +11,7 @@ //! `applied_on` / `checksum` must surface a typed //! `SchemaHistoryMalformed` rather than panicking inside refinery. -mod common; +use crate::common; use common::{fresh_persister, wid}; use platform_wallet::changeset::{ diff --git a/packages/rs-platform-wallet-storage/tests/tracked_masternodes_roundtrip.rs b/packages/rs-platform-wallet-storage/tests/integration/tracked_masternodes_roundtrip.rs similarity index 99% rename from packages/rs-platform-wallet-storage/tests/tracked_masternodes_roundtrip.rs rename to packages/rs-platform-wallet-storage/tests/integration/tracked_masternodes_roundtrip.rs index fd4706a98b1..e2dbe07e081 100644 --- a/packages/rs-platform-wallet-storage/tests/tracked_masternodes_roundtrip.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/tracked_masternodes_roundtrip.rs @@ -1,7 +1,7 @@ //! Tracked-masternode rows: whole-set replace + per-network scoping + //! restart survival through the `PlatformWalletPersistence` trait methods. -mod common; +use crate::common; use common::fresh_persister; use platform_wallet::changeset::{PersistenceCapabilities, PlatformWalletPersistence}; From 65e85c4b880979122877b2d2fdbc0516a70a26ad Mon Sep 17 00:00:00 2001 From: pasta Date: Mon, 12 Oct 2026 16:58:26 -0500 Subject: [PATCH 2/3] docs(platform-wallet-storage): fixture regeneration selects the integration binary fixture_gen is now a module of the integration test binary, so the documented `--test fixture_gen` target no longer exists. Co-Authored-By: Claude Opus 5.5 --- .../rs-platform-wallet-storage/tests/integration/fixture_gen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rs-platform-wallet-storage/tests/integration/fixture_gen.rs b/packages/rs-platform-wallet-storage/tests/integration/fixture_gen.rs index da3d8825f58..df75b039416 100644 --- a/packages/rs-platform-wallet-storage/tests/integration/fixture_gen.rs +++ b/packages/rs-platform-wallet-storage/tests/integration/fixture_gen.rs @@ -16,7 +16,7 @@ //! git worktree add --detach /data/git-worktrees/-base origin/v4.2-dev //! cargo build -p platform-wallet-storage --bin platform-wallet-storage --features cli //! /debug/platform-wallet-storage --db /v42.db migrate --no-auto-backup -//! V4_2_DEV_DB=/v42.db cargo test -p platform-wallet-storage --test fixture_gen -- --ignored +//! V4_2_DEV_DB=/v42.db cargo test -p platform-wallet-storage --test integration fixture_gen:: -- --ignored //! ``` //! The parent directory chain of `/v42.db` must not be group- or //! world-writable, or the persister refuses it as an insecure parent. From 7cd9e300e185f2e21549d5ad8622d37028079c57 Mon Sep 17 00:00:00 2001 From: pasta Date: Mon, 12 Oct 2026 17:48:08 -0500 Subject: [PATCH 3/3] docs(platform-wallet-storage): point the store-seam latch note at tests/integration/common Co-Authored-By: Claude Opus 5.5 --- packages/rs-platform-wallet-storage/src/sqlite/persister.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rs-platform-wallet-storage/src/sqlite/persister.rs b/packages/rs-platform-wallet-storage/src/sqlite/persister.rs index fd865405121..9c2a11f7cd7 100644 --- a/packages/rs-platform-wallet-storage/src/sqlite/persister.rs +++ b/packages/rs-platform-wallet-storage/src/sqlite/persister.rs @@ -1215,7 +1215,7 @@ impl SqlitePersister { /// every subsequent `store()` call on this persister until overwritten /// or cleared. A test that wants it to fire exactly once (the common /// case) needs its own latch — see `release_at_store_seam` in - /// `tests/common` for the pattern. + /// `tests/integration/common` for the pattern. #[doc(hidden)] #[cfg(any(test, feature = "__test-helpers"))] pub fn set_store_flush_seam_for_test(&self, seam: Arc) {