Commit Graph

1072 Commits

Author SHA1 Message Date
Jack Grigg bf73a02f45 zcash_client_backend: Move test-only methods to new `WalletTest` trait
This reduces the feature-flag-related `WalletRead` breakage for crate
users, and gives us a place to expose even more internal Data Access API
implementation details for general testing purposes.
2024-09-12 13:08:34 +00:00
Jack Grigg c97e9a192b
Merge pull request #1530 from nuttycom/generalized_test_framework
Generalize the `zcash_client_sqlite` test framework and extract it to `zcash_client_backend`
2024-09-10 16:45:47 +01:00
Jack Grigg cd71c30857 Address non-documentation review comments 2024-09-10 15:14:23 +00:00
Kris Nuttycombe 04478c791a
Merge pull request #1524 from zcash/wallet/do_not_require_transparent
zcash_client_sqlite: Do not require a transparent key for migrations.
2024-09-08 09:34:15 -06:00
Kris Nuttycombe d4e26d5e4b zcash_client_backend: Migrate `send_single_step_proposed_transfer` test from `zcash_client_sqlite` 2024-09-06 17:56:20 -06:00
Kris Nuttycombe 33b8f89a6a zcash_client_backend: Move `OrchardPoolTester` here from `zcash_client_sqlite` 2024-09-06 15:33:44 -06:00
Kris Nuttycombe 7e36561de8 zcash_client_backend: Move `SaplingPoolTester` here from `zcash_client_sqlite` 2024-09-06 15:07:34 -06:00
Kris Nuttycombe 4f5b3efe09 zcash_client_backend: Move the `ShieldedPoolTester` trait from `zcash_client_sqlite` 2024-09-06 14:51:29 -06:00
Kris Nuttycombe 49dffbf6ee zcash_client_sqlite: Remove unused `OutputRecoveryError` type. 2024-09-06 14:00:39 -06:00
Kris Nuttycombe e55df6c493 zcash_client_sqlite: Move `TestState` to `zcash_client_backend` 2024-09-06 13:33:19 -06:00
Kris Nuttycombe 7e9f78bf46 zcash_client_sqlite: Generalize `TestBuilder::with_block_cache` 2024-09-06 13:30:10 -06:00
Kris Nuttycombe ce59a676e9 zcash_client_sqlite: Remove the remainder of the sqlite dependencies from TestState 2024-09-06 13:30:10 -06:00
Kris Nuttycombe 15e124e17c zcash_client_sqlite: Generalize `TestState::get_wallet_summary` 2024-09-06 13:30:10 -06:00
Kris Nuttycombe 58b464d102 zcash_client_sqlite: Generalize more `TestState` operations. 2024-09-06 13:30:10 -06:00
Kris Nuttycombe acd26d5d53 zcash_client_sqlite: Move `TransactionSummary` to `zcash_client_backend` 2024-09-06 13:30:10 -06:00
Kris Nuttycombe db6b9708eb zcash_client_sqlite: Generalize the test framework to enable it to be moved to `zcash_client_backend` 2024-09-06 13:29:26 -06:00
Kris Nuttycombe 69953ccd88 zcash_client_backend: Make `AccountId` an associated type of the `Account` trait. 2024-09-04 15:51:08 -06:00
Kris Nuttycombe f063e7ab7e Merge remote-tracking branch 'upstream/main' into sqlite_legacy_support 2024-09-03 12:29:04 -06:00
Kris Nuttycombe 5e6a8f0250 Release zcash_client_sqlite version 0.11.2 2024-09-03 12:20:12 -06:00
Kris Nuttycombe 1b8334104d zcash_client_sqlite: Accept 2-part `major.minor` SQLite versions. 2024-09-03 12:20:12 -06:00
Kris Nuttycombe 61584f7cc0 zcash_client_sqlite: Verify sqlite version compatibility on wallet init. 2024-09-02 21:21:57 -06:00
Kris Nuttycombe 5ad432ad6e zcash_client_sqlite: Do not require a transparent key for migrations.
The `reserve_until` method for generating ephemeral addresses is used in
database migrations, but it makes no sense to use this in the case that
the UFVK for an account contains no transparent component; such accounts
can never be used to make ZIP 320 spends.
2024-08-30 16:47:09 -06:00
Kris Nuttycombe c91b34ef87 Support older `sqlite` versions.
The `FALSE` constant was introduced in sqlite version 3.23.0,
but Android does not support this version of sqlite until API
level 30; we support back to Android API 27 so we have to use
`0` as the constant for `FALSE` instead.
2024-08-30 11:23:45 -06:00
Kris Nuttycombe 7d3e5754d6 zcash_client_sqlite: Add missing test of `utxos_to_txos` migration. 2024-08-22 12:13:20 -06:00
Kris Nuttycombe 3afcfe430b release zcash_client_sqlite version 0.11.1 2024-08-21 16:30:38 -06:00
Kris Nuttycombe 3dba2fa9ae zcash_client_sqlite: Make `tx_retrieval_queue` depend upon all leaf migrations 2024-08-21 16:01:51 -06:00
Kris Nuttycombe b1cb8be244 zcash_client_sqlite: Make migration dependencies easier to track. 2024-08-21 15:50:39 -06:00
Kris Nuttycombe e4b3fb27b5 zcash_client_sqlite: Fix clippy complaints. 2024-08-21 14:14:31 -06:00
Jack Grigg 34402f7bea zcash_client_sqlite: Adjust migration DAG edges to fix dependency bug 2024-08-21 15:06:00 -05:00
Jack Grigg 6903fa6543 zcash_client_sqlite: Add test showing tx_retrieval_queue migration bug 2024-08-21 14:58:11 -05:00
Jack Grigg 7c416d533b zcash_client_sqlite: Add test for linear migration between db states 2024-08-21 14:27:59 -05:00
Kris Nuttycombe c7a8bed081 release zcash_client_sqlite version 0.11.0 2024-08-20 09:21:40 -06:00
Kris Nuttycombe 5a32d3b9bd zcash_client_sqlite: Ensure the end heights of `SpendsFromAddress` requests do not exceed the chain tip.
`lightwalletd` will return an error in the case that the requested end
height exceeds the chain tip. This should be considered a bug in
lightwalletd, but for now we will work around it in the wallet.
2024-08-19 12:10:14 -06:00
Kris Nuttycombe 484659dddb zcash_client_sqlite: Reprocess wallet transactions on upgrade to restore additional transparent history. 2024-08-16 16:55:03 -06:00
Kris Nuttycombe c22a2a4c92 zcash_client_sqlite: Move `store_decrypted_tx` to the `wallet` module.
This permits this method to be used in a migration.
2024-08-16 16:42:18 -06:00
Kris Nuttycombe 4059bfeca2 zcash_client_sqlite: Ensure we will query for status of unmined transactions in `store_decrypted_tx` 2024-08-16 14:24:15 -06:00
Kris Nuttycombe 3089e3b29d zcash_client_sqlite: Do not overwrite address on update in `put_sent_output` 2024-08-16 13:07:12 -06:00
Kris Nuttycombe 895d92b66b zcash_client_sqlite: Ensure we set mined-ness information in `store_decrypted_tx` 2024-08-16 10:49:59 -06:00
Kris Nuttycombe 54f59a8778 zcash_client_sqlite: Track all transparent spends.
Prior to this change, the `mark_transparent_utxo_spent` method assumed
that the UTXO information for outputs belonging to the wallet would be
known to exist before their spends could be detected. However, this is
not true in transparent history recovery: the spends are detected first.
We now cache the information about those spends so that we can then
correctly record the spend when the output being spent is eventually
detected.

