Commit Graph

93 Commits

Author SHA1 Message Date
Honza ef248c9dc5 Throw exception instead of custom error
- This step unify our approach to validation on client side across all server calls
2023-01-31 09:32:34 +01:00
Honza 0e4d634693 Merge + changelog update
- Updated changelog
- Merged branch 'main' into 615-networking-module

* main:
  [#882] Check properties on CI
  [#874] GRPC 1.52.1
  [#892] Emulator.wtf Gradle Plugin 0.0.15
  [#888] Android Gradle Plugin 7.4
  [#851] Androidx Updates
  [#851] Kotlin 1.8
  [#779] Resolve flaky DatabaseCoordinatorTest
  [#886] Support null block heights
  [#881] Use variables for Test Lab
  [#860] Flank 23.01.0

# Conflicts:
#	CHANGELOG.md
#	gradle.properties
2023-01-30 09:56:21 +01:00
Honza e2d1d93ac2 Unify new clients instances name 2023-01-29 18:37:44 +01:00
Honza b57b379416 Rename local variable 2023-01-25 10:45:28 +01:00
Honza 0f1663f02c Unify return type of collection returning methods
- Switched fetchUtxos() to return Sequence instead of List
- Added a check on empty tAddress input
2023-01-24 11:41:20 +01:00
Honza 703d4034af 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
2023-01-23 17:18:20 +01:00
Carter Jernigan 30979e5ebf [#851] Androidx Updates
Note that the APIs for Room, Sqlite, and Compose changed slightly with these dependency updates
2023-01-18 11:23:25 -05:00
Honza 64e5a5cfa5 Adopt enhanced GRPC response model
- Adopted in a few endpoints
2023-01-16 17:50:36 +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
Honza b1b474af5b Repackage cash.z.wallet.sdk.rpc to cash.z.wallet.sdk.internal.rpc 2023-01-11 16:18:33 +01:00
Honza 1f22703191 Fix wrong merge 2023-01-11 10:29:39 +01:00
Honza 7c3f3f24bc Merge branch 'main' into 615-networking-module
* main:
  Bump actions/cache from 3.2.2 to 3.2.3 in /.github/actions/setup (#878)
  [#861] Remove cancel spend from public API
  [#631] Improve demo app compose UI for testing
  [#866] Clipboardmanager on Android level 21 in Demo-app
  Bump actions/upload-artifact from 3.1.1 to 3.1.2 (#871)
  Bump actions/download-artifact from 3.0.1 to 3.0.2 (#870)
  Bump actions/checkout from 3.2.0 to 3.3.0 (#869)
  [#864] Duplicate Synchronizers in Demo-app

# Conflicts:
#	demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/MainActivity.kt
#	demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/SharedViewModel.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/Synchronizer.kt
2023-01-10 15:36:46 +01:00
Honza e7e0424d1f 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
2023-01-10 15:25:01 +01:00
Carter Jernigan 01da937fdc
[#861] Remove cancel spend from public API 2023-01-09 11:55:30 -05:00
Carter Jernigan 3afe655737
[#631] Improve demo app compose UI for testing
* Add testnet faucet to Compose UI
* Show status on home view
* Add BlockHeight for fixture wallets
* Add balance screen
* Keep screen on while syncing
* Fix conversion of seed phrase to bytes
2023-01-09 10:42:38 -05:00
Honza 8e1bef361d Merge branch 'main' into 615-networking-module
* main: (108 commits)
  [#862] Disable logging with ProGuard for Demo-app
  [#704] No static field PREVIEW_SDK_INT
  [#824] rust: cargo update
  [#855] Abandoned address property
  [#854] Regular checkpoint files update
  [#850] Use new API for build step outputs
  Bump actions/cache from 3.2.0 to 3.2.2 in /.github/actions/setup
  [#631] Initial Compose scaffolding for demo app
  Bump actions/cache from 3.0.11 to 3.2.0 in /.github/actions/setup (#845)
  [#841] Ktlint 0.48.0
  [#795] Detekt 1.22.0
  [#820] Kotlin 1.7.21 + KSP 1.7.21
  rust: Lower default log level to INFO
  Initialize the Rust library atomically
  rust: Cache span names as `CString`s
  rust: Document NDK methods and expose `ATrace_isEnabled`
  rust: cargo update
  [#819] Dokka 1.7.20
  [#815] Gradle Versions Plugin 0.44.0
  [#796] Gradle 7.6
  ...

# Conflicts:
#	CHANGELOG.md
#	darkside-test-lib/src/androidTest/java/cash/z/ecc/android/sdk/darkside/test/TestWallet.kt
#	demo-app/src/androidTest/java/cash/z/wallet/sdk/sample/demoapp/SampleCodeTest.kt
#	demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/MainActivity.kt
#	demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/demos/getbalance/GetBalanceFragment.kt
#	demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/demos/listtransactions/ListTransactionsFragment.kt
#	demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/demos/listutxos/ListUtxosFragment.kt
#	demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/demos/send/SendFragment.kt
#	gradle.properties
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/integration/SanityTest.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/integration/TestnetIntegrationTest.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/integration/service/ChangeServiceTest.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/internal/transaction/PersistentTransactionManagerTest.kt
#	sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/util/TestWallet.kt
#	sdk-lib/src/main/AndroidManifest.xml
#	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/block/CompactBlockProcessor.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/block/CompactBlockDownloader.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/service/LightWalletGrpcService.kt
#	sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/transaction/PersistentTransactionManager.kt
#	settings.gradle.kts
2023-01-09 14:29:14 +01:00
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 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
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
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 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
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
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
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
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
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
Jack Grigg b19ee179c5 Migrate to latest revision of `zcash_primitives` 2022-10-06 14:49:04 -04:00
Honza Rychnovsky e62ca0de70
[#665] Recover from corrupted sapling-spend.params and sapling-output.params files
* [#665] Recover from corrupted sapling-spend.params and sapling-output.params

* Make parameters on exception internal

* Make SaplingParameters internal

* Fix for changed parameters visibility in tests

Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-09-27 07:03:36 +02:00
Alex 2ed60a37c8
[#695] ktlint 0.47.1
* 695 ktlint version update (4.7.1)
2022-09-20 14:25:56 +02:00