Commit Graph

219 Commits

Author SHA1 Message Date
Honza Rychnovský e75123d1f9
[#1455] Remove hard-coded currency decimal sep
Closes #1455
2024-04-23 15:03:49 +02:00
Honza Rychnovský 2a3c070a01
Remove logs stripping check entirely (#1444)
- As ensuring the check should be applied is not possible for a library that depends on clients build type and their different use cases
- Stripping tested manually with different client wallets, and it works as expected
2024-04-17 17:51:31 +02:00
Honza Rychnovský 1833e866a7
Improve logs stripping test (#1443)
This change avoids false-positives in clients
2024-04-17 14:25:28 +02:00
Honza Rychnovský 652487e563
[#1435] Eliminate logging with Proguard
- Closes #1435
- Changelog update
2024-04-17 09:26:39 +02:00
Honza Rychnovský 2c09776f9f
[#1440] Db image malformed while scanning blocks 2024-04-17 09:24:49 +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
Honza Rychnovský 2fe2ecc62f
[#1421] Improve TransactionSubmitResult
Closes #1421
2024-03-25 17:14:19 +01:00
Honza 965833ec58 Docummentation + unused exception removal 2024-03-19 17:39:40 +01: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ý fe6b11c4ec
[#1413] Update ZecSend with Proposal
* [#1413] Update ZecSend with Proposal

- Closes #1413
- Changelog update
2024-03-14 14:40:40 +01: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 c8d0be8404 Add `Proposal.transactionCount` 2024-03-07 19:49:18 +00:00
Honza c4b45c2c2f Eliminate the suppressions 2024-03-06 20:17:58 +00:00
Honza 8bd009c98a Improve logging inside `txManager.submit()` 2024-03-06 20:17:58 +00:00
Honza 8e4c83627b Improve `createProposedTransactions` 2024-03-06 20:17:58 +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
Jack Grigg d2fa400531 Deprecate `Synchronizer.sendToAddress` and `Synchronizer.shieldFunds` 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
str4d 41bb83cb5e
Emit sync progress from `CBP.runSyncingAndEnhancingOnRange` after scan (#1361)
Downloading and scanning blocks are requirements for updating sync
progress, but block deletion from the cache is not. This change moves
block deletion into "the background" alongside transaction enhancement.

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2024-03-06 14:10:56 +00:00
Honza Rychnovský 381bd42b89
[#1393] Support server switching
- This ensures that the SDK supports apps switching between different lightwalletd servers
- Synchronizer.validateServerEndpoint API added
- Demo app updated to leverage this new feature
- Changelog update
- Closes #1393
2024-03-02 18:55:22 +01:00
Honza Rychnovský f5ab7d9d19
[#1400] Update public Memo class API
- Closes #1400
- Adds a few more minor changes
- Changelog update
2024-02-26 15:59:05 +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 9fd25a0197 CompactBlockProcessor: Add tracing 2024-01-30 17:23:37 +00:00
Jack Grigg 22407a593d Get `WalletSummary` on CBP start and use it to bound subtree roots
This improves performance in two ways:
- The `SdkSynchronizer` now reports balances of existing wallets and
  sync progress almost immediately, instead of after the first batch
  of blocks is scanned.
- In the steady state case, only a few subtree roots are downloaded,
  reducing the time until the first batch of blocks is scanned.

Closes Electric-Coin-Company/zcash-android-wallet-sdk#1310.
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 55d0dd47d8 Deduplicate balance refreshing APIs 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 bb3733ec94 CompactBlockProcessor: Deduplicate sleep code
Closes Electric-Coin-Company/zcash-android-wallet-sdk#1252.
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ý 68cfd21fe7
[#1287] Remove LightWalletEndpointExt public API
- Closes #1287
- This refactored out all the occurrences of LightWalletEndpointExt and its functions and variables from the SDK’s public API. It preserves it in tests, demo app, and in the PersistableWallet for backward compatibility, although it’s not available from outside of the SDK.
- Changelog updated
2024-01-08 14:45:47 +01:00
Honza Rychnovský d8902d11df
[#1248] Clean up unused exceptions
* [#1248] Clean up unused exceptions

Closes #1248

* Changelog update

* Suppress detekt warning

Creating these private functions is required by the compiler
2024-01-07 10:29:33 +01:00
Honza Rychnovský 1dd369167a
[#1316] Readable TxId on TransactionOverview
Closes #1316
2024-01-05 09:56:23 +01: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
Honza Rychnovský 7d7cf4f84f
[#1292] Expose Data database file path
- Implemented as part of synchronizer API
- Closes #1292
- Documentation updated
2023-11-08 12:27:14 +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
Honza Rychnovský ddffd170d1
[#1273] 10_000-ZAT Miners fee
- Removed all uses of the incorrect 1000-ZAT fee as defined with  deprecated zip-313
- Default is now 10k zatoshi, the minimum defined by zip-317
- Changelog updated
- Closes  #1273
2023-10-02 12:49:36 +02: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
Honza 38ee6a80e9 Link fetchTransaction pass txId twice TODO 2023-09-20 08:56:29 -06:00
Honza 83c69fdd9f FirstClassByteArray toString formatting 2023-09-20 15:51:37 +02:00
Honza 55222aad50 Poll UTXOs regularly 2023-09-20 14:10:11 +02:00