Commit Graph

183 Commits

Author SHA1 Message Date
Kevin Gorham 72283cee81 Cleanup Synchronizer API, add KDocs and remove dead code 2019-03-29 02:04:25 -04:00
Kevin Gorham 796fe9602c Update dependencies 2019-03-29 02:03:11 -04:00
Kevin Gorham af998e132d Promote diagrams from draft to final status 2019-03-27 02:09:25 -04:00
Kevin Gorham 359e5c0adc Clean up data API
Remove unused functionality and disable modification to tables that should only be written by librustzcash
2019-03-27 01:37:46 -04:00
Kevin Gorham e7108ca818 Cleanup
This commit will get iteratively polished until the PR is ready
- Addresses PR feedback https://github.com/zcash/zcash-android-wallet-sdk/pull/16#discussion_r264948336
2019-03-27 01:37:46 -04:00
Kevin Gorham b978bb5bc7 Update the logic for determining balance 2019-03-27 01:37:46 -04:00
Kevin Gorham 4aaf55f057 Add a layer of logic for bubbling up errors
This allows the app to show an error dialog rather than crashing silently
2019-03-27 01:37:46 -04:00
Kevin Gorham 17be0c85cb Improve logic and behavior during app startup.
Never start downloading blocks prior to sapling activation height, only allow firstrun when dataDb is empty and also add birthday support. Also added corrections to isFirstRun logic.
2019-03-27 01:37:46 -04:00
Kevin Gorham ef58fecbf1 Remove unused things and document limits of Junit 5 usage
It is not really practical to try and use JUnit 5 for Android Instrumentation tests at this time. See documentation in build.gradle for details.
2019-03-27 01:37:46 -04:00
Kevin Gorham 3efc91806a Prevent change from being returned in transaction queries 2019-03-27 01:37:46 -04:00
Kevin Gorham 0ed5731ff4 Add address information to notes query and other cleanup 2019-03-27 01:37:46 -04:00
Kevin Gorham 4cbdd2ab27 Add additional logging to mock synchronizer 2019-03-27 01:37:46 -04:00
Kevin Gorham 82918dc09f Twig: Refactor to be much more useful. 2019-03-27 01:37:46 -04:00
Kevin Gorham ecff3ce588 Add conversion logic and extensions for consistency and correctness
Working with bigdecimals anytime we need to multiply or divide values because it was causing issues when repeatedly toggling currency on the send screen. Coupled this with lots of improvements on the app side to do less processing while changing currencies
2019-03-27 01:37:46 -04:00
Kevin Gorham 2132bc14fd Fix bugs 2019-03-27 01:37:46 -04:00
Kevin Gorham 1b37784e44 Create mock synchronizer to help with driving the UI.
After experiencing several issues that make it more difficult to test send behavior, including the amount of time required to wait for blocks to get mined when testnet is slow,
it became obvious that it was time to investigate mocking. Most of the behavior in the SDK is driven by channels so the mock only has to focus on putting useful data in the
expected channels at the right time. One tradeoff here was the need to make all the synchronizer properties private, that way any implementation can achieve compatability
without necessasily leveraging the same combinations of building blocks. This tradeoff felt acceptable given that these dependencies can be injected and available as singletons,
if needed. This also had a side effect of elevating several channels into the Synchronizer interface, rather than reaching into the synchronizer to directly access those dependencies.
Another benefit is that it's now easier to see what matters most to the app, particularly which channels are essential.
2019-03-27 01:37:46 -04:00
Kevin Gorham bf7b3ee744 Iterate and refine send and active transaction behavior
Send is now functional and shows up in active transactions.
This involved:
- reducing the exposure of the seed
- consistently using Ints for blockheight everywhere to match zcash
- adding the use of spending keys
- adding account initialization on startup
- using accounts but defaulting to account 0
- internalizing birthday so we no longer need a reference outside of the library
- enabling cancellation during send
- cleanup active transaction manager
2019-03-27 01:37:46 -04:00
Kevin Gorham 888646f73b Create ActiveTransactionManager to monitor active transactions
When a transaction is sent it transitions through a lifecycle, beginning with creating the raw transaction and ending with it being mined and added to the blockchain
2019-03-27 01:37:46 -04:00
Kevin Gorham 4d226a8c5e Create CompactBlockProcessor and refine responsibilities of collaborators
The synchronizer now primarily collaborates with a downloader, processor and repository; each with a more focused set of responsibilities.
The downloader streams blocks into a channel, the processor saves blocks from that channel and scans for transactions, the repository
exposes transaction change events.
2019-03-27 01:37:46 -04:00
Kevin Gorham a871c5e476 Integrate with dataDb init commands and grpc service updates.
On the rust side, we now have access to the init DB commands. On the Go side we have time available for blocks
2019-03-27 01:37:46 -04:00
Kevin Gorham 57630f8eba Create CompactBlockDownloader, iterate on business logic using new JUnit5 setup
streaming is working and tests are functional
2019-03-27 01:37:46 -04:00
Kevin Gorham b688013f16 Switch to JUnit 5 2019-03-27 01:37:46 -04:00
Kevin Gorham 6c869a47df Create synchronizer and add layer of business logic onto the data layer
App is functional and displays transactions
2019-03-27 01:37:46 -04:00
Kevin Gorham 1501f1a7d2 Add data access layer for dataDb
Update the scanBlocks request and integrate with the data that it generates inside dataDb
2019-03-27 01:37:46 -04:00
Kevin Gorham a1f4491fba
Merge pull request #20 from zcash/docs/update-diagrams
Update README
2019-03-27 01:35:37 -04:00
Kevin Gorham 5ea910b7f0 Updated readme to further point to preview branch 2019-03-27 01:32:18 -04:00
Kevin Gorham 98a651019c Updated diagrams to reflect latest state of SDK
Also simplified the diagrams, making them clearer and polished by a Designer, rather than a product of Engineering. Now they are more visually appealing in addition to being more technically accurate.
2019-03-27 01:23:26 -04:00
Kevin Gorham 4261ae9efc Update README to reference preview branch 2019-03-19 11:51:11 -04:00
str4d db5abb889c
Merge pull request #15 from zcash/rust-updates
Rust updates
2019-03-13 20:04:07 +13:00
Jack Grigg 1474fae4b8
Move SQL backend into librustzcash
Also some tweaks due to error-handling changes in librustzcash.
2019-03-13 06:56:28 +00:00
Kevin Gorham b4afbaf0fc
Merge pull request #17 from zcash/docs/update-readme
Update README documentation
2019-03-13 02:39:27 -04:00
Kevin Gorham 2467ab2dfb Update readme to reflect latest behavior 2019-03-13 02:36:35 -04:00
Kevin Gorham cc41d0646b Added diagram for developer Point of View 2019-03-13 02:36:26 -04:00
Kevin Gorham 76bcc52b25 Initial explanation of the structure of the SDK 2019-03-13 02:28:21 -04:00
Kevin Gorham 8598fe5fd7 Add diagram to the README
Renamed data DB in overview diagram. Initially we expected this to only contain UI data but it was easier to have one database for everything that can be derived from a seed, rather than multiple databases segregated by sensitivity.
2019-03-13 02:27:59 -04:00
Kevin Gorham 245841807c add hex as required dependency, then use it inside init_blocks_table 2019-02-23 20:16:45 -05:00
Kevin Gorham 2c4a48b772 modify update_sapling_tree utility to output JSON 2019-02-22 10:04:32 -05:00
Kevin Gorham 148563b7e6 modify scan operation to start from sapling activation.
Rather than starting from zero because we do not need non-sapling blocks, prior to sapling's activation.
2019-02-22 10:04:32 -05:00
str4d 531df67856
Merge pull request #13 from zcash/spend-stability
Spend stability
2019-02-19 21:00:06 +00:00
Jack Grigg 870283c8ea
JniConverter.getVerifiedBalance() 2019-02-19 01:45:38 +00:00
Jack Grigg 2a091a1da1
crate::sql::get_verified_balance() 2019-02-19 01:39:36 +00:00
Jack Grigg 4c901fc21f
Exclude spendable notes from selection that aren't verified 2019-02-19 01:25:25 +00:00
Jack Grigg 2695e8f6fd
Mark notes as unspent when the transaction they are spent in expires 2019-02-19 00:59:09 +00:00
Jack Grigg 273881c3b6
Re-introduce requirement that scanned blocks are height-sequential
This prevents the data DB from getting into a state where the Sapling
commitment tree is invalid, which was occurring too easily in testing.
2019-02-18 12:47:16 +00:00
Jack Grigg d145091139
Debug logging in note selection 2019-02-18 12:31:57 +00:00
Jack Grigg 1cd1a4d2f1
Lock notes after transaction creation to prevent serial double-spends
Does not prevent parallel double-spends.
2019-02-18 12:27:14 +00:00
Jack Grigg 208a9497dd
Ensure we always select anchors from blocks that we have 2019-02-18 11:55:34 +00:00
str4d d415cf4558
Merge pull request #12 from zcash/witness-updating
Fix witness-updating bug, and enforce witness validity
2019-02-14 15:01:00 -05:00
Jack Grigg b95f0b1fc9
Fix witness-updating bug, and enforce witness validity 2019-02-14 19:47:18 +00:00
str4d 262a29ca5f
Merge pull request #11 from zcash/spend-improvements
Spend improvements
2019-02-13 05:24:39 -05:00