Commit Graph

307 Commits

Author SHA1 Message Date
Kevin Gorham 368099e154
Improvement: Remove dropAccountsTable.
This was effectively a band-aid fix from previous testing that is now working more cleanly so this code isn't needed, thankfully.
2021-05-07 04:11:35 -04:00
Kevin Gorham f9feb688cb
Improvement: parameterize test to run on both mainnet and testnet. 2021-05-07 04:00:32 -04:00
Kevin Gorham 44d1d55201
Improvement: Refactor the initializer and move all DB creation code.
Move the code to create, migrate and populate data from the initializer over to the repository. Both classes are now much simpler.
2021-05-07 03:59:47 -04:00
Kevin Gorham fc7cead1f6
New: Add the concept of 'prepare'.
begin adding a step between the creation of a Synchronizer and starting it, called 'prepare' which is responsible for migrations and other steps to get the data ready for syncing.
2021-05-07 03:56:26 -04:00
Kevin Gorham 8fb56ff80c
Improvement: Simplify Initializer to get rid of unnecessary inheritance. 2021-05-07 03:54:18 -04:00
Kevin Gorham 670ec68cd5
New: Improve behavior and messaging when an account is missing.
Scanning without an account setup is a programming error and prior to this change it wasted a lot of resources and would always crash eventually. Now, this error is caught sooner and surfaced with a clear message.
2021-05-05 14:26:13 -04:00
Kevin Gorham 0acb439793
New: Add quickRewind feature to make it easy to rescan 2wks of blocks.
This helps address https://github.com/nighthawk-apps/nighthawk-wallet-android/issues/38
2021-05-03 22:53:23 -04:00
Kevin Gorham ddf785e7d8
Fix: Disable logs by default. Also update verion and changelog. 2021-05-01 23:05:14 -04:00
Kevin Gorham c8180028af
Fix: Allow for key migration by resetting the accounts table.
Closes https://github.com/zcash/zcash-android-wallet/issues/258
2021-05-01 00:02:32 -04:00
Kevin Gorham 91a64561b7
New: Added test suite support
This required an update in mockito which was indirectly impacted by not having mavenCentral() as a repository as mentioned here https://github.com/mockito/mockito/issues/2007#issuecomment-829388655
2021-04-29 15:57:13 -04:00
Kevin Gorham 009d69f8f5
New: Update checkpoints. 2021-04-29 03:36:41 -04:00
Kevin Gorham 418106538e
Fix: Full rescan should not go beyond the checkpoint.
Otherwise, it gets interpreted as a reorg and can throw the wallet into an infinite rewind loop.
2021-04-29 03:34:35 -04:00
Kevin Gorham 303e1da180
Minor improvement on error messaging.
When the branches don't match, it's nice to know what network is being used.
2021-04-29 03:33:33 -04:00
Kevin Gorham 028bb95d5d
Fix: Return proper numeric type for consensus branch Id.
Closes https://github.com/zcash/zcash-android-wallet-sdk/issues/224
Related to https://github.com/nighthawk-apps/nighthawk-wallet-android/pull/35
2021-04-28 10:12:41 -04:00
Kevin Gorham c6d69b8266
New: Unit test to verify the logic for getting the client's consensus branch id. 2021-04-28 09:45:42 -04:00
Kevin Gorham 87afd7e55b
Fix: Better error message when address is not found. 2021-04-26 17:37:58 -04:00
Kevin Gorham fe0b249bcb
Minor test cleanup. 2021-04-26 17:37:30 -04:00
Kevin Gorham 49acf6476a
Update checkpoints. 2021-04-23 18:50:54 -04:00
Kevin Gorham 697721023c
Fix: Versioning error around annotations.
The project was including a bad version of NotNull and this resulted in errors that were very hard to troubleshoot because the failure happened during annotation processing so Dagger could not even generate the code that the rest of the app relied upon. It was a mess. Fixed by removing the useless NotNulls and being a little more conservative on dependencies.
2021-04-23 16:17:32 -04:00
Kevin Gorham 30f7bf0b82
New: Begin working on test harness.
For now, just pushing all uncommitted changes to tests. Next sprint we will begin focusing on generating a useful test harness.
2021-04-22 18:54:19 -04:00
Kevin Gorham c60119cd5a
Fix: Off-by-one error during rewind. 2021-04-22 18:47:58 -04:00
Kevin Gorham 5dd0df7619
Fix: change rewind behavior to correct for witnesses
Addresses SDK side of https://github.com/zcash/librustzcash/issues/373
2021-04-14 18:44:17 -04:00
Kevin Gorham e07317c7d5
Latest lib.rs 2021-04-14 15:00:45 -04:00
Kevin Gorham 22425d756e
Update project dependencies. 2021-04-09 22:30:24 -04:00
Kevin Gorham 160a95738f
New: Enable publishing single artifact to Maven Central. 2021-04-09 22:30:24 -04:00
Kevin Gorham 5133306c08
New: Add support for rewinding and wiping data.
A simple rewind feature in a wallet can recover from a wide variety of issues.
2021-04-09 22:30:24 -04:00
Kevin Gorham 1eb1a6aa8e
Fix: Improve error handling and surface critical Initialization errors. 2021-04-09 22:30:24 -04:00
Kevin Gorham dffb6f257f
Add new tests and cleanup old ones.
squash test cleanup


