Commit Graph

32 Commits

Author SHA1 Message Date
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 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
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
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 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 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 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