Skip to content

Commit

Permalink
Feature branch for SDK 2.2.0 (#1512)
Browse files Browse the repository at this point in the history
* cargo update

* rust: Remove unused direct dependencies

* Migrate to Rust 1.79

* Migrate to latest revision of librustzcash crates

* Add ZIP 320 TEX address validation

* Migrate to latest revision of librustzcash crates

This includes support for creating transaction proposals that send to
TEX addresses.

* Fix handling of empty memos

This fixes several existing issues:
- The Rust backend's `proposeTransfer` expected to receive `null` for no
  memo, but was instead receiving an empty array. `proposeShielding`
  meanwhile was always expecting a memo.
- The Kotlin side had nullable byte arrays, but then always converted an
  empty string to an empty byte array instead of `null`.

* Fix Detekt warning

* Changelog update

* Exception reporting issue filed

Filed a follow-up issue #1534

* Add WalletAddress.Tex type

* Another fix of Detekt warning

* Migrate to latest revision of librustzcash crates

* Raise MSRV to 1.80

* Fix clippy lints as of 1.80

* cargo update

* Add `Synchronizer` APIs for USD/ZEC exchange rate

* Exchange rate implementation (#1537)

* Exchange rates API refactor

* Code cleanup

* Demo app updates

* Exchange rate implementation

* Detekt and ktlint checks

* Code cleanup

* Address review comments

* Code cleanup

* Code cleanup

* Tor initialization and disposal (#1560)

* Tor initialization and disposal

* Code cleanup

* Integrate transaction status queue for transparent history

* Fix RawTransactionUnsafe to handle height response correctly

* Migrate to latest revision of librustzcash crates

* Expose transaction_data_requests and set_transaction_status across JNI

* New usage of setTransactionStatus

- Distinct between decryptAndStoreTransaction and setTransactionStatus path by minedHeight
- Convert from RawStatusUnsafe to TransactionStatus
- Add RawTransaction object and related functions
- These changes resolve older issue #1254

* New usage of transactionDataRequests

- New backend.transactionDataRequests and related logic is now used within CompactBlockProcessor
- getTAddressTransactions from LightWalletclient module is now newly used
- These also changes remove now unused querying transactions-related functions from  v_transactions

* Decrypt and store all types of transactions

In case of SpendsFromAddress flow

* Fix passing JniTransactionDataRequest to Kotlin

* Fix ktlint and detekt warnings

* Changelog update

* Code cleanup

* Process SpendsFromAddress on stream

Instead of consuming the stream into list and working with list

* Fix ktlint warnings

* Target latest librustzcash commit

* Move to the latest Rust crates commit

* Change setTransactionStatus trigger

Handle setTransactionStatus by TransactionDataRequest rather then minedHeight

* Fix getTAddressTransactions input range

---------

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

* Update to the latest zcash dependencies

- `zcash_address 0.4`
- `zcash_client_backend 0.13`
- `zcash_client_sqlite 0.11`
- `zcash_primitives 0.16`
- `zcash_proofs 0.16`

* Documentation update

* Fetch transaction error handling

* Update CHANGELOG.md

Co-authored-by: Kris Nuttycombe <[email protected]>

* Fix handling of ``OrphanedBlock` in `RawTransactionUnsafeExt`

---------

Co-authored-by: Honza <[email protected]>
Co-authored-by: Milan <[email protected]>
Co-authored-by: Kris Nuttycombe <[email protected]>
Co-authored-by: Kris Nuttycombe <[email protected]>
  • Loading branch information
5 people authored Aug 21, 2024
1 parent 0bbad5e commit 618e8eb
Show file tree
Hide file tree
Showing 53 changed files with 5,564 additions and 1,154 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,35 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

This release adds several important new features:
- Currency exchange rates (currently just USD/ZEC) are now made available via the SDK.
The exchange rate computed as the median of values provided by at least three separate
cryptocurrency exchanges, and is fetched over Tor connections in order to avoid leaking
the wallet's IP address to the exchanges.
- Sending to ZIP 320 (TEX) addresses is now supported. When sending to a ZIP 320 address,
the wallet will first automatically de-shield the required funds to a fresh ephemeral
transparent address, and then will make a second fully-transparent transaction sending
the funds to the eventual recipient that is not linkable via on-chain information to any
other transaction in the user's wallet.
- As part of adding ZIP 320 support, the SDK now also provides full support for recovering
transparent transaction history. Prior to this release, only transactions belonging to the
wallet that contained either some shielded component OR a member of the current
transparent UTXO set were included in transaction history.

### Changed
- Migrated to Rust 1.80.0.
- `Synchronizer.proposeTransfer` now supports TEX addresses (ZIP 320).
- Internal transactions-enhancing logic has changed to support the history of transactions made to TEX addresses

### Added
- `Synchronizer.isValidTexAddr` which checks whether the given address is a valid ZIP 320 TEX address
- `Synchronizer.exchangeRateUsd` is a `StateFlow` containing the latest USD/ZEC
exchange rate, along with the `Instant` it was fetched. It can be initialized
and refreshed by calling `Synchronizer.refreshExchangeRateUsd()`.
- `ZatoshiExt.toFiatString` is now a public function
- `Synchronizer.getFastestServers([LightWalletEndpoint])` is a flow that measures connections to given endpoints and
returns the three fastest ones
- `Synchronizer.getTAddressTransactions` returns all the transactions for a given t-address over the given range

### Changed
- Checkpoints update
Expand Down
Loading

0 comments on commit 618e8eb

Please sign in to comment.