At present, data from this spend cache is never deleted. This is because
such deletions could undermine history recovery in some narrow cases
related to chain reorgs.
2024-08-15 16:37:37 -06:00
Kris Nuttycombe 05887be962
Merge pull request #1487 from daira/improve-doc-for-send-multi-test
Improve the accuracy of a comment in `send_multi_step_proposed_transfer`
2024-08-12 08:15:38 -06:00
Daira-Emma Hopwood a021b9f277 Ensure that `zcash_client_sqlite` only enables "orchard" for `zcash_keys` when
its own "orchard" feature is enabled.

fixes #1488

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-11 18:34:52 +01:00
Daira-Emma Hopwood bd38645da5 When adding an account, check whether any component of its UFVK
(if available) collides with an existing imported or derived FVK.

This does not check for collisions on IVK for `Incoming` accounts.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-11 00:24:05 +01:00
Daira-Emma Hopwood 03c2e538ca Improve the accuracy of a comment in `send_multi_step_proposed_transfer`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-10 10:40:36 +01:00
Kris Nuttycombe ac7cbf9a41 zcash_client_backend: Add a `purpose` modifier for imported accounts.
This moves the tracking of whether or not a spending key is expected to
be available for an imported account into the `AccountSource::Imported`
variant.
2024-08-09 18:38:39 -06:00
Jack Grigg 52abb1f057
Merge pull request #1473 from nuttycom/wallet/enrichment_queue
Add queues to track the need for transaction enhancement and/or verification of mined status.
2024-08-10 00:37:23 +01:00
Kris Nuttycombe b47c7bfe8d zcash_client_sqlite: Improve the internal documentation of `set_transaction_status` 2024-08-09 17:30:37 -06:00
Kris Nuttycombe 5a1645ac76 zcash_client_sqlite: Make transaction retrieval depend upon presence of raw tx data. 2024-08-09 16:55:35 -06:00
Kris Nuttycombe 0bfa3d35bc Merge remote-tracking branch 'daira/1485-improve-multi-step-test' into wallet/enrichment_queue 2024-08-09 15:57:36 -06:00
Daira-Emma Hopwood 1023ce7f99 Replace the `put_tx_meta` workaround in `send_multi_step_proposed_transfer`.
fixes #1485

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-09 22:34:36 +01:00
Daira-Emma Hopwood 56e42336c4 Minor simplifications.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-08-09 22:33:00 +01:00