Commit Graph

87 Commits

Author SHA1 Message Date
str4d 59f4fef479
Rust dependency updates (#1445)
* Bump Rust to 1.77

* cargo update

* Migrate from `failure` to `anyhow` for error handling

* `dlopen2 0.7`

* Remove extra comma

Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>

---------

Co-authored-by: Honza Rychnovský <rychnovsky.honza@gmail.com>
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-04-20 15:22:24 +02:00
Kris Nuttycombe 7dadd57d6b
Provide the pool type when retrieving a memo. (#1436)
* WIP: Provide the pool type when retrieving a memo.

* Gitignore new idea file

* Let TypesafeBackend work with typesafe class

* Query and use protocol for memo obtaining

---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2024-04-14 21:28:07 +02:00
str4d 52ee2bc5bc
Feature branch for SDK 2.1.0 (#1411)
* CompactBlockProcessor: Remove `withDownload` parameter

* backend-lib: Migrate to latest in-progress revision of Rust crates

Includes changes to how accounts are stored and referenced. We now
need to remember and provide the seed fingerprint; for now, given
that we know we only create derived accounts from a single seed, we
search for an account with a matching ZIP 32 account index.

* backend-lib: Add `Backend.isSeedRelevantToWallet`

* Remove nullability of DownloadSuccess param

* Comment update

* Fix Detekt warnings

* backend-lib: Migrate to latest in-progress revision of Rust crates

Includes some renames, and a built-in seed relevancy API that we now
use.

* Separate tree state fetching

- Added continuable retry logic

* Integrate Orchard support

Closes Electric-Coin-Company/zcash-android-wallet-sdk#528.
Closes Electric-Coin-Company/zcash-android-wallet-sdk#761.

* Detekt warnings fix

* Fix unit tests

* Update `TxOutputsView` to use correct column names. (#1425)

* Return an error instead of a panic in the case of data corruption. (#1426)

This removes an `expect` call that risked crashing the app in the case of
database corruption, potentially hiding other bugs.

* Include `orchardSubtreeRootList` in final check

* Revert `orchardSubtreeRootList` check

Explanation comment added

* Changelog update

* Update to zcash_client_sqlite version 0.10.3 (#1428)

---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
2024-04-09 13:49:52 +02:00
Jack Grigg ad75ed65e5 Correctly throw `InitializeException.SeedRequired`
Closes Electric-Coin-Company/zcash-android-wallet-sdk#782.
2024-03-19 04:35:31 +00:00
Honza Rychnovský 078e76a941
[#776] Enable ZIP 317 fees support
* [#776] Enable ZIP 317 fees support

* Deprecate ZcashSdk.MINERS_FEE

* Replace MINERS_FEE with Proposal API in Demo app

* Changelog update

* Bump SDK to 2.0.8 to produce snapshot version
2024-03-13 10:03:53 +01:00
Jack Grigg f69c415e92 cargo update 2024-03-07 20:41:58 +00:00
Jack Grigg c8d0be8404 Add `Proposal.transactionCount` 2024-03-07 19:49:18 +00:00
Jack Grigg 99e91fa8b7 Migrate to `zcash_client_sqlite 0.9.0`
The backend now supports proposals that create multiple transactions.
It still does not generate such proposals itself, and we assert this
inside the now-deprecated APIs.
2024-03-06 20:17:58 +00:00
Jack Grigg abffb3f9ee Adjust `Synchronizer.proposeShielding` API
- Returns `null` when there are no funds to shield or the shielding
  threshold is not met.
- Throws an exception if there are funds to shield in more than one
  transparent receiver within the account.
- Has an optional parameter for specifying which transparent receiver
  to shield funds from.

Part of Electric-Coin-Company/zcash-android-wallet-sdk#680.
2024-03-06 20:17:41 +00:00
Jack Grigg e36bbdec7a Expose shielding threshold in `Synchronizer.proposeShielding`
`Synchronizer.shieldFunds` is not altered because it is deprecated.
2024-03-06 16:40:21 +01:00
Honza Rychnovský 19cca515fb
[#1385] Adopt `AccountBalance` fields in Kotlin layer
* [#1385] Adopt `AccountBalance` fields in Kotlin layer

- Adds the Kotlin side changes for #1380
- Changed WalletBalance to contain these three fields: available, changePending, and valuePending, instead of total and available, and change the transparent flow to StateFlow<Zatoshi>, as we don't distinguish there.
- Related connected APIs changed
- Closes #1385

* Add WalletBalanceFixture

Placed in the public directory to be visible for clients as well

* Changelog update

* Remove `getVerifiedTransparentBalance ` API entirely

Co-authored-by: str4d <jack@electriccoin.co>
2024-02-07 17:33:47 +01:00
str4d b617eb1bb3
backend-lib: Expose `AccountBalance` fields across the FFI
* backend-lib: Expose `AccountBalance` fields across the FFI

* Update related fixture class

---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2024-02-05 16:16:13 +01:00
str4d 394ddefb16
Fix Rust crash when shielding (#1379)
* Migrate to `librustzcash` tag `ecc_sdk-20240130a`

This includes the fix to the empty transaction request serialization
bug, which was preventing shielding from working.

* Release zcash-android-wallet-sdk 2.0.6

* Fix ktlint warnings

* Other CBP minor/formatting changes

---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2024-01-31 03:43:16 +01:00
Jack Grigg f16282305e backend-lib: Set correct MSRV 2024-01-30 17:23:37 +00:00
Jack Grigg f792bfbb7c backend-lib: Add tracing to every Rust FFI method 2024-01-30 17:23:37 +00:00
Jack Grigg ddc4cf6f7b cargo update 2024-01-30 17:23:37 +00:00
Jack Grigg 1cdaaa974c Migrate to `ecc_sdk-20240129` tag of Zcash Rust crates 2024-01-30 17:23:37 +00:00
Jack Grigg a8965b01c6 Fix types of arguments to `GetSubtreeRoots` and `putSaplingSubtreeRoots` 2024-01-30 17:23:37 +00:00
Jack Grigg 1f19360ca3 Expose the rest of `WalletSummary` across the FFI 2024-01-30 17:23:37 +00:00
Jack Grigg 9eeb5ba04c backend-lib: Migrate to latest in-progress revision of Rust crates
Includes performance improvements to block scanning.
2024-01-30 17:23:37 +00:00
Jack Grigg 7149def6f1 Expose `ScanSummary` across the FFI
Closes Electric-Coin-Company/zcash-android-wallet-sdk#1368.
2024-01-30 17:23:37 +00:00
Honza 61b2eb5ed5 Explicit generated location
- This copies the pattern from lightwallet-client-lib module where we set the package for the generated classes
- It adds internal to the path, to be explicit about not exposing it out of the backend module
2024-01-30 17:23:37 +00:00
Jack Grigg 0f0cd81a12 Replace `Backend.{createToAddress, shieldToAddress}` with proposal-based methods
Closes Electric-Coin-Company/zcash-android-wallet-sdk#1338.
2024-01-30 17:23:37 +00:00
Jack Grigg 251392d9cf Migrate to `jni 0.21`
In addition to the necessary breaking changes, we also clean up the
style to match what is used in the `jni` crate examples.
2024-01-30 17:23:37 +00:00
Jack Grigg c6c2a1c54e backend-lib: Migrate to `standard::SingleOutputChangeStrategy`
This removes the type system separation between pre-ZIP 313 and ZIP 317
fees, which becomes necessary when using the transaction proposal
protobuf encoder.
2024-01-30 17:23:37 +00:00
Jack Grigg 85af183cee backend-lib: Migrate to latest in-progress revision of Rust crates 2024-01-30 17:23:37 +00:00
Jack Grigg 1bf2f84837 Migrate to Rust 1.75.0 and NDK 26.1.10909125
Closes Electric-Coin-Company/zcash-android-wallet-sdk#317.
2024-01-18 11:43:54 +00:00
Honza Rychnovský 73d7afc2a4
[#1327] Ktlint 1.1.0
* [#1327] Ktlint 1.1.0

Closes #1327

* [#1327] Autoformatting with Ktlint

* Ktlint formatting warnings fix
2024-01-04 21:21:32 +01:00
str4d ae2d7152aa
Replace Sapling balance and scan progress FFIs with wallet summary FFI
* Replace Sapling balance and scan progress FFIs with wallet summary FFI

Closes zcash/zcash-android-wallet-sdk#1282.

* Using test fixture for JniAccountBalance

* Minor documentation changes

* Fix typo

---------

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2023-11-08 10:57:23 +01:00
Sean Bowe f3dfed42fa cargo update 2023-10-19 16:10:30 -06:00
Sean Bowe d134a2d929 Bump zcash_client_sqlite to 0.8.1 2023-10-19 16:10:30 -06:00
Jack Grigg 20d3459e75 cargo update 2023-09-25 20:02:17 +00:00
Jack Grigg 350e9e192e Migrate to final versions of Zcash Rust crates 2023-09-25 20:01:49 +00:00
str4d 1330e9a74f
[#1268] Migrate to Rust crate revision with spent UTXOs balance fix 2023-09-25 16:54:45 +02:00
Jack Grigg cd6a8777e0 Migrate to latest RC of Rust crates 2023-09-22 18:05:52 -06:00
Honza Rychnovský c8e5a7e125
[#1249] Continuity error rewind
* [#1249] Continuity error rewind

- Fixed the Rust FFI bug that caused us to be unable to catch the Continuity error
- Improved logging
- Moved handling the Continuity error to the outer synchronization loop, which works better with synchronization mutex
- Closes #1249

* Resolve minor comments from older PR #1247
2023-09-21 16:11:02 +02:00
Kris Nuttycombe bcba2a9d51 Update to librustzcash patch with SQLite 3.19 support for Android API 27 2023-09-20 10:44:33 -06:00
Jack Grigg 233acebc2f Migrate to Rust revision with fixes to table views
With the fixes to `v_transactions` and `v_tx_outputs`, there are
several more data fields that may have no data (for rows corresponding
to purely-transparent transactions); their fields are made nullable.
2023-09-19 22:59:31 +01:00
Honza Rychnovský 9869fd4300
[#1239] Post-v2.0.0-rc1 cleanup
* Add JniScanProgressTest

* Remove unnecessary testnet workaround

As this was fixed with the last rust changes.

* Simplify batchCount calculating

* Fix ratio typo

* Docummentation comments changes
2023-09-18 16:51:26 +02:00
Kris Nuttycombe 5037102faf Update to zcash_client_sqlite-0.8.0-rc.3 2023-09-12 12:38:39 -06:00
Honza Rychnovský 9b18fe12d9
Add encode_scan_progress documentation
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-12 19:36:39 +02:00
Honza Rychnovský 96aeec2e9d
Add throws documentation
Co-authored-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-09-12 19:29:39 +02:00
Jack Grigg d775421f5a rust: Migrate to `zcash_client_backend 0.10.0-rc.2` etc 2023-09-12 15:24:45 +00:00
Jack Grigg d162cdf35f rust: Migrate to `hdwallet 0.4` to de-duplicate dependencies 2023-09-12 15:15:58 +00:00
Jack Grigg 01e9b058cb rust: Handle zero-conf transparent funds the same way as iOS 2023-09-12 15:15:58 +00:00
Honza 5e85c39b78 Silent rust compile error
mismatched types: expected `&u64`, found integer
2023-09-09 19:32:35 +02:00
Honza 1b6039c368 Reverting denominator constraint back
The Rust layer now filters out the zero denominator but keeping the ScanProgress new safe ratio function with its test.
2023-09-09 19:11:58 +02:00
Honza ffc1c99738 JniScanRange height parameters constraint 2023-09-09 19:11:58 +02:00
Honza 79ba05f23b Change denominator requirement
- Added safe progress ratio calculating function
- Added test
2023-09-09 19:11:58 +02:00
Honza Rychnovský d3d54d7f15
Filter out zero denominator in Rust layer
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
2023-09-09 19:07:52 +02:00