Commit Graph

16 Commits

Author SHA1 Message Date
Carter Jernigan 49fdb6df0c [#936] Androidx updates 2023-03-09 12:58:18 -05:00
Carter Jernigan 1c76ea6998 [#880] Create sdk-incubator-lib
Add dependency link between lib and incubator

Make AndroidApiVersion internal in SDK
2023-02-09 15:44:22 -05:00
Carter Jernigan c0a2c11418
[#615] Refactor lightwalletd client
* [#615] Refactor lightwalletd client

This moves the lightwalletd client code to a separate Gradle module, but does not yet do much clean up the public API (e.g. hiding generated GRPC objects).  That will be a followon change via #673

I’ve prototyped a safer version of the API that would be implemented for #673 for two specific calls: obtaining the current block height and obtaining the light wallet info.  These were the easiest endpoints to update and they provide a useful exploration for the future changes needed.

* Fix benchmarking for networking module

- Moved to fixture and build type check components to the new networking module, so it's accessible from all needed parts of the projects
- Changed fixture return type to fit to all needed usages

* Align with previous review comment

* Fix wrong merge

* Add basic sanity test

- To satisfy tests requirements on emulators.wtf service

* Remove grpc dependency from sdk-lib module

* Repackage cash.z.wallet.sdk.rpc to cash.z.wallet.sdk.internal.rpc

* Fix BuildConfig path

* Update demo-app paths to rpc

* Fix broken grpc services locations

- Our aim here is to change only the local services location (package name), the server location can't be changed due to backward compatibility.

* Enhance GRPC Response model

* Adopt enhanced GRPC response model

- Adopted in a few endpoints

* Enhance Connection failure type

* Add simple fixture test

* Refactor fetchTransaction() to work with Response

- Refactored this server call to adopt our new Response mechanism
- GrpsStatusResolver.resolveFailureFromStatus() now accepts Throwable input
- Added Response.Failure.toThrowable() to satisfy subsequent server calls results processing
- A few other minor refactoring changes

* Remove commented out log

* Unify return type of collection returning methods

- Switched fetchUtxos() to return Sequence instead of List
- Added a check on empty tAddress input

* fetchUtxos returns flow

- Switched fetchUtxos() to return Flow of Service.GetAddressUtxosReply
- Internally it calls getAddressUtxosStream() instead of getAddressUtxos() from GRPC layer

* Update unsafe suffix documentation

* Address several minor change requests

* Remove code parameter

- Removed from the locally triggered failures with default codes.

* Rename local variable

* Switch from empty response to exception

- Our server calls now rather throw IllegalArgumentException than return an empty response
- Removed commented out log message
- Updated javadocs

* Update proto files

- Plus related api changes adoption

* Unify new clients instances name

* AGP 7.4.0 changes

-  packagingOptions -> androidComponents in sdk-lib and lightwallet-client-lib modules

* SDK version bump

* Response resolver tests

* Release build upload timeout increase

* Release build upload timeout increase fix

* Revert timeout

- As Github has some infrastructure troubles and we need to wait

* Add migrations documentation

* Sort packaging filters

* Remove private field from public documentation

* Hide private variables

* Remove package from Android Manifest

* Throw exception instead of custom error

- This step unify our approach to validation on client side across all server calls

* Replace setAddresses index const with number

* Fix indentation in proto file

---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-02-01 11:14:55 +01:00
Carter Jernigan e95e43b83b Add simple tests for Account and UnifiedSpendingKey
test
2022-10-06 14:49:04 -04:00
Carter Jernigan 5f40d7a14e [#344] Minimize threads; reduce risk of SQLite issues
While there are a lot of changes, the most significant are:
 - Update the main entrypoint of the SDK to use a suspending function and eliminate lazy initialization.  This also resolves #310
 - Changing Dao methods to `suspend`, allowing Room to implicitly manage the threading model under the hood
 - Explicitly set the executor thread for the `CompactBlockDb` and `DerivedDataDb`, which is the same thread used when calling into the Rust native library.  Room will then use this thread for `suspend` fun calls into it
 - With the above set, remove unnecessary hops to Dispatchers.IO which is a thread pool
 - Eliminate lazy initialization in `PagedTransactionRepository` to make it easier to reason about the threading model and resolve #355 where the database was being touched from the UI thread

Note that `PendingTransactionsDb` is not opted into this single-threaded approach, because that database is not shared with the Rust code
2022-01-19 15:27:30 -05:00
Carter Jernigan 108fe249d9 Update gitignore 2021-11-18 06:46:58 -05:00
Kevin Gorham 8885a3e306
Update Cargo and SDK version 2021-04-22 18:56:52 -04:00
Kevin Gorham fca75169c4
Update and improve build files. 2020-09-25 09:56:45 -04:00
Kevin Gorham 2132bc14fd Fix bugs 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
Jack Grigg 3188cf8942
Remove now-unused ValueReceived protobuf 2019-01-31 16:09:37 +00:00
Kevin Gorham 56154ee506
Update build-ndk-standalone scripts.
Previous version did a bad job of recognizing an incorrect config file.
This makes it a bit better. It also removes the need for a config in the
parent directory.

Co-authored-by: Jack Grigg <jack@z.cash>
2018-12-01 01:47:55 +00:00
Jack Grigg 7bc3f2eede
Generate Rust protobuf representing received value 2018-12-01 01:46:35 +00:00
Jack Grigg 05e6ab8133
Add target/ to ignores (for e.g. RLS data) 2018-11-21 13:51:16 +00:00
Kevin Gorham 4fe155ac20 completely ignore intellij files for now 2018-11-21 02:03:35 -05:00
Kevin Gorham 32af4b9559 initial commit of sample project code
The next step is to clean this up and integrate it with the latest version of the android app
2018-11-20 12:59:08 -05:00