-
Notifications
You must be signed in to change notification settings - Fork 252
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
zcash_client_sqlite: Assign UUIDs to each account #1631
base: main
Are you sure you want to change the base?
Conversation
I discovered that the Android SDK is misusing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK with comments.
c8aff5b
to
bf42ec2
Compare
Force-pushed to replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK with this suggestion: https://github.com/zcash/librustzcash/pull/1631/files#r1855319372
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to make this change, we should do so wholesale: replace the contents of the AccountId
type with the UUID, and change all the queries to take the UUID (and join to the accounts
table if necessary).
4885b4d
to
03e68c6
Compare
|
||
st.reset(); | ||
|
||
// Account creation and DFVK derivation should be deterministic. | ||
let (_, restored_usk) = st.wallet_mut().create_account(&seed, &birthday).unwrap(); | ||
let (account1, restored_usk) = st.wallet_mut().create_account(&seed, &birthday).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is necessary because we get new account UUIDs when we regenerate the wallet.
…`AccountUuid` This requires a few annoying changes to migrations in order to avoid hitting cases where account UUIDs are expected before they exist in the database schema.
03e68c6
to
546481e
Compare
This is now consistent with how we name other internal primary key type wrappers.
This provides equivalent uniqueness to the
accounts
table primary key, but avoids collisions across wallet recreation events (to defend against downstream crate users who don't flush any persisted account IDs at those events).Closes #1629.