squash tests
2021-04-09 22:30:24 -04:00
Kevin Gorham 4a90e6bf24
New: Derive sapling activation height from network.
This type of change will allow dynamically switching networks within the app or unit tests, later.

fixup network change
2021-04-09 21:46:20 -04:00
Kevin Gorham af190e786b
New: Explicitly declare network when needed.
It is important to be very explicit about the network and not make any assumptions for ease of use because that resulted in numerous bugs while transitioning away from the old two library setup.

squash explicit network
2021-04-09 21:46:20 -04:00
Kevin Gorham 9dd9eef9ee
New: Consolidate product flavors.
Begin preparing for one build of the SDK, now that it is possible in librustzcash thanks to the data access api changes.
2021-04-09 19:58:29 -04:00
Kevin Gorham 278adfe0b9
New: Add getAccount. 2021-04-05 18:39:26 -04:00
Kevin Gorham 39972d8e43
New: Functionality to refresh UTXOs and updated taddr support. 2021-04-05 18:37:13 -04:00
Kevin Gorham 591df083b5
Update to the latest Rust code. 2021-04-01 17:51:47 -04:00
Kevin Gorham 553d28da7e
New: Add database migration to support autoshielding. 2021-04-01 02:26:38 -04:00
Kevin Gorham 04293f4f75
New: Add UnifiedViewingKey concept.
A unified viewing keys serves as a grouping of keys that are all related to the same account but do not have spend authority. This is most important when initializing the database for scanning.
2021-04-01 02:23:41 -04:00
Kevin Gorham ac9f803d5b
Refactor: Added type package.
In anticipation of UnifiedViewingKeys and, later, URI support as well as NU5 support for Unified Addresses.
2021-04-01 02:14:57 -04:00
Kevin Gorham 77b2ac5bae
New: Add logic for deleting UTXOs above a given height. 2021-03-31 09:36:46 -04:00
Kevin Gorham cde327a0f8
New: Expose transaction count. 2021-03-31 09:27:57 -04:00
Kevin Gorham ad5d4c4505
New: Update to the latest librustzcash crates. 2021-03-31 09:27:14 -04:00
Kevin Gorham 657fab680f
Add checkpoints for mainnet and testnet. 2021-03-31 09:22:18 -04:00
Kevin Gorham 79981f7ea2
Docs: Add placeholder for package documentation. 2021-03-31 09:16:31 -04:00
Kevin Gorham 997f6988a4
New: Add the ability to rewind and rescan blocks.
This one feature can fix lots of problems that wallets encounter and it is particularly useful for the 'Max Transaction' bug. See this iOS issue for more details: https://github.com/zcash/ZcashLightClientKit/issues/255
2021-03-31 09:16:06 -04:00
Kevin Gorham ad1f2438fb
Docs: Update README to draw attention to the demo app. 2021-03-31 09:07:37 -04:00
Kevin Gorham a7b6d00cf7
New: Add scan metrics and callbacks for apps to measure performance. 2021-03-31 08:51:53 -04:00
Kevin Gorham 24b428e3d5
New: Improve birthday logic.
Previously, the wallet had to manage determining the best birthday but that logic has now been pulled down into the SDK. A wallet can safely skip all blocks prior to the first transaction so the birthday starts as an estimate, based on the checkpoint and then moves forward to the height of the first transaction. If a user starts a wallet but does not receive funds for a long while, their wallet will have a better birthday as a result of this change and that is a very common use case.
2021-03-31 08:47:04 -04:00
Kevin Gorham 1ac3685819
New: Expose isStarted property of the Synchronizer. 2021-03-31 08:37:12 -04:00
Kevin Gorham a4d2f373da
New: Only refresh subscribers when a new block is detected.
For sanity, we also trigger a refresh if it has been an abnormal amount of time since a block was mined.
2021-03-31 08:35:09 -04:00
Kevin Gorham b5fc8bc8a2
New: Begin troubleshooting shutdowns and stops that are not graceful.
Calling stop should cleanly exit the synchronizer. Instead, we are seeing lots of errors and crashes. This can be made better but the first step is to add some logs to help troubleshoot the problem.
2021-03-31 08:30:51 -04:00
Kevin Gorham c761071d6f
New: Warn about potential testnet v mainnet database contamination. 2021-03-31 08:22:46 -04:00