Commit Graph

35 Commits

Author SHA1 Message Date
Carter Jernigan 640a72434c Android Gradle Plugin 8.0.1 2023-05-18 07:54:40 -04:00
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
Carter Jernigan 953042e982
[#239] Remove pending transaction database 2023-05-05 17:46:07 -04:00
Carter Jernigan afba5b74a6 [#880] Refactor publishing into convention plugin 2023-02-09 15:44:22 -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 3a4ea7eefd [#907] Remove Guava dependency 2023-02-06 09:51:47 -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
Honza Rychnovsky 97c0628798
[#789] Benchmarking Demo-app
* [#789] Add Benchmark module to Demo-app

* Code cleanup

* Opti-in experimental coroutines api in tests

* Add Testing documentation

* Documentation update + ktlint

* Check screen on and keyguard unlocked in each test

* Introduce UiAutomator extensions

* Enhance BenchmarkTrace events definition

* Remove unnecessary mutex

* Change blocks range

* Increase sync blockchain timeout

- To always fit in the Balances screen timeout for the selected blocks range

* Remove unnecessary fun suspend modifiers

* Macrobenchmark lib bump to 1.2.0-alpha8

* Remove duplicate label attr in app/manifest

* File and link benchmark on CI task

* Add proguard keep rules

* Documentation update
2022-12-13 14:25:09 +01: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 e95e43b83b Add simple tests for Account and UnifiedSpendingKey
test
2022-10-06 14:49:04 -04:00
Carter Jernigan 0873ae73e1 [#711] Android Gradle Plugin 7.3 2022-09-22 16:06:00 -04:00
Honza Rychnovsky 1fae5beab6
[#509] Remove OkHttp and Okio dependencies
* [#509] Remove OkHttp and Okio dependencies
- Okio -> Java NIO anf OkHttp -> HttpURLConnection in SaplingParamTool class
- Both replaced also in the test packages
- Removed dependencies to the replaced components
- Again switched a few assertions from JUnit to kotlin.test
- Created readLinesInFlow() function which is now reused in few places and runs without OkHttp
- Added subsequent TODOs to code base
- Wrapped to withContext to move it to an IO thread.
- Added use function on the stream and close() at the end of the channels use.
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-25 14:36:57 +02:00
Honza Rychnovsky 345af7aacc
[#366] Fix Detekt warnings
* Disable baseline file. Too many functions.
* CurrencyFormatter.kt suppress too many functions
* PersistentTransactionManager.kt suppress too many functions
* OutboundTransactionManager suppress too many functions
* Suppress long parameter list
* Too many functions
* Add log to avoid empty block warning
* Fix several magic number warnings
* Solve max line length warnings
* Solve max line length warnings
* Suppress too long method warnings
* Suppress too complex method warnings
* Suppress large class warning
* Fixed empty catch block
* Changed directory path to the file
* Fix too generic and swallowed exception
* Fix print stack trace warning
* Suppressed single top level file name declaration
* Change parameters name
* Suppress Spread operator warning
* Remove unused private code
* Add Locale to suppress default locale used warning
* Solve several forbidden TODOs warnings
* Fixed another max line length warning
* Simplify return statement
* Suppress class to object change
* Make DemoConstants variables const
* Use error() instead of throwing an IllegalStateException
* Solve too complex condition
* Suppress intentionally generic and swallowed exception
* Suppress TooGenericExceptionCaught
* Solve or suppress several TooGenericExceptionCaught
* Fix swallowed exception
* Suppress warning TooGenericExceptionCaught of PersistentTransactionManager
* Suppress warning TooGenericExceptionCaught of WalletTransactionEncoder
* Suppress TooGenericExceptionCaught of SdkSynchronizer
* Suppress TooGenericExceptionCaught in SaplingParamTool
* Suppress TooGenericExceptionCaught in CompactBlockDownloader
* Suppress TooGenericExceptionCaught in CheckpointTool
* Fix TooGenericExceptionCaught in WalletService
* Suppress TooGenericExceptionCaught in DerivedDataDb
* Suppress TooGenericExceptionCaught in CompactBlockProcessor
* Apply ktlint format after all the previous changes
* Remove detekt baseline file
* Set Android studio right margin
* Address comments from review
* Suppress failing tests on CI
2022-08-23 15:49:00 +02:00
Honza Rychnovsky 150778f008
[#367] Fix Kotlin compiler warnings
* Fix missing room schema export directory
* Fix returned unused fields from cursor
* Fix missing db column index
* Improved TODO. Added suppress warning
* Changed parameters name to correspond to their supertype
* Changed type to Kotlin variant
* Use priority parameter
* Unified parameter names
* Suppress unchecked type warning
* Removed inline function
* Suppress obsolete coroutine warnings
* Improve previous commit
* Fix unnecessary safe call warning
* Remove unused parameter
* Unreachable code
* toLowerCase where possible
* Changed parameter name
* Suppress several "unused" warnings
* Fixed fromHtml() deprecation
* Suppress intentionally unused parameter warning
* Remove redundant initializer
* Remove inline function
* Suppress intentionally used deprecated code
* Unreachable code
* Suppress obsolete coroutine warnings
* Suppress intentionally unused parameter
* Remove unused expression
* Supertype parameter name
* Warnings of GetBlockRangeFragment.kt
* Deprecated onActivityCreated
* Suppress obsolete coroutine/flow warnings
* Unnecessary null check
* Suppress intentionally unused parameter
* Suppress intentionally unused parameters
* Deprecated onActivityCreated
* Predetermined type
* ListUtxosFragment clean code
* Suppress intentionally unused parameter
* Lint checks warnings fix
* Add data db migration
* Enable treating Kotlin compiler warnings as errors
* Solve several darkside-test-lib tests warnings
* Solve several demo-app tests warnings
* Solve several sdk-lib tests warnings
* Ktlint check result fix
* Remove parentheses now that Synchronizer is not cast
* Remove wildcard imports for java.util
* Revert "Add data db migration"
* Revert "Fix missing db column index"
* Suppress missing indexes on data db entities

Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-17 15:48:02 +02: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 823e8387cb
[#477] Typesafe Zatoshi APIs for amounts 2022-06-21 19:34:42 -04:00
Carter Jernigan a5a07becd8
[#548] Configure testing with emulator.wtf 2022-06-21 07:57:04 -04:00
Carter Jernigan 17c09908a8 [#421] Maven Publish 0.20.0 2022-06-16 08:11:46 -04:00
Carter Jernigan 5ec79cc20d [#512] Android Gradle Plugin 7.2.1 2022-06-16 08:11:46 -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 6496d717b9 [#543] Align gradle properties for included builds 2022-06-07 07:07:30 -04:00
Carter Jernigan 7d8182d5be [#476] GRPC 1.46.0 2022-05-09 09:38:31 -04:00
Carter Jernigan 3aa0543305 Fix snapshot publishing 2022-03-21 19:04:40 -04:00
Carter Jernigan 0da0802e2a Fix version name for snapshot releases 2022-02-03 11:07:11 -05:00
Carter Jernigan 1ab79286f4 [#374] Android Gradle Plugin 7.1 2022-02-02 14:22:55 -05:00
Carter Jernigan 3c575a497c Configure build with GitHub Actions
Also configure testing with Firebase Test Lab
2022-01-26 15:19:28 -05:00
Carter Jernigan 6c8ac20655 [#358] Snapshot publishing 2022-01-19 17:00:58 -05:00
Carter Jernigan eb728fe3d8 [#330] Use KSP for annotation processing
This resolves issues with included builds
2022-01-06 06:59:40 -05:00
Carter Jernigan 4994718549
[#302] Add ProGuard consumer rules
This allows consumers of the SDK to use ProGuard without breaking the SDK
2021-11-22 10:14:21 -05:00
Carter Jernigan b4213f3e48 [#290] Delete `targets` directory during clean 2021-09-30 07:45:36 -04:00
Carter Jernigan 4923b5fd12 [#291] Fix rust build tasks
This resolves a regression introduced in the implementation of issue #251.
2021-09-30 07:27:07 -04:00
Carter Jernigan dfe7dad834 [#256] Use Gradle Version Catalog for dependencies 2021-09-25 12:54:42 -04:00
Carter Jernigan 07d02e6cea [#285] Implement gradle build conventions
In addition to using build-conventions to make the build scripts more DRY, the following additional changes are included in this commit:

- Convert build scripts to kts
- Fix a double-build issue with the SDK
- Add configurable options for treating compiler warnings as errors (disabled for now, due to extensive warnings that need to be corrected first)
- Added detekt as an additional static analysis tool
2021-09-25 12:54:42 -04:00