From f7b776005137d1812c660cce9eac61ca957008af Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 13 Sep 2022 21:58:32 +0000 Subject: [PATCH] zcash_client_backend: Add some typedefs for complex types --- zcash_client_backend/src/scan.rs | 4 ++-- zcash_client_backend/src/welding_rig.rs | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/zcash_client_backend/src/scan.rs b/zcash_client_backend/src/scan.rs index dc56833bb..e628850cf 100644 --- a/zcash_client_backend/src/scan.rs +++ b/zcash_client_backend/src/scan.rs @@ -42,6 +42,7 @@ struct OutputIndex { } type OutputReplier = OutputIndex>>>>; +type OutputResult = channel::Receiver>>>; /// A batch of outputs to trial decrypt. struct Batch> { @@ -130,8 +131,7 @@ type ResultKey = (BlockHash, TxId); pub(crate) struct BatchRunner> { batch_size_threshold: usize, acc: Batch, - pending_results: - HashMap>>>>, + pending_results: HashMap>, } impl BatchRunner diff --git a/zcash_client_backend/src/welding_rig.rs b/zcash_client_backend/src/welding_rig.rs index 036a68cb1..f514cd414 100644 --- a/zcash_client_backend/src/welding_rig.rs +++ b/zcash_client_backend/src/welding_rig.rs @@ -177,10 +177,13 @@ pub fn scan_block( ) } +type TaggedBatchRunner = + BatchRunner<(AccountId, S), SaplingDomain

, CompactOutputDescription>; + pub(crate) fn add_block_to_runner( params: &P, block: CompactBlock, - batch_runner: &mut BatchRunner<(AccountId, S), SaplingDomain

, CompactOutputDescription>, + batch_runner: &mut TaggedBatchRunner, ) where P: consensus::Parameters + Send + 'static, S: Clone + Send + 'static, @@ -215,9 +218,7 @@ pub(crate) fn scan_block_with_runner, existing_witnesses: &mut [&mut IncrementalWitness], - mut batch_runner: Option< - &mut BatchRunner<(AccountId, K::Scope), SaplingDomain

, CompactOutputDescription>, - >, + mut batch_runner: Option<&mut TaggedBatchRunner>, ) -> Vec> { let mut wtxs: Vec> = vec![]; let block_height = block.height();