Skip to content

Commit

Permalink
cargo fmt and cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
pacu committed Nov 5, 2024
1 parent b1c188f commit 0bf347e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions zcash_client_backend/src/data_api/testing/transparent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use zcash_protocol::local_consensus::LocalNetwork;

use super::TestAccount;
/// checks whether the transparent balance of the given test [`account`] is as [`expected`]
/// considering the [`min_confirmations`]. It is assumed that zero or one [`min_confirmations`]
/// considering the [`min_confirmations`]. It is assumed that zero or one [`min_confirmations`]
/// are treated the same so this function also checks the other case when 1 or 0 [`min_confirmations`]
/// are passed as arguments.
fn check_balance<DSF>(
Expand Down Expand Up @@ -66,8 +66,8 @@ fn check_balance<DSF>(
Some(expected.spendable_value()),
);

// we currently treat min_confirmations the same regardless they are 0 (zero confirmations)
// or 1 (one block confirmation). We will check if this assumption holds until it's no
// we currently treat min_confirmations the same regardless they are 0 (zero confirmations)
// or 1 (one block confirmation). We will check if this assumption holds until it's no
// longer made. If zero and one [`min_confirmations`] are treated differently in the future,
// this check should then be removed.
if min_confirmations == 0 || min_confirmations == 1 {
Expand All @@ -81,7 +81,6 @@ fn check_balance<DSF>(
Some(expected.spendable_value()),
);
}

}

pub fn put_received_transparent_utxo<DSF>(dsf: DSF)
Expand Down Expand Up @@ -355,14 +354,14 @@ where

// Add one extra block
st.generate_empty_block();

// Scan that block
st.scan_cached_blocks(height, 1);

// now we generate one more block and the balance should be the same as when the
// check_balance function was called with zero or one confirmation.
st.generate_empty_block();
st.scan_cached_blocks(height + 1 , 1);
st.scan_cached_blocks(height + 1, 1);

check_balance::<DSF>(&st, &account, taddr, 2, &zero_or_one_conf_value);
}

0 comments on commit 0bf347e

Please sign in to comment.