-
Notifications
You must be signed in to change notification settings - Fork 253
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?
Changes from all commits
45392cf
fd5bb46
bf42ec2
546481e
6e1933b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,8 +11,7 @@ | |||||
use zcash_primitives::zip32; | ||||||
use zcash_primitives::{consensus::BlockHeight, transaction::components::amount::BalanceError}; | ||||||
|
||||||
use crate::wallet::commitment_tree; | ||||||
use crate::AccountId; | ||||||
use crate::{wallet::commitment_tree, AccountUuid}; | ||||||
|
||||||
#[cfg(feature = "transparent-inputs")] | ||||||
use { | ||||||
|
@@ -79,7 +78,7 @@ | |||||
|
||||||
/// The account being added collides with an existing account in the wallet with the given ID. | ||||||
/// The collision can be on the seed and ZIP-32 account index, or a shared FVK component. | ||||||
AccountCollision(AccountId), | ||||||
AccountCollision(AccountUuid), | ||||||
|
||||||
/// The account was imported, and ZIP-32 derivation information is not known for it. | ||||||
UnknownZip32Derivation, | ||||||
|
@@ -90,12 +89,8 @@ | |||||
/// An error occurred while processing an account due to a failure in deriving the account's keys. | ||||||
BadAccountData(String), | ||||||
|
||||||
/// A caller attempted to initialize the accounts table with a discontinuous | ||||||
/// set of account identifiers. | ||||||
AccountIdDiscontinuity, | ||||||
|
||||||
/// A caller attempted to construct a new account with an invalid account identifier. | ||||||
AccountIdOutOfRange, | ||||||
/// A caller attempted to construct a new account with an invalid ZIP 32 account identifier. | ||||||
Zip32AccountIndexOutOfRange, | ||||||
|
||||||
/// The address associated with a record being inserted was not recognized as | ||||||
/// belonging to the wallet. | ||||||
|
@@ -129,7 +124,7 @@ | |||||
/// ephemeral address outputs have been mined. The parameters are the account id and | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Also |
||||||
/// the index that could not safely be reserved. | ||||||
#[cfg(feature = "transparent-inputs")] | ||||||
ReachedGapLimit(AccountId, u32), | ||||||
ReachedGapLimit(AccountUuid, u32), | ||||||
|
||||||
/// An ephemeral address would be reused. The parameters are the address in string | ||||||
/// form, and the txid of the earliest transaction in which it is known to have been | ||||||
|
@@ -181,8 +176,7 @@ | |||||
SqliteClientError::UnknownZip32Derivation => write!(f, "ZIP-32 derivation information is not known for this account."), | ||||||
SqliteClientError::KeyDerivationError(acct_id) => write!(f, "Key derivation failed for account {}", u32::from(*acct_id)), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
SqliteClientError::BadAccountData(e) => write!(f, "Failed to add account: {}", e), | ||||||
SqliteClientError::AccountIdDiscontinuity => write!(f, "Wallet account identifiers must be sequential."), | ||||||
SqliteClientError::AccountIdOutOfRange => write!(f, "Wallet account identifiers must be less than 0x7FFFFFFF."), | ||||||
SqliteClientError::Zip32AccountIndexOutOfRange => write!(f, "ZIP 32 account identifiers must be less than 0x7FFFFFFF."), | ||||||
SqliteClientError::AccountCollision(id) => write!(f, "An account corresponding to the data provided already exists in the wallet with internal identifier {}.", id.0), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(probably needs a rustfmt) |
||||||
#[cfg(feature = "transparent-inputs")] | ||||||
SqliteClientError::AddressNotRecognized(_) => write!(f, "The address associated with a received txo is not identifiable as belonging to the wallet."), | ||||||
|
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.