Skip to content

Commit

Permalink
Tracing WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Daira Emma Hopwood <[email protected]>
  • Loading branch information
daira committed Aug 30, 2023
1 parent 6412bb3 commit d18bb52
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions zcash_client_backend/src/data_api/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ where
/// [`sapling::TxProver`]: zcash_primitives::sapling::prover::TxProver
#[allow(clippy::too_many_arguments)]
#[allow(clippy::type_complexity)]
#[tracing::instrument(skip(wallet_db, params, prover, input_selector, ovk_policy))]
pub fn spend<DbT, ParamsT, InputsT>(
wallet_db: &mut DbT,
params: &ParamsT,
Expand Down
1 change: 1 addition & 0 deletions zcash_client_sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ hdwallet = { version = "0.4", optional = true }

# - Logging and metrics
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }

# - Serialization
byteorder = "1"
Expand Down
1 change: 1 addition & 0 deletions zcash_client_sqlite/src/wallet/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl std::error::Error for WalletMigrationError {
// the library that does not support transparent use. It might be a good idea to add an explicit
// check for unspent transparent outputs whenever running initialization with a version of the
// library *not* compiled with the `transparent-inputs` feature flag, and fail if any are present.
#[tracing::instrument(skip_all)]
pub fn init_wallet_db<P: consensus::Parameters + 'static>(
wdb: &mut WalletDb<rusqlite::Connection, P>,
seed: Option<SecretVec<u8>>,
Expand Down
6 changes: 6 additions & 0 deletions zcash_client_sqlite/src/wallet/sapling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,12 @@ pub(crate) mod tests {

#[test]
fn external_address_change_spends_detected_in_restore_from_seed() {
use tracing_subscriber::{fmt, filter, prelude::*};
tracing_subscriber::registry()
.with(fmt::layer())
.with(filter::EnvFilter::from_default_env())
.init();

let mut st = TestBuilder::new().with_block_cache().build();

// Add an account to the wallet
Expand Down

0 comments on commit d18bb52

Please sign in to comment.