* [#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>
* [#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
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.
* [#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>
* 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
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.
This resolves several issues including:
- Updated checkpoints
- #550 Support for new checkpoint format with NU5
- #377 Removed explicit dependency on GSON
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