Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from ZIP 32 account indices to UUID account identifiers #1640

Merged
merged 47 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9b35832
Switch from ZIP 32 account indices to UUID account identifiers
str4d Nov 22, 2024
56a3858
Rename TransactionRecipient.Account
HonzaR Dec 3, 2024
c66b7ad
Fix `Backend.createAccount` API parameters
HonzaR Dec 4, 2024
5d07455
Add `importAccountUfvk` to the Rust backend.
nuttycom Dec 4, 2024
c8c1b2a
Propagate accountName and keySource across SDK
HonzaR Dec 4, 2024
5c3d1b5
Propagate new importAccount across SDK
HonzaR Dec 5, 2024
32e68e3
Wrap createAccount setup information
HonzaR Dec 5, 2024
cdfdbc9
Wrap importAccount setup information
HonzaR Dec 5, 2024
1cfba57
WIP: Add key derivation metadata to JniAccount
nuttycom Dec 6, 2024
7efea35
Fix JniAccount
HonzaR Dec 6, 2024
c1d2ff8
Use updated JniAccount across SDK
HonzaR Dec 6, 2024
ee27c0e
Several tests fix
HonzaR Dec 8, 2024
d87c5bd
Add `Zip32AccountIndex` wrapper
HonzaR Dec 9, 2024
d2b4d1f
Update key source parameter
HonzaR Dec 9, 2024
e4ffb26
Merge branch 'feature-2.2.7' into account-uuids
HonzaR Dec 9, 2024
02e1569
Remove account from `UnifiedSpendingKey`
HonzaR Dec 9, 2024
8823694
Fix `importAccountByUfvk` API
HonzaR Dec 9, 2024
922eb0e
Remove account_uuid from `JniUnifiedSpendingKey` creation
HonzaR Dec 9, 2024
7a95e23
Fixture fix
HonzaR Dec 9, 2024
89b06e4
Refactor Account.accountUuid to wrapper class
HonzaR Dec 9, 2024
d9482b1
Revert "Remove account_uuid from `JniUnifiedSpendingKey` creation"
HonzaR Dec 10, 2024
f669645
Add `JniAccountUsk`
HonzaR Dec 10, 2024
63a9a54
Add `seedFingerprint` and `zip32AccountIndex`
HonzaR Dec 10, 2024
fe653d4
Transactions by account UUID
HonzaR Dec 10, 2024
52f5b28
Refactor default account creation
HonzaR Dec 10, 2024
0909a73
Migrate to Rust crate revision with bugfix to account UUID migration
str4d Dec 10, 2024
477c933
Migrate to Rust crate revision with another bugfix to account UUID mi…
str4d Dec 10, 2024
d299b21
Test fix
HonzaR Dec 11, 2024
3c74069
Migrate to Rust crate revision with a third bugfix to account UUID mi…
str4d Dec 11, 2024
e54fb17
Self-review fixes
HonzaR Dec 11, 2024
51f5cd4
Tests fix
HonzaR Dec 11, 2024
c9bc790
Changelog update
HonzaR Dec 11, 2024
8b558f7
Update backend-lib/src/main/rust/lib.rs
HonzaR Dec 11, 2024
105da9d
Update backend-lib/src/main/rust/lib.rs
HonzaR Dec 11, 2024
0b603e2
Changelog update
HonzaR Dec 11, 2024
c68be81
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/Synchronizer.kt
HonzaR Dec 11, 2024
d07857c
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/Typesafe…
HonzaR Dec 11, 2024
0fae465
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/Typesafe…
HonzaR Dec 11, 2024
f78ed39
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/Typesafe…
HonzaR Dec 11, 2024
b59e768
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/Typesafe…
HonzaR Dec 11, 2024
e01773e
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/Typesafe…
HonzaR Dec 11, 2024
840df94
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/AccountImpo…
HonzaR Dec 11, 2024
07f357e
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/AccountCrea…
HonzaR Dec 11, 2024
a03ae02
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/Account.kt
HonzaR Dec 11, 2024
cb8036d
Update sdk-lib/src/main/java/cash/z/ecc/android/sdk/SdkSynchronizer.kt
HonzaR Dec 11, 2024
e07d65d
Refactor inputs of `importAccountUfvk`
HonzaR Dec 11, 2024
7a064ec
Use `FirsClassByteArray` for `seed` parameter
HonzaR Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cash.z.ecc.android.sdk.internal.db.derived
import androidx.sqlite.db.SupportSQLiteDatabase
import cash.z.ecc.android.sdk.internal.db.queryAndMap
import cash.z.ecc.android.sdk.internal.model.OutputProperties
import cash.z.ecc.android.sdk.model.Account
import cash.z.ecc.android.sdk.model.FirstClassByteArray
import cash.z.ecc.android.sdk.model.TransactionRecipient
import java.util.Locale
Expand Down Expand Up @@ -73,9 +72,9 @@ internal class TxOutputsView(private val sqliteDatabase: SupportSQLiteDatabase)
if (!it.isNull(toAccountIndex)) {
// TODO [#1644]: Refactor Account ZIP32 index across SDK
// TODO [#1644]: https://github.com/Electric-Coin-Company/zcash-android-wallet-sdk/issues/1644
TransactionRecipient.Account(0)
TransactionRecipient.RecipientAccount(it.getInt(toAccountIndex))
} else {
TransactionRecipient.Address(it.getString(toAddressIndex))
TransactionRecipient.RecipientAddress(it.getString(toAddressIndex))
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ internal class OutboundTransactionManagerImpl(
memo.toByteArray()
}
return when (recipient) {
is TransactionRecipient.Account -> {
is TransactionRecipient.RecipientAccount -> {
encoder.createShieldingTransaction(
usk,
recipient,
memoBytes
)
}
is TransactionRecipient.Address -> {
is TransactionRecipient.RecipientAddress -> {
encoder.createTransaction(
usk,
amount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal class TransactionEncoderImpl(
recipient: TransactionRecipient,
memo: ByteArray?
): EncodedTransaction {
require(recipient is TransactionRecipient.Address)
require(recipient is TransactionRecipient.RecipientAddress)

val transactionId = createSpend(usk, amount, recipient.addressValue, memo)
return repository.findEncodedTransactionByTxId(transactionId)
Expand All @@ -63,7 +63,7 @@ internal class TransactionEncoderImpl(
recipient: TransactionRecipient,
memo: ByteArray?
): EncodedTransaction {
require(recipient is TransactionRecipient.Account)
require(recipient is TransactionRecipient.RecipientAccount)

val transactionId = createShieldingSpend(usk, memo)
return repository.findEncodedTransactionByTxId(transactionId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ data class PendingTransaction internal constructor(
}

sealed class TransactionRecipient {
data class Address(val addressValue: String) : TransactionRecipient() {
data class RecipientAddress(val addressValue: String) : TransactionRecipient() {
override fun toString() = "TransactionRecipient.Address"
}

data class Account(val accountId: Int) : TransactionRecipient() {
data class RecipientAccount(val accountValue: cash.z.ecc.android.sdk.model.Account) : TransactionRecipient() {
override fun toString() = "TransactionRecipient.Account"
}

Expand Down
Loading