Skip to content

Commit 5270ee1

Browse files
committed
better docs, fixed typos
1 parent c9bdb70 commit 5270ee1

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

zcash_client_backend/src/data_api/testing/pool.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3203,7 +3203,7 @@ pub fn zip317_spend<T: ShieldedPoolTester, Dsf: DataStoreFactory>(
32033203
// Add funds to the wallet
32043204
st.add_notes([Some(Zatoshis::const_from_u64(50000))]);
32053205

3206-
// Add 10 dust notes to the wallet
3206+
// Add 10 uneconomic (dust) notes to the wallet
32073207
for _ in 1..=10 {
32083208
st.add_notes([Some(Zatoshis::const_from_u64(1000))]);
32093209
}
@@ -4458,8 +4458,6 @@ pub fn scan_cached_blocks_finds_received_notes<T: ShieldedPoolTester, Dsf>(
44584458
);
44594459
}
44604460

4461-
// TODO: This test can probably be entirely removed, as the following test duplicates it entirely.
4462-
// TODO(schell): ^still a valid todo?
44634461
pub fn scan_cached_blocks_finds_change_notes<T: ShieldedPoolTester, Dsf>(
44644462
ds_factory: Dsf,
44654463
cache: impl TestCache,
@@ -4478,14 +4476,6 @@ pub fn scan_cached_blocks_finds_change_notes<T: ShieldedPoolTester, Dsf>(
44784476
// Create a fake CompactBlock sending value to the address
44794477
let value = Zatoshis::const_from_u64(50000);
44804478
let (_, _, nf) = st.add_a_single_note(value);
4481-
// let (received_height, _, nf) =
4482-
// st.generate_next_block(&dfvk, AddressType::DefaultExternal, value);
4483-
4484-
// // Scan the cache
4485-
// st.scan_cached_blocks(received_height, 1);
4486-
4487-
// // Account balance should reflect the received note
4488-
// assert_eq!(st.get_total_balance(account.id()), value);
44894479

44904480
// Create a second fake CompactBlock spending value from the address
44914481
let not_our_key = T::sk_to_fvk(&T::sk(&[0xf5; 32]));

zcash_client_backend/src/data_api/testing/pool/dsl.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ where
9393
/// A proxy for `FakeCompactOutput` that allows test code to omit the `fvk` and
9494
/// `address_type` fields, which can be derived from the `TestState` in most cases.
9595
pub struct TestNoteConfig<T: ShieldedPoolTester> {
96+
/// The amount of the note.
9697
pub value: Zatoshis,
97-
/// Diversifiable full viewing key of
98+
/// Diversifiable full viewing key of the recipient.
9899
pub fvk: Option<T::Fvk>,
100+
/// Address type of the recipient.
99101
pub address_type: Option<AddressType>,
100102
}
101103

@@ -288,7 +290,7 @@ where
288290
///
289291
/// This step also verifies that the test account contains the expected
290292
/// funds as part of the _total_. Keep in mind that these funds may not yet
291-
/// be _spendable_ due to the number confirmations required.
293+
/// be _spendable_ due to the number of confirmations required.
292294
///
293295
/// Returns a summary of steps.
294296
///
@@ -317,8 +319,8 @@ where
317319
.map(|into_note_config| {
318320
let note_config = into_note_config.into();
319321
if note_config.value > zip317::MARGINAL_FEE {
320-
// Don't include dust in the expected total, as the balance
321-
// won't include it.
322+
// Don't include uneconomic (dust) notes in the expected
323+
// total, as the balance won't include them.
322324
expected_total = (expected_total + note_config.value).unwrap();
323325
}
324326
(self.make_fake_output(&note_config), note_config)

0 commit comments

Comments
 (0)