Commit Graph

81 Commits

Author SHA1 Message Date
Carter Jernigan bc19797125
[#971] Refactor Rust FFI to separate module
---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-05-18 07:36:15 -04:00
Honza Rychnovsky dfaa827fd1
[#1013] Sync stages parallelization
* [#1013] Sync blockchain sub-phases parallelization

- Remove the unnecessary comment after the latest changes in this code fragment

* Move solely CompactBlockProcessor-related constants

* Simplify sync range update construction

* [#1013] Sync blockchain sub-phases parallelization

* Changelog update

* Block files deletion documentation update

* Leverage buildList API

* CompactBlockRepository documentation update

* Move BlockBatch to internal models
2023-05-10 12:45:23 +02:00
Carter Jernigan 953042e982
[#239] Remove pending transaction database 2023-05-05 17:46:07 -04:00
Carter Jernigan fef809c015 [#978] Eliminate sent/received transaction APIs 2023-04-17 08:24:41 -04:00
Honza Rychnovsky 9a816ee25f
[#674] Use suspending functions for networking
* [#674] Use suspending functions for networking

- Initial commit to set up how we transform to the coroutine version of networking client

* Enhance flow filter

* Switch to coroutine client in a few tests too

* Use StatusException

* Comment out old UI demo app cases

* Switch client in a few tests

* Switch client for download block case

* Remove the blocking networking client entirely

* Link fetch UTXOs issue

* Refactor refresh and process UTXOs

* Improve downloadBlockRange logging

* Remove CompactBlockRepository.write(sequence)

* Remove “Coroutine” prefix

Since we only have a single implementation, the designation shouldn’t matter anymore

* Fix collection bug

* Finish network client renaming

* Collect write results internally

* Write method simplification

* Blocks sync logging reduce

* Unused unsafe models remove

---------

Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2023-04-13 13:36:24 +02:00
Carter Jernigan d513ac6559 [#972] Min API 27 2023-04-13 06:29:42 -04:00
Carter Jernigan 0930b6a32d Update version to 1.15.0 2023-04-11 07:42:31 -04:00
Francisco Gindre c7914d9584
[#904] Fetch all UXTOs per account
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
2023-03-09 17:07:59 -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 8df7a5d3ec
[#917] Min API 24
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-02-09 06:52:10 -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 4ad1da49d0
[#886] Support null block heights
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-01-12 11:32:43 -05:00
Carter Jernigan 01da937fdc
[#861] Remove cancel spend from public API 2023-01-09 11:55:30 -05:00
Honza Rychnovsky a77f3a629c
[#820] Kotlin 1.7.21 + KSP 1.7.21
* [#820] Kotlin 1.7.21 + KSP 1.7.21

* Re-generate locks after merge

* Update Changelog
2022-12-16 14:11:09 +01:00
Carter Jernigan 2ab6d038ed
[#742] Prevent multiple synchronizer instances
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2022-12-14 10:33:18 -05:00
Carter Jernigan d9a0e98dc0 [#811] Eliminate suspending function for sending/shielding 2022-12-12 07:34:07 -05:00
Carter Jernigan b288b8cad9 Rename Synchronizer.getAddress APIs 2022-11-08 14:25:56 -05:00
Carter Jernigan d1e9b28c91 [#771] Update documentation for SDK 1.10.0 2022-11-08 09:32:07 -05:00
Jack Grigg 5ad0efcbea Remove `DerivationTool` APIs for deriving transparent keys and addresses
Users should use the UnifiedAddress etc. APIs instead.
2022-11-07 15:19:19 -05:00
Carter Jernigan 61f1c1a9cb
[#753] Add API for querying recipients 2022-10-31 15:27:34 -04:00
Carter Jernigan f169b112ef [#743] Add API for reading memos 2022-10-24 11:54:57 -04:00
Carter Jernigan 4c2807aefd
[#705] Roomoval
The Android and Rust code have previously managed joint custody of the derived data database.  With more complex migrations now required, we need to make the Android side read-only.  To achieve that, the Android side will remove Room and instead rely on more primitive SQLite APIs for read-only access.

As part of implementing this change, database management throughout the SDK is being refactored.

There will be multiple representations of the data:
 - Database representation (and some Entity representations in the places that Room hasn’t been removed yet).  These representations are not as type safe and don’t match Kotlin best practices in all cases.
 - Once #615 is implemented there will also be network representations
 - Type safe models, which often appear in the public API  The Database and Network representations will be converted to and from the type safe model representation.
2022-10-19 16:52:54 -04:00
Carter Jernigan f2effc8dd2 Merge branch 'main' of github.com:zcash/zcash-android-wallet-sdk into merge-main
# Conflicts:
#	CHANGELOG.md
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/ext/TestExtensions.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/integration/SanityTest.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/integration/SmokeTest.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/util/AddressGeneratorUtil.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/util/BalancePrinterUtil.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/Initializer.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/SdkSynchronizer.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/Synchronizer.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/transaction/WalletTransactionEncoder.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/jni/RustBackendWelding.kt
2022-10-18 07:28:12 -04:00
Carter Jernigan 4c2fdeeb73 Add Account type 2022-10-06 14:49:04 -04:00
Jack Grigg 88bbd0afcb Use the binary USK format for transaction creation
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-10-06 14:49:04 -04:00
Carter Jernigan 597cc43886 Replace `Synchronizer.getAddress()` with `Synchronizer.getCurrentAddress()`
The SDK now exposes UAs primarily, with additional methods for obtaining
corresponding Sapling and transparent addresses for legacy compatibility.

The `Account` DAO is also fixed to use the migrated `accounts` table format.

The demo app now shows the current UA and the legacy Sapling and transparent
addresses.

Closes zcash/zcash-android-wallet-sdk#677.
2022-10-06 14:49:04 -04:00
Jack Grigg f69cacb9e6 Add `SdkSynchronizer.createAccount()` method
It is currently hidden from the public API, implemented for testing
purposes.
2022-10-06 14:49:04 -04:00
Jack Grigg c6fd783317 Add a `seed` argument to `Synchronizer.Companion.new`
This enables callers to recover from an error that indicates the seed
is needed for a database migration.
2022-10-06 14:49:04 -04:00
Honza Rychnovsky 9614a63f89
[#706] Fix crashes identified by robo tests
* [#706] Fix crashes identified by robo tests

- Removed unused xml layouts
- Fixed several xml attributes to be backward compatible

* Reduce number of unnecessary logs in console

* Bump min Android SDK version from 19 to 21

* Bump demo-app minSdk to version 21 too

* Update changelog

Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-10-04 16:27:09 +02:00
Honza Rychnovsky 35e38ddb19
[#666] Download sapling files atomically (#707)
- Enhanced implementation of SaplingParamTool component. It got sapling files move from legacy folder to the preferred one functionality. It downloads the sapling files atomically now (through the temporary file names). It contains all related constants now. It works with SaplingParamToolProperties, which allows us to easily test the SaplingParamTool functionalities. It also now checks file hashes. Removed unnecessary clear function from the component. Changed valid function.
- Moved related constants from ZcashSdk class to SaplingParamTool class
- Changed Initializer, WalletTransactionEncoder and RustBackend classes to work with File instead of path String
- Minor changes in comments in other classes
- Added getSha1Hash() extension function to the FileExt class

* Related tests

- Two new test fixtures to simplify our tests
- Test for getSha1Hash() extension function
- Minor changes in existing tests
- Created new SaplingParamToolBasicTest, which covers non-integration functionality of SaplingParamTool
- Moved integration tests of the SaplingParamTool to the new SaplingParamToolIntegrationTest and added some new

* Related manual tests

- Created Download sapling files manual test
- Created Move sapling files to no_backup manual test
- Update existing Move database files to no_bakcup manual test


Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-09-06 06:44:33 -04:00
Jack Grigg 609cc861e9 Merge tag 'v1.9.0-beta03' into merge-1.9.0-beta03 2022-08-22 21:23:43 +01:00
Jack Grigg 85e9adce14 [#526] Migrate to `zcash_primitives 0.6` 2022-08-22 20:57:41 +01:00
Jack Grigg 46af668449 [#525] Add `AddressType.Unified` and `Synchronizer.isValidUnifiedAddr` 2022-08-22 20:57:41 +01:00
Jack Grigg cfdd3640a9 [#525] Derive transparent account privkey instead of transparent secret key
We need the transparent account privkey in order to be able to derive
the secret key for any leaf transparent address under the ZIP 316
diversified address tree.
2022-08-22 20:57:41 +01:00
Carter Jernigan f7c9bad367 [#525] Replace UnifiedViewingKey with UnifiedFullViewingKey
UnifiedViewingKey had a bug that made it incompatible with ZIP 316.

For compatibility with the current `zcash/librustzcash` revision we use
a temporary fake UFVK encoding that stores sufficient information to use
the current APIs, and a superset of the actual ZIP 316 FVK information.
2022-08-22 20:57:41 +01:00
Carter Jernigan 10d0652a8d
[#252] Replace third party publishing Gradle plugin
The third party plugin that we’ve used for publishing has introduced multiple breaking changes recently.

By migrating to more standard Gradle publishing APIs, the deployment process is more explicit for those unfamiliar with Gradle.  It also will simplify some upcoming changes to modularize this SDK project.
2022-08-16 08:53:23 -04:00
Honza Rychnovsky c721a5e24e
[#343] Store database files in no_backup folder
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-12 11:05:00 -04:00
Carter Jernigan e01a906407
[#593] Refactor ZcashNetwork
Splits the ZcashNetwork and Lightwalletd server information, making it easier to configure different servers
2022-08-02 09:29:09 -04:00
Carter Jernigan 421f932bd5 Update changelog for 1.8 release 2022-07-28 17:07:02 -04:00
Carter Jernigan a6c223aaa5 Update changelog for version 1.7 2022-07-07 13:45:03 -04:00
Carter Jernigan 4f61a52b6e [#484] Kotlin 1.7.0 2022-06-30 09:32:04 -04:00
Carter Jernigan 823e8387cb
[#477] Typesafe Zatoshi APIs for amounts 2022-06-21 19:34:42 -04:00
Carter Jernigan 971c65a520 [#549] Update checkpoints
This resolves several issues including:
 - Updated checkpoints
 - #550 Support for new checkpoint format with NU5
 - #377 Removed explicit dependency on GSON
2022-06-14 13:42:46 -04:00
Carter Jernigan 9388d5c087 [#537] Prevent R8 warnings for OkHttp 2022-06-06 15:15:42 -04:00
Honza Rychnovsky 8f59a207fb
[#539] SDK causes crash on emulators with x86_64 architecture
* [#539] SDK causes crash on emulators with x86_64 architecture
- NDK version reverted back to 22.1.7171670.
- Attached TODO with issue for future handling of the problem.
- Install specific Android NDK version.
- Update changelog.
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-06-03 14:38:38 +02:00
Carter Jernigan 18d82ed90c [#523] Prepare for next release 2022-06-03 07:02:41 -04:00
Jack Grigg fddb5c3990 Migrate to `zcash/librustzcash` revision with v5 tx parsing
This doesn't affect Sapling note detection (which uses Compact Blocks),
but enables the enhancement logic to decrypt and store the corresponding
transactions for displaying memo fields.
2022-05-25 05:45:43 -04:00
str4d f8b3c0926c
[#524] Migrate to `zcash/librustzcash` revision with NU5 awareness
This enables mobile wallets to send transactions after NU5 activation.
The wallets will however still not support receiving v5 transactions.
2022-05-19 15:41:34 -04:00
Carter Jernigan a9245f2d67 [#502] Prepare 1.4.0-beta01 release 2022-05-09 09:57:33 -04:00
Carter Jernigan b2e66e6287 [#493] Kotlin 1.6.21 2022-04-29 15:33:53 -04:00