Commit Graph

85 Commits

Author SHA1 Message Date
Kevin Gorham e7ec713d5f
New: Improve the "unprepared" error message.
Previously, it made it seem like the developer needed to call "prepare." And that was the case but now it's more common to trigger this error by accessing transactions before the synchronizer has been started.
2021-06-30 02:29:32 -04:00
Kevin Gorham 1ac14c07c5
New: Convenience functions for WalletBalances.
Make it possible to add balances and get the pending balance, which are both common use cases.
2021-06-30 02:28:00 -04:00
Kevin Gorham ac03fd2358
Fix: Rely on List instead of PagedList for paged repository results. 2021-06-30 02:27:16 -04:00
Kevin Gorham 136b4b1bc2
Fix: Gracefully handle failures while fetching UTXOs
Also added temporary code to prevent a wallet from constantly checking for UTXOs on a server that simply does not have that feature enabled.
2021-06-30 02:25:40 -04:00
Kevin Gorham 6e3aacb08c
New: Clean up logs.
Added a priority to the twig module so that it is easy to exclude chatty logs, which is helpful for third party builds. The default logs are now a lot cleaner and more concise.
2021-06-30 02:24:24 -04:00
Kevin Gorham d5456f078d
Fix: Increase reconnection attempts when waking the app.
Based on recent logs, reconnecting seems to be the right thing to do so try it for longer and see if that helps.
2021-06-20 20:48:58 -04:00
Kevin Gorham d8fec13896
Begin troubleshooting server disconnect errors. 2021-06-19 00:25:05 -04:00
Kevin Gorham d095e9359a
New: Add separate balances for sapling, transparent and orchard pools.
Note that the orchard one is just a placeholder for now.
2021-06-15 00:09:24 -04:00
Kevin Gorham a1a28cac82
Add documentation to recent code changes. 2021-06-07 00:18:25 -04:00
Kevin Gorham 467282d385
Clean up error logging. 2021-05-25 16:02:27 -04:00
Kevin Gorham 84ca57f432
Fix: Reconnect to lightwalletd when a service exception occurs.
This is a fairly frequent crash that occurs when devices return from the background and attempt to reuse a stale channel. In that situation, shutdown the stale channel and rebuild a new one.
2021-05-25 12:43:42 -04:00
Kevin Gorham 0c73f2b585
New: Expose network height as a StateFlow.
We already had latest height but that would require polling. Having a state flow makes it easier for views to be pushed the latest height.
2021-05-25 11:15:09 -04:00
Kevin Gorham 3fb12fc652
Fix: Removed variable that is no longer used.
Relying on this flag to change was causing new wallets to appear to fail. Although they work on the next launch, it is confusing for users and requires immediate attention.
2021-05-12 20:57:09 -04:00
Kevin Gorham 10561d6329
Fix: Make prepare function idempotent. 2021-05-07 17:31:32 -04:00
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 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 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 87afd7e55b
Fix: Better error message when address is not found. 2021-04-26 17:37:58 -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 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 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 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 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 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 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