Commit Graph

16 Commits

Author SHA1 Message Date
Jack Grigg 4a37f3976f rust: Migrate to latest upstream Zcash crates 2022-10-15 10:08:04 +13:00
Jack Grigg 88bbd0afcb Use the binary USK format for transaction creation
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-10-06 14:49:04 -04:00
Carter Jernigan 597cc43886 Replace `Synchronizer.getAddress()` with `Synchronizer.getCurrentAddress()`
The SDK now exposes UAs primarily, with additional methods for obtaining
corresponding Sapling and transparent addresses for legacy compatibility.

The `Account` DAO is also fixed to use the migrated `accounts` table format.

The demo app now shows the current UA and the legacy Sapling and transparent
addresses.

Closes zcash/zcash-android-wallet-sdk#677.
2022-10-06 14:49:04 -04:00
Jack Grigg f69cacb9e6 Add `SdkSynchronizer.createAccount()` method
It is currently hidden from the public API, implemented for testing
purposes.
2022-10-06 14:49:04 -04:00
Jack Grigg c6fd783317 Add a `seed` argument to `Synchronizer.Companion.new`
This enables callers to recover from an error that indicates the seed
is needed for a database migration.
2022-10-06 14:49:04 -04:00
Jack Grigg b19ee179c5 Migrate to latest revision of `zcash_primitives` 2022-10-06 14:49:04 -04:00
Jack Grigg 63881dc4e1 cargo fmt 2022-10-06 14:49:04 -04:00
Carter Jernigan 8c8fd57b21 Fix pre-existing typos in error messages
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-08-22 20:57:41 +01:00
Jack Grigg 85e9adce14 [#526] Migrate to `zcash_primitives 0.6` 2022-08-22 20:57:41 +01:00
Jack Grigg 46af668449 [#525] Add `AddressType.Unified` and `Synchronizer.isValidUnifiedAddr` 2022-08-22 20:57:41 +01:00
Jack Grigg cfdd3640a9 [#525] Derive transparent account privkey instead of transparent secret key
We need the transparent account privkey in order to be able to derive
the secret key for any leaf transparent address under the ZIP 316
diversified address tree.
2022-08-22 20:57:41 +01:00
Carter Jernigan f7c9bad367 [#525] Replace UnifiedViewingKey with UnifiedFullViewingKey
UnifiedViewingKey had a bug that made it incompatible with ZIP 316.

For compatibility with the current `zcash/librustzcash` revision we use
a temporary fake UFVK encoding that stores sufficient information to use
the current APIs, and a superset of the actual ZIP 316 FVK information.
2022-08-22 20:57:41 +01:00
Carter Jernigan 9b666833b1
[#474] Add type safe BlockHeight API
- Replace int with type safe BlockHeight(Long) object
 - Fix down casting bug, as BlockHeight is uint32 but Java only supports int32 or int64
 - Rename WalletBirthday to Checkpoint and hide from the public API
2022-07-12 08:40:09 -04:00
Jack Grigg cc29003afb Migrate to `zcash/librustzcash` revision that preserves v5 tx bytes
`decrypt_and_store_transaction` internally serialized transactions, but
the previous commit only added parsing support. Fortunately we already
have the transaction bytes, so to handle this in the short term we can
just pass them through.

Once we have migrated the SDK to latest `zcash/librustzcash` the API
will return to its previous form.
2022-05-25 05:45:43 -04:00
Jack Grigg 41c188109a cargo fmt 2022-05-18 20:48:27 -04:00
Carter Jernigan 2268f814f2 [#255] Refactor Gradle Modules
Move SDK from the root gradle project to its own Gradle module
Move the demo app to be a peer of the SDK

This will simplify integration with CI on Bitrise.
2021-08-31 14:53:25 -04:00