Skip to content

Commit

Permalink
rebased block cache on main
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar-Pepper committed Mar 4, 2024
1 parent 0edcea2 commit 523b152
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
1 change: 0 additions & 1 deletion zcash_client_backend/src/data_api/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ use crate::{
pub mod error;
use error::Error;

use super::scanning::ScanRange;
use super::WalletRead;

/// A struct containing metadata about a subtree root of the note commitment tree.
Expand Down
36 changes: 5 additions & 31 deletions zcash_client_backend/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ where
))
}

<<<<<<< HEAD
/// Check for spent notes. The comparison against known-unspent nullifiers is done
/// in constant time.
fn find_spent<
Expand Down Expand Up @@ -1127,14 +1126,10 @@ fn find_received<

#[cfg(any(test, feature = "test-dependencies"))]
pub mod testing {

use std::convert::Infallible;

use group::{
ff::{Field, PrimeField},
GroupEncoding,
};
use incrementalmerkletree::{Position, Retention};
use rand_core::{OsRng, RngCore};
use sapling::{
constants::SPENDING_KEY_GENERATOR,
Expand All @@ -1144,26 +1139,18 @@ pub mod testing {
zip32::DiversifiableFullViewingKey,
Nullifier,
};
use zcash_keys::keys::UnifiedSpendingKey;
use zcash_note_encryption::{Domain, COMPACT_NOTE_SIZE};
use zcash_primitives::{
block::BlockHash,
consensus::{sapling_zip212_enforcement, BlockHeight, Network},
memo::MemoBytes,
transaction::components::amount::NonNegativeAmount,
zip32::AccountId,
};

use crate::{
data_api::BlockMetadata,
proto::compact_formats::{
self as compact, CompactBlock, CompactSaplingOutput, CompactSaplingSpend, CompactTx,
},
scanning::{BatchRunners, ScanningKeys},
use crate::proto::compact_formats::{
self as compact, CompactBlock, CompactSaplingOutput, CompactSaplingSpend, CompactTx,
};

use super::{scan_block, scan_block_with_runners, Nullifiers};

fn random_compact_tx(mut rng: impl RngCore) -> CompactTx {
let fake_nf = {
let mut nf = vec![0; 32];
Expand Down Expand Up @@ -1289,34 +1276,21 @@ mod tests {
use std::convert::Infallible;

use incrementalmerkletree::{Position, Retention};
use rand_core::{OsRng, RngCore};
use sapling::{
constants::SPENDING_KEY_GENERATOR,
note_encryption::{sapling_note_encryption, SaplingDomain},
util::generate_random_rseed,
value::NoteValue,
zip32::DiversifiableFullViewingKey,
Nullifier,
};
use sapling::Nullifier;
use zcash_keys::keys::UnifiedSpendingKey;
use zcash_note_encryption::{Domain, COMPACT_NOTE_SIZE};
use zcash_primitives::{
block::BlockHash,
consensus::{sapling_zip212_enforcement, BlockHeight, Network},
memo::MemoBytes,
consensus::{BlockHeight, Network},
transaction::components::amount::NonNegativeAmount,
zip32::AccountId,
};

use crate::{
data_api::BlockMetadata,
proto::compact_formats::{
self as compact, CompactBlock, CompactSaplingOutput, CompactSaplingSpend, CompactTx,
},
scanning::{BatchRunners, ScanningKeys},
};

use super::{scan_block, scan_block_with_runners, Nullifiers};
use super::{scan_block, scan_block_with_runners, testing::fake_compact_block, Nullifiers};

#[test]
fn scan_block_with_my_tx() {
Expand Down

0 comments on commit 523b152

Please sign in to comment.