Commit Graph

67 Commits

Author SHA1 Message Date
Kevin Gorham f89d2be250
SDK changes to support new demo app.
- Convert status flags into stream of statuses, instead.
- Improve logging during transaction submission
- Database corrections. Aparently Room has gotten more strict with schema parsing and this required lots of corrections mainly around get nullability correct for DB fields.
- Simplify Synchronizer creation via constructor functions. Created one function for maximum simplicity and another for maximum flexibility.
- Changed logic for Wallet initialization to simplify dependencies and allow for optional access to private keys for wallet apps
- Created TransactionRepository that leverages the paging library for Room
- Provided sample implementation of bridging to a key manager in a way where wallet apps do not have to modify their existing code.
- Made it easier to clear the wallet data that can be repopulated from the blockchain
- Allowed for better cleanup of heavy-weight lightwalletd services by adding a shutdown API call
2019-10-24 01:16:58 -04:00
Kevin Gorham 190f7f5548
Consolidate old sample apps into new demo app. 2019-10-24 01:16:58 -04:00
Kevin Gorham 42f29f534c
Reduce configurability per Security Finding 1.
These changes largely reduce the amount of configuration that can be tweaked in order to prevent fragmentation of the anonymity set of users. If wallet makers change certain properties than it can become easy to detect which network requests are coming from which client. The goal is for clients to be as anonymous as possible.
2019-09-26 12:58:37 -04:00
Kevin Gorham 1f18042d52
Implement versioning and other cleanup.
- Correct typo and compiler warning in Rust.
'trait objects without an explicity dyn' are deprecated and this is a warning as of Rust 1.37
- update dependencies
- update documentation

docs
2019-09-12 01:31:23 -04:00
Kevin Gorham 636cbb59c0
Add TLS support.
Make TLS the default and require effort to setup plaintext connections, instead.
2019-09-12 01:31:22 -04:00
Kevin Gorham a83ace6e43 Refactor after Zcon1 2019-08-30 10:07:56 -04:00
Kevin Gorham 8c7103d0ee Cleanup after Zcon1. 2019-08-30 10:07:56 -04:00
Kevin Gorham 862a4be480 Pulled over classes from Zcon1 app.
Next step is to refactor and simplify.
2019-08-30 10:07:56 -04:00
Kevin Gorham ad3a080466 Restore the memo sample to working order. 2019-08-30 10:07:56 -04:00
Kevin Gorham 178f1d3a8d Add support for raw transaction id.
This helps with mapping transactions when sweeping wallets.
2019-08-30 10:07:56 -04:00
Kevin Gorham 4dd8d408cb Beginning to improve the use of channels.
Bringing over lessons learned from the Zcon1 app. There are a lot of changes to make, this is just the beginning of what was necessary to support that app.
2019-08-30 10:07:56 -04:00
Kevin Gorham f222bde2fa More robust error handling. 2019-08-30 10:07:56 -04:00
Kevin Gorham 305390b439 Update tests. 2019-08-30 09:59:29 -04:00
Kevin Gorham 94e2af7287 Improve error handling and troubleshooting by surfacing more errors. 2019-08-30 09:59:29 -04:00
Kevin Gorham a78c98b8aa Add more support for memos. 2019-08-30 09:59:29 -04:00
Kevin Gorham 4c635362a8 Add logic for handling reorgs and simplify synchronization. 2019-08-30 09:59:29 -04:00
Kevin Gorham b14401eaeb Twig: Add timing features and prevent duplicate tags. 2019-08-30 09:59:29 -04:00
Jack Grigg 1acf472d33
RustBackend.isValid[Shielded|Transparent]Address() 2019-07-10 14:54:39 -04:00
Kevin Gorham c3f57d5e2f
Rename JniConverter to RustBackend
Turns out JNI classes are hard to mock due to the way sytem libraries
are loaded. So it became easier to put the JniConverter class behind an
interface. Once that refactor was necessary, it was a good time to
update the name of this class because it retained its original PoC name
for far too long.
2019-05-24 16:33:43 +01:00
Jack Grigg 4948617d6d
Add JNI methods for handling chain validity and reorgs 2019-05-14 17:30:09 +01:00
Kevin Gorham 7ec61df4a9 Changes to support memo sample
Mostly includes convenience functions for determining balance.
2019-04-24 03:16:15 -04:00
Kevin Gorham 30d36b723e
Improve logging behavior.
This simplifies the process of constructing an SdkSynchronizer.
2019-04-24 02:43:33 -04:00
Kevin Gorham 01b1ca1fed Add KDocs to Synchronizer implementations and tidy their code 2019-03-30 00:20:32 -04:00
Kevin Gorham 7265a793c4 Restore tests to compiling 2019-03-29 02:05:45 -04:00
Kevin Gorham 72283cee81 Cleanup Synchronizer API, add KDocs and remove dead code 2019-03-29 02:04: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 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 245841807c add hex as required dependency, then use it inside init_blocks_table 2019-02-23 20:16:45 -05:00
Jack Grigg 870283c8ea
JniConverter.getVerifiedBalance() 2019-02-19 01:45:38 +00:00
Jack Grigg b78a611f7b
JNI APIs to fetch memo fields as UTF8 2019-02-08 21:06:25 +00:00
Kevin Gorham 66fff55967 bugfix: update JNI method signature to match implementation.
We removed the need to pass the seed around because that is highly sensitive data. Instead, we work with less sensitive sending keys.
2019-02-05 11:24:40 -05:00
Jack Grigg 62b4d43341
Remove seed argument from JniConverter.getAddress(), add account arg 2019-02-01 21:57:13 +00:00