Commit Graph

271 Commits

Author SHA1 Message Date
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 2b469b53a6 [#661] Update checkpoints 2022-08-12 06:55:46 -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 1f35e37a5e [#628] Fix off-by-one download blocks
This should yield approximatly a 10% performance improvement, as it prevents downloading duplicate blocks.
2022-07-28 17:06:34 -04:00
Carter Jernigan 3535ba905e [#629] Stream blocks during download
This change leverages the gRPC streaming API along with the elimination of bulk inserts to SQLite to reduce the amount of memory required to write blocks.
2022-07-28 15:49:46 -04:00
Carter Jernigan 98e22f6029 [#625] Reduce block batch size to fix OOM 2022-07-26 11:25:09 -04:00
Carter Jernigan 8e3c4a636f [#610] Fix block download regression
This includes a few different fixes that prevented the demo app and other SDK consumers from working.

First, initialization of the demo app was fixed to use the sapling activation height rather than the current latest checkpoint.

Second, CompactBlockProcessor wasn’t downloading blocks.

Third, a few potential thread safety issues were resolved by making fields that are accessed by multiple threads volatile.
2022-07-26 08:46:53 -04:00
Carter Jernigan b53b09d40d [#622] Update checkpoints 2022-07-26 08:09:57 -04:00
Carter Jernigan 1135353a84
[#606] Fix BlockHeight read from CompactBlockStore 2022-07-15 07:09:00 -04:00
Carter Jernigan 9b666833b1
[#474] Add type safe BlockHeight API
- Replace int with type safe BlockHeight(Long) object
 - Fix down casting bug, as BlockHeight is uint32 but Java only supports int32 or int64
 - Rename WalletBirthday to Checkpoint and hide from the public API
2022-07-12 08:40:09 -04:00
Carter Jernigan 6728852b28 [#596] Update checkpoints 2022-07-07 13:45:03 -04:00
Carter Jernigan 6764f7baf8 [#595] Make Zatoshi comparable 2022-07-07 13:45:03 -04:00
Carter Jernigan a1cc8f0b69 [#477] Fixes for Zatoshi object 2022-07-07 13:45:03 -04:00
Carter Jernigan 3fa7a98fbf [#580] ktlint 0.46.1
Update baseline
2022-06-27 08:42:37 -04:00
Francisco Gindre bd2061956b
[#585] Add checkpoints for Orchard Activation Height (#586)
* [#585] Add checkpoints for Orchard Activation Height

Closes #585

these checkpoints will be useful for wallets supporting orchard
that had existing orchard activity from activation height on and
after NU5 SDK support is implemented they need to rescan for orchard
funds.

* Add documentation on special checkpoints

Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-06-24 14:27:07 -03: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 016df9a623 [#271] Namespace checkpoint assets 2022-06-14 13:42: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 9388d5c087 [#537] Prevent R8 warnings for OkHttp 2022-06-06 15:15:42 -04:00
Jack Grigg cc29003afb Migrate to `zcash/librustzcash` revision that preserves v5 tx bytes
`decrypt_and_store_transaction` internally serialized transactions, but
the previous commit only added parsing support. Fortunately we already
have the transaction bytes, so to handle this in the short term we can
just pass them through.

Once we have migrated the SDK to latest `zcash/librustzcash` the API
will return to its previous form.
2022-05-25 05:45:43 -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
Jack Grigg 7c0d02cee7 Remove unused dependencies 2022-05-18 20:48:27 -04:00
Jack Grigg 88c0dc26ac cargo update
`hdwallet` is left at `0.3.0` because `hdwallet 0.3.1` migrates to
`secp256k1 0.21` which is an incompatible update.
2022-05-18 20:48:27 -04:00
Jack Grigg 41c188109a cargo fmt 2022-05-18 20:48:27 -04:00
Jack Grigg 289530fd12 Remove `updater` feature flag, binary, and dependencies
The binary itself was removed in zcash/zcash-android-wallet-sdk#263 but
the `Cargo.toml` was not updated. This didn't affect the SDK itself
because by default it didn't build with the `updater` feature flag.
2022-05-18 20:48:27 -04:00
Carter Jernigan 7d8182d5be [#476] GRPC 1.46.0 2022-05-09 09:38:31 -04:00
Carter Jernigan e78139fa1a [#503] Update checkpoints
- Added instructions to readme for updating checkpoints
 - Added new checkpoints since the last release
 - Re-generated old checkpoints for consistent formatting of the height in quotes.  Although our JSON parser supports both, consistent formatting reduces future bug risks
 - Generated missing checkpoints
 - Removed odd-numbered checkpoints (which were left over as the “latest” checkpoint during previous checkpoint updates)
2022-05-05 12:22:28 -04:00
Carter Jernigan 3aa0543305 Fix snapshot publishing 2022-03-21 19:04:40 -04:00
Carter Jernigan ff9eee6358 [#413] Apply ktlint formatting changes 2022-03-03 16:48:10 -05: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 37d39610e8 [#376] Add new checkpoints 2022-01-27 15:41:25 -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 f96a07a06b [#365] Add detekt baseline file
A followup issue exists to come back and resolve these issues

fix
2022-01-19 17:00:58 -05: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 3b5d02b1a7 [#363] Fix librustzcash dependency source 2022-01-13 13:08:39 -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 4a43d1fe7d Okio 3.0.0 and Okhttp 4.9.2 2021-11-22 09:21:30 -05:00
Francisco Gindre abd905b2d5 Fresh testnet checkpoints 2021-11-18 19:46:04 -03:00
Francisco Gindre 45db11a7c0 Fresh checkpoints for Mainnet 2021-11-18 19:42:41 -03:00
Carter Jernigan dca91f2558 [#319] Fix ktlint issues 2021-11-18 07:10:30 -05:00
Carter Jernigan 079229972f [#269] Convert blocking calls to suspend functions
To quickly get this implemented, some calls in the demo-app have been wrapped in `runBlocking {}`.  This is not ideal and will be addressed in followup issues.
2021-10-21 16:52:15 -04:00
Carter Jernigan 07a00dc376
[#294] Move twig to internal package 2021-10-13 10:20:13 -04:00
Carter Jernigan 28853b5a84 [#293] Refactor non-public APIs to internal package 2021-10-04 08:45:53 -04: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 abac552ab5 [#284] Refactor darkside tests to separate module
Simplifies running the SDK test suite versus darkside tests (which require special environment setup).

Note that the darkside tests are still broken.  This is not a regression, as they were broken before.  This is an intermediate step towards fixing those tests.
2021-09-27 14:55:08 -04:00
Carter Jernigan dfe7dad834 [#256] Use Gradle Version Catalog for dependencies 2021-09-25 12:54:42 -04:00
Carter Jernigan 283718de94 [#285] Apply ktlint to demo-app
In the process of refactoring the Gradle scripts, ktlint now is applied to all Gradle modules.  The demo-app hadn't been linted before, so this applies a series of minor autocorrections to this module.
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
Carter Jernigan 9b821bbfab [#251] Update to Mozilla Rust Gradle Plugin 0.9.0 2021-09-13 13:28:18 -04:00
Carter Jernigan 568cfa6c4b [#270] Fallback for bad JSON files 2021-09-11 11:43:35 -04:00
Carter Jernigan a58a235d2c [#270] Add regression tests for assets 2021-09-11 11:43:35 -04:00
Carter Jernigan f9d95bca91 [#270] Delete duplicate JSON file
File 900000 is a duplicate of file 580000
2021-09-11 11:43:35 -04:00
Carter Jernigan 7e97786c37 [#270] Fix inconsistent network name in testnet JSON files 2021-09-11 11:43:35 -04:00
Carter Jernigan 8660ed9d57 Fix missing ignore imports 2021-09-11 10:39:20 -04:00
Carter Jernigan 4d87a360e8 Update documentation for mavenLocal publishing 2021-09-11 10:39:20 -04:00
Carter Jernigan 39f5202f2c Move packages.md
This is a followup fix for changes made with issue #255
2021-09-11 07:27:00 -04:00
Carter Jernigan 2471389906 [#261] Add property for NDK version 2021-08-31 15:41:39 -04:00
Carter Jernigan f8ed6023c7 Configure lint baseline 2021-08-31 14:57:23 -04:00
Carter Jernigan 8b67ee1e57 Get tests running to completion
Some tests have been disabled to enable tests to actually complete; there are a number of test failures which need to be addressed.

These tests were failing prior to the refactoring.

The disabled tests can be easily found by searching for the Ignore annotation. They also appear in the Junit results window in Android Studio.
2021-08-31 14:57:23 -04:00
Carter Jernigan 2268f814f2 [#255] Refactor Gradle Modules
Move SDK from the root gradle project to its own Gradle module
Move the demo app to be a peer of the SDK

This will simplify integration with CI on Bitrise.
2021-08-31 14:53:25 -04:00