Commit Graph

144 Commits

Author SHA1 Message Date
Honza Rychnovsky e784ddf353
[#841] Ktlint 0.48.0
* [#841] Ktlint 0.48.0

* Update + Suppress

- Missing-trailing-comma globally
- Broken no-semi rule locally
- Fixed few other minor formatting troubles
2022-12-20 09:25:04 +01:00
Honza Rychnovsky c3e41a68c2
[#795] Detekt 1.22.0
* [#795] Detekt 1.22.0

* Fix rules/its findings
2022-12-19 08:08:25 +01:00
Jack Grigg 3669afd0e2 rust: Lower default log level to INFO
This ensures that errors are logged and tracing events are generated,
but prevents debug logging in release mode. Eventually this will be
made configurable based on the SDK build type, but for now we impose
the same limits on debug builds.
2022-12-15 16:22:36 -05:00
Jack Grigg dec24e9787 Initialize the Rust library atomically
Previously if `initLogs()` was called more than once, the application
would crash. `NativeLibraryLoader` already implements a singleton for
loading the Rust library, so we now hook into that for initialization.

We now always initialize the Rust logging system, along with the tracing
event hooks and anything else we add in future.
2022-12-15 16:22:36 -05:00
Jack Grigg 7852ea1243 rust: Cache span names as `CString`s
We also avoid parsing span names as `CString`s if tracing is disabled.
2022-12-15 16:22:36 -05:00
Jack Grigg a3b575a5bb rust: Document NDK methods and expose `ATrace_isEnabled` 2022-12-15 16:22:36 -05:00
Jack Grigg ff93581945 rust: cargo update
Includes updates to Zcash Rust crates that add profiling to light client
chain scanning subcomponents.
2022-12-15 16:22:36 -05: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
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 d9a0e98dc0 [#811] Eliminate suspending function for sending/shielding 2022-12-12 07:34:07 -05:00
Carter Jernigan d25d67c470 [#723] Fail fast when native library fails to load 2022-12-03 09:00:40 -05:00
Jack Grigg f4755cfbd7 Create Android trace events (if available) from tracing spans 2022-11-29 19:20:24 +00:00
Jack Grigg 4c2bf6da69 Use `tracing` crate for logs
This exposes any more structured `tracing` events that are logged within
the Rust crates, while continuing to collect `log` records.
2022-11-29 19:20:24 +00:00
Carter Jernigan d118632919
[#723] Fix crash with minified release builds 2022-11-24 11:15:03 +01:00
Carter Jernigan 103d2748c6 [#780] Fix failure to submit transactions 2022-11-17 08:35:37 -05:00
Carter Jernigan 3eddd56691 [#778] Fix PendingTransactionEntity crash 2022-11-17 08:35:37 -05:00
Jack Grigg 8472d84cce rust: Define private constant for enabling ZIP 317 fees 2022-11-16 20:37:34 +00:00
Jack Grigg 727918680e rust: Fix usage of `WalletRead::get_target_and_anchor_heights`
The previous code was using the "target" height instead of the "anchor"
height, which meant the provided value of `min_confirmations` was ignored.
2022-11-16 20:37:34 +00:00
Jack Grigg e5df95c9e5 rust: `cargo update` 2022-11-16 20:37:34 +00:00
Jack Grigg c4b5c70b7d Migrate to published Zcash Rust crates with ZIP 317 support
ZIP 317 fee calculations are hard-coded off, continuing to use the
fixed fee logic for now, but enabling them in a future SDK update is
now possible.
2022-11-16 20:37:34 +00:00
Honza Rychnovsky 6e8f5943cd
[#781] Regular checkpoints files update 2022-11-16 12:58:02 +01:00
Carter Jernigan b288b8cad9 Rename Synchronizer.getAddress APIs 2022-11-08 14:25:56 -05:00
Carter Jernigan ee99b36798
Merge branch 'main' into feature/zip-316-and-latest-upstream 2022-11-08 10:13:43 -05:00
Carter Jernigan d1e9b28c91 [#771] Update documentation for SDK 1.10.0 2022-11-08 09:32:07 -05:00
Jack Grigg 54f8cf2069 rust: Bump revision of librustzcash crates for bugfix
Fixes a bug where Sapling change notes were being spent with the wrong key.
2022-11-07 15:19:19 -05:00
Jack Grigg 872c0fda6f rust: Set MSRV to 1.59
One of our dependencies uses a feature added in 1.59.0.
2022-11-07 15:19:19 -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
Jack Grigg 5e82f8cf07 rust: jni 0.20 2022-11-07 15:19:19 -05:00
Jack Grigg 2566b9692b rust: android_logger 0.11 2022-11-07 15:19:19 -05:00
Jack Grigg 54df39652c rust: Migrate to latest revision of librustzcash crates 2022-11-07 15:19:19 -05:00
Jack Grigg e1ad71a392 rust: cargo update 2022-11-07 15:19:19 -05:00
Jack Grigg 9ff3621980 rust: Remove duplicate FFI method
We already use -1 to indicate no block scanning limit on the Kotlin side of
the FFI; we can do the same across the FFI to the Rust side.
2022-11-07 15:19:19 -05:00
Carter Jernigan 6a6cbf4048 [#760] Fix database queries
This resolves some query regressions that were introduced as part of [#705]
2022-11-04 10:01:09 -04:00
Carter Jernigan f976b79a46
[#758] Add default alias for erase method 2022-11-03 12:40:44 -04:00
Carter Jernigan 61f1c1a9cb
[#753] Add API for querying recipients 2022-10-31 15:27:34 -04:00
Carter Jernigan 9af6986e43
[#748] Internal recipients for pending transactions 2022-10-26 21:37:40 -04:00
Carter Jernigan f169b112ef [#743] Add API for reading memos 2022-10-24 11:54:57 -04:00
Honza Rychnovsky 92c9c25db4
[#741] Update checkpoints 2022-10-21 12:17:18 +02: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
Jack Grigg 4a37f3976f rust: Migrate to latest upstream Zcash crates 2022-10-15 10:08:04 +13:00
Jack Grigg 4d7d0bf64b rust: `jni 0.19` 2022-10-14 20:37:56 +13:00
Jack Grigg 9bf667926f rust: `android_logger 0.11` 2022-10-14 20:37:56 +13:00
Jack Grigg a4bece9f8c rust: cargo update 2022-10-14 18:35:26 +13:00
Carter Jernigan e95e43b83b Add simple tests for Account and UnifiedSpendingKey
test
2022-10-06 14:49:04 -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 3b826f8f6a Simplify Synchronizer instantiation
fix

synchronizer
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