Skip to content

Commit

Permalink
Address comments from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Feb 11, 2025
1 parent 8cd1be4 commit 709b9be
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions zcash_client_sqlite/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub enum SqliteClientError {
/// containing outputs belonging to a previously reserved address has been mined. The error
/// contains the index that could not safely be reserved.
#[cfg(feature = "transparent-inputs")]
ReachedGapLimit(u32, KeyScope),
ReachedGapLimit(KeyScope, u32),

/// The wallet attempted to create a transaction that would use of one of the wallet's
/// previously-used addresses, potentially creating a problem with on-chain transaction
Expand Down Expand Up @@ -187,7 +187,7 @@ impl fmt::Display for SqliteClientError {
SqliteClientError::BalanceError(e) => write!(f, "Balance error: {}", e),
SqliteClientError::NoteFilterInvalid(s) => write!(f, "Could not evaluate filter query: {:?}", s),
#[cfg(feature = "transparent-inputs")]
SqliteClientError::ReachedGapLimit(bad_index, key_scope) => write!(f,
SqliteClientError::ReachedGapLimit(key_scope, bad_index) => write!(f,

Check warning on line 190 in zcash_client_sqlite/src/error.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_sqlite/src/error.rs#L190

Added line #L190 was not covered by tests
"The proposal cannot be constructed until a transaction with outputs to a previously reserved {} address has been mined. \
The address at index {bad_index} could not be safely reserved.",
match key_scope {
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/src/testing/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub(crate) fn send_multi_step_proposed_transfer<T: ShieldedPoolTester>() {
|e, _, expected_bad_index| {
matches!(
e,
crate::error::SqliteClientError::ReachedGapLimit(bad_index, _)
crate::error::SqliteClientError::ReachedGapLimit(_, bad_index)
if bad_index == &expected_bad_index)
},
)
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/src/wallet/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn sqlite_client_error_to_wallet_migration_error(e: SqliteClientError) -> Wallet
unreachable!("we don't call methods that require a known chain height")
}
#[cfg(feature = "transparent-inputs")]
SqliteClientError::ReachedGapLimit(_, _) => {
SqliteClientError::ReachedGapLimit(..) => {
unreachable!("we don't do ephemeral address tracking")
}
SqliteClientError::AddressReuse(_, _) => {
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/src/wallet/transparent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ pub(crate) fn reserve_next_n_addresses<P: consensus::Parameters>(

if addresses_to_reserve.len() < n {

Check warning on line 331 in zcash_client_sqlite/src/wallet/transparent.rs

View check run for this annotation

Codecov / codecov/patch

zcash_client_sqlite/src/wallet/transparent.rs#L331

Added line #L331 was not covered by tests
return Err(SqliteClientError::ReachedGapLimit(
gap_start.index() + gap_limit,
key_scope,
gap_start.index() + gap_limit,
));
}

Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/src/wallet/transparent/ephemeral.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Functikjns for wallet support of ephemeral transparent addresses.
//! Functions for wallet support of ephemeral transparent addresses.
use std::ops::Range;

use rusqlite::{named_params, OptionalExtension};
Expand Down

0 comments on commit 709b9be

Please sign in to comment.