Skip to content

Commit

Permalink
Feature branch SDK 2.2.7 (#1661)
Browse files Browse the repository at this point in the history
* [#1632] Refactor `Account.DEFAULT` (#1645)

* [#1632] Remove `Account.DEFAULT`

* Update Account related APIs

* Refactor balances APIs

* Adopt `getAccounts` in fragment-based Demo app

We have deprecated the old Fragment-based Demo app. See #973. So, the purpose of these changes is purely the buildability of the new Compose-based Demo app.

* Add init to `JniUnifiedSpendingKey.kt`

* Update deprecated Fragment-based Demo app

This part of the Demo app will be removed as part of #973

* Remove deprecated functions from Synchronizer

* Update WalletSnapshot and WalletVM APIs in Demo

+ necessary fixtures changes

* Update newer Compose-based Demo app

* Hide `Synchronizer.createAccount` form public API

As it was, as making it public could bring more requirements on our multi-account support in version 1

* Add all accounts flow API

* Refactor AccountFixture

- We deduplicated the fixture across the related modules and their tests
- Documentation added

* Fix `fetchUtxos` error (code 14)

- Closes #1648
- This also impacts SDK’s ability to recover from loss of internet connection
- Changelog updated

* Switch from ZIP 32 account indices to UUID account identifiers (#1640)

* Switch from ZIP 32 account indices to UUID account identifiers

* Rename TransactionRecipient.Account

To emphasize the distinction between Account and TransactionRecipient.Account

* Fix `Backend.createAccount` API parameters

* Add `importAccountUfvk` to the Rust backend.

* Propagate accountName and keySource across SDK

* Propagate new importAccount across SDK

* Wrap createAccount setup information

* Wrap importAccount setup information

* Add `Zip32AccountIndex` wrapper

* Update key source parameter

* Remove account from `UnifiedSpendingKey`

* Fix `importAccountByUfvk` API

* Refactor Account.accountUuid to wrapper class

So we can easily keep it typesafe and compare it to each other

* Add `JniAccountUsk`

* Add `seedFingerprint` and `zip32AccountIndex`

To public API `importAccountUfvk`

* Transactions by account UUID

* Refactor default account creation

* Migrate to Rust crate revision with bugfixes to account UUID migration

* Refactor inputs of `importAccountUfvk`

* Use `FirsClassByteArray` for `seed` parameter

---------

Co-authored-by: Honza <[email protected]>
Co-authored-by: Kris Nuttycombe <[email protected]>
Co-authored-by: Honza Rychnovský <[email protected]>
Co-authored-by: Daira-Emma Hopwood <[email protected]>

* Remove unused `TransactionEncoder` functions (#1660)

* Resolve [#1640] review comments

* `Account` documentation fix

* Make `AccountPurpose.Spending` args not null

As they now live under `AccountPurpose.Spending` where we need them not null
+ `AccountImportSetup` doc fix

* Replace `bytes` with `usk` in `AccountUsk`

* Change test name

* Feature/proposal to pczt (#1647)

* Migrate to latest revision of Zcash crates

* Integrate PCZT APIs into the Android SDK

* Fix `Backend.createPcztFromProposal` parameter

* Add Synchronizer side of PCZT logic

* Add `getAccountForUfvk`  method to Rust backend & fix key derivation null issue. (#1656)

* Add `getAccountForUfvk` method to the FFI.

* Only decode key derivation metadata when creating a count with `Spending` purpose.

Also, ensure that a spending account can still be created without providing
key derivation metadata.

* Update to `librustzcash` revision `205d4c930319b7b6d24aeb4efde69e9b4d1b6f7b`

* Add the new `getAccountForUfvk` to `TypesafeBackend`

* Update `FakeRustBackend`

---------

Co-authored-by: Honza <[email protected]>

* Remove unused `TransactionEncoder` functions (#1660)

* Resolve [#1640] review comments

* `Account` documentation fix

* Make `AccountPurpose.Spending` args not null

As they now live under `AccountPurpose.Spending` where we need them not null
+ `AccountImportSetup` doc fix

* Replace `bytes` with `usk` in `AccountUsk`

* Change test name

* Testnet Synchronizer test fix

* Detekt warning

* Changelog update

---------

Co-authored-by: Jack Grigg <[email protected]>
Co-authored-by: Honza <[email protected]>
Co-authored-by: Honza Rychnovský <[email protected]>

* Peformance optimizations

* Revert "Peformance optimizations"

This reverts commit 68de6ae.

* PCZT support follow-ups (#1663)

* Rename exception

* Add sapling param fetching to new KS-related fun

* Add dedicated clone PZCT function

* Add `Synchronizer.Status.INITIALIZING`

For wallets to know that accounts and other APIs are not ready yet

* [#1665] Checkpoints update

Closes #1665

* Bump lib version to 2.2.7

* Migrate to the published Zcash crate releases including PCZT v1 (#1664)

Co-authored-by: Honza <[email protected]>

---------

Co-authored-by: Jack Grigg <[email protected]>
Co-authored-by: Kris Nuttycombe <[email protected]>
Co-authored-by: Daira-Emma Hopwood <[email protected]>
Co-authored-by: Kris Nuttycombe <[email protected]>
Co-authored-by: Milan Cerovsky <[email protected]>
  • Loading branch information
6 people authored Dec 17, 2024
1 parent 1e77d9c commit d80876f
Show file tree
Hide file tree
Showing 111 changed files with 2,871 additions and 1,100 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,41 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- `Synchronizer.importAccountByUfvk()` has been added
- `Synchronizer.getAccounts()` returning all the created or imported accounts. See the documentation in `Account`.
- `Synchronizer.walletBalances: StateFlow<Map<AccountUuid, AccountBalance>?>` that is replacement for the removed
`orchardBalances`, `saplingBalances`, and `transparentBalance`
- `getTransactions(accountUuid: AccountUuid)` to get transactions belonging to the given account
- `Synchronizer.createPcztFromProposal`
- `Synchronizer.addProofsToPczt`
- `Synchronizer.createTransactionFromPczt`
- `Zip32AccountIndex`, `AccountUuid`, `AccountUsk`, `AccountPurpose`, `AccountCreateSetup`, `AcountImportSetup`, and
`Pczt` model classes have been added to support the new or the changed APIs

### Changed
- `Account` data class works with `accountUuid: AccountUuid` instead of the previous ZIP 32 account index
- These functions from `DerivationTool` have been refactored to work with the new `Zip32AccountIndex` instead of the
`Account` data class: `deriveUnifiedSpendingKey`, `deriveUnifiedAddress`, `deriveArbitraryAccountKey`
- `WalletCoordinator` now provides a way to instantiate `Synchronizer` with the new `accountName` and `keySource`
parameters
- `UnifiedSpendingKey` does not hold `Account` information anymore, it has been replaced by `AccountUsk` model class
in a few internal cases
- `Synchronizer.send` extension function receives `Account` on input
- `PendingTransaction` sealed class descendants have been renamed
- `RustLayerException.GetCurrentAddressException` has been renamed to `RustLayerException.GetAddressException`
- Checkpoints update

### Removed
- `Synchronizer.sendToAddress` and `Synchronizer.shieldFunds` have been removed, use
`Synchronizer.createProposedTransactions` and `Synchronizer.proposeShielding` instead
- `Synchronizer.orchardBalances`, `Synchronizer.saplingBalances`, and `Synchronizer.transparentBalance`
(use `Synchronizer.walletBalances` instead).

### Fixed
- The `CompactBlockProcessor` now correctly distinguishes between `Response.Failure.Server.Unavailable` and other
errors in its `refreshUtxos` API. It then sets its state to `State.Disconnected` in such a case.

## [2.2.6] - 2024-11-16

### Added
Expand Down
Loading

0 comments on commit d80876f

Please sign in to comment.