Commit Graph

123 Commits

Author SHA1 Message Date
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
Jack Grigg a27fbda8c0 Expose APIs for working with transaction proposals
Closes Electric-Coin-Company/zcash-android-wallet-sdk#1359.
2024-03-06 16:40:21 +01:00
Jack Grigg 04f1f47957 Fix bug where mempool submission errors were being ignored 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
Jack Grigg 9fd25a0197 CompactBlockProcessor: Add tracing 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 e0fcbbea3a Refresh wallet transparent balance flow from `WalletSummary`
Previously we only showed balance updates for the default address; this
could potentially undercount transparent balance in some cases.

We also now use the total zero-conf transparent balance for both "total"
and "available", because we only allow transparent balance to be
shielded, and we use a zero-conf transaction to do so.
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 7149def6f1 Expose `ScanSummary` across the FFI
Closes Electric-Coin-Company/zcash-android-wallet-sdk#1368.
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 85af183cee backend-lib: Migrate to latest in-progress revision of Rust crates 2024-01-30 17:23:37 +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
Honza Rychnovský 2ee4140080
[#1307] Gradle 8.5
* [#1307] Gradle 8.5

Closes #1307

* Changelog update

* Flank 23.10.1
2024-01-04 10:47:46 +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
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
Honza Rychnovský 62fc5d7cfa
[#1242] ScanRange fails when no matching priority (#1246)
Tests added
2023-09-18 08:15:18 -06:00
Honza 11b031a6af Exit execution when retry limit reached 2023-09-12 19:27:20 +02:00
Honza 39ba2b48b0 Fix ktlint warning 2023-09-11 20:22:41 +02:00
Honza c7125f4183 Update createAccountAndGetSpendingKey API
- TypesafeBackend.createAccountAndGetSpendingKey now works with a type-safe TreeState model class instead of ByteArray.
- New type-safe TreeState added. Once we get the TreeState object from the lightwalletd server, potential validation comes into this object.
2023-09-11 19:11:03 +02:00
Honza Rychnovský a082fe9034
[#1231] GetConsensusBranchId works with chain tip (#1232)
* [#1231] GetConsensusBranchId works with chain tip

Closes #1231
2023-09-11 09:11:01 +02:00
Honza 4c8c32587b Add note on scan continuity error texts 2023-09-10 10:31:56 +02:00
Honza a8813277f7 retryUpToAndContinue exception wrapper trigger fix 2023-09-10 10:19:08 +02:00
Honza 79ba05f23b Change denominator requirement
- Added safe progress ratio calculating function
- Added test
2023-09-09 19:11:58 +02:00
Honza a43c5f130e Change createAccountAndGetSpendingKey API
The checkpoint parameter changed for treeState: ByteArray
2023-09-09 19:11:58 +02:00
Honza Rychnovský 899b487ee4 [#1219] Remove calculated sync progress
Closes #1219
2023-09-08 20:23:37 +02:00
Honza Rychnovský fc14082a1c [#1213] Remove `BlockTable` and its APIs
* [#1213] Remove `count()` from BlockTable API

* [#1213] Remove `firstScannedHeight()` from BlockTable API

* [#1213] Remove `findBlockHash()` from BlockTable

* [#1213] Remove `lastScannedHeight()` from BlockTable

* [#1213] Remove `BlockTable` entirely
2023-09-08 20:22:40 +02:00
Jack Grigg 42cf9d6466 Migrate to Rust revision that exposes scanned heights 2023-09-08 20:19:51 +02:00
Honza 7b7275b5bd Migrate to latest Rust revision follow-up changes 2023-09-08 20:19:51 +02:00
Jack Grigg 11d9529f2b Migrate to latest Rust revision
- Account birthdays
- Scan progress
- Bugfixes
2023-09-08 20:19:51 +02:00
Honza Rychnovský 10a7aa7f3f [#1180] Frequent SbS synchronization restarting
* [#1180] Frequent SbS synchronization restarting

- Processing blocks with SbS split into preparation and processing functions, which can be called repeatedly.
- Refactored other parts of the synchronization mechanism
- Closes #1180
- This also partly solves #1137

* Update .gitignore

* Update LINCENSE documentation

* [#1177] Checkpoints update

* Fix Ktlint warning
2023-09-08 20:19:51 +02:00
Honza f23aca38a6 Update getSuggestScanRangePriority fallback value 2023-09-08 20:19:51 +02:00
Jack Grigg 32069bea0a Migrate to Rust revision with scan queue initialization 2023-09-08 20:19:51 +02:00
Honza Rychnovský 9795610bb9 [#1136] Tests for the new helper extensions
* Jni objects attribute constraint tests


* Extend continuity error test

* ScanRange model tests

* [#1174] Move model classes out of the CompactBlockProcessor

* [#1174] SbS: Move model classes out of the CompactBlockProcessor

* Move SyncingResult out of the processor

* Add issue link
2023-09-08 20:19:51 +02:00
Honza 7277a7ecca Fix ktlint warning 2023-09-08 20:19:51 +02:00
Honza 61f618caf9 Remove OpenEndRange type entirely 2023-09-08 20:19:51 +02:00
Honza 6e7d2404dc Fix query db projection in getSaplingOutputIndices 2023-09-08 20:19:51 +02:00
Honza cc3129d0a5 Fix selectionArgs input type 2023-09-08 20:19:51 +02:00
Honza d1ef768b7a Minor formatting changes 2023-09-08 20:19:51 +02:00
Honza Rychnovský fd17e7ef0e [#1159] Update sync progress reporting
* [#1168] Checkpoints update

* [#1159] Updated sync progress reporting

* Increase test_robo_demo_app timeout

* Migrate to ClosedEndRange

It’s better to transform suggested ranges from OpenEndRange to ClosedRange as soon as possible to avoid its handling in the rest of the logic.

* Improve all batch count calculating

* Subsequent SbS sync algorithm renaming
2023-09-08 20:19:51 +02:00
Honza Rychnovský 91f5cbe24d [#1129] Refactor ProcessorInfo
* Add rewind button to Demo app

To be able to test refactored CompactBlockProcessor rewind feature.

* Rename non-linear to spend-before-sync

* [#1129] Refactor lastSyncRange lastSyncedHeight

* Fix updateRange function

As the overallSyncRange needs to be reset in case of all ranges are processed.

* [#1166] Remove alsoClearBlockCache parameter
2023-09-08 20:19:51 +02:00
Jack Grigg 54d016e401 Migrate to Rust revision with checkpoint and memo bugfixes 2023-09-08 20:18:10 +02:00
Honza Rychnovský 3c31144963 [#1133] Set the correct getSubtreeRoots inputs
* [#1133] Set the correct getSubtreeRoots inputs

- It also better handles setState calls
- It fixes OpenEndRange -> ClosedRange
- And it improves logging in syncing mechanism

* Increase build CI timeout
2023-09-08 20:18:10 +02:00
Honza Rychnovský 92ac1e926e [#1139][#1138] Process Priority.Verify blocks
* [#1139][#1138] Process Priority.Verify blocks

This makes the new subtask functions more testable.

* Increase CI test timeout

* [#1047][#1140] Improve CBD internal state handling

* [#1047][1140] Improve CBD internal state handling

This improves internal state handling in CompactBlockProcessor. Error handling included. And it prepares us for ContinuityError handling too.

* [#1143] Handle ContinuityError
2023-09-08 20:18:10 +02:00
Honza Rychnovský b811305e53 [#1125] Download chain tip metadata 2023-09-08 20:18:10 +02:00
Honza Rychnovský 6a68889df6 [#1123] Linear vs Non-linear decision mechanism 2023-09-08 20:18:10 +02:00
Honza 57fe48e9fe Switch to ScanRange model in sdk-lib module 2023-09-08 20:18:10 +02:00
Honza 7cee1d7203 Make buildable + Solve Lint warnings 2023-09-08 20:18:10 +02:00
Jack Grigg 12c3441778 Migrate to Rust crate versions with fast spendability support 2023-09-08 20:18:10 +02:00