diff --git a/zcash_client_memory/src/types/account.rs b/zcash_client_memory/src/types/account.rs index b4ff8dacff..e332766f84 100644 --- a/zcash_client_memory/src/types/account.rs +++ b/zcash_client_memory/src/types/account.rs @@ -244,6 +244,7 @@ impl Account { (current_addr, current_idx) = self.uivk().find_address(current_idx, request)?; addrs.push((current_addr.clone(), current_idx)); } + addrs .into_iter() .filter_map(|(addr, idx)| addr.transparent().map(|taddr| (*taddr, idx))) diff --git a/zcash_client_memory/src/wallet_read.rs b/zcash_client_memory/src/wallet_read.rs index 229bd174e9..cd9d1a9611 100644 --- a/zcash_client_memory/src/wallet_read.rs +++ b/zcash_client_memory/src/wallet_read.rs @@ -6,6 +6,7 @@ use shardtree::store::ShardStore as _; use std::{ collections::{hash_map::Entry, HashMap}, num::NonZeroU32, + ops::Range, }; use zcash_keys::keys::UnifiedIncomingViewingKey; use zip32::fingerprint::SeedFingerprint; @@ -644,8 +645,10 @@ impl WalletRead for MemoryWalletDb

{ account_id: Self::AccountId, ) -> Result>, Self::Error> { tracing::debug!("get_transparent_receivers"); - - Ok(HashMap::new()) + self.accounts + .get(account_id) + .map(Account::get_transparent_receivers) + .ok_or_else(|| Error::AccountUnknown(account_id))? } #[cfg(feature = "transparent-inputs")] @@ -658,6 +661,25 @@ impl WalletRead for MemoryWalletDb

{ todo!() } + #[cfg(feature = "transparent-inputs")] + fn get_known_ephemeral_addresses( + &self, + account_id: Self::AccountId, + index_range: Option>, + ) -> Result, Self::Error> { + let ret = self.get_transparent_receivers(account_id)?; + let ret = ret + .into_iter() + .filter_map(|(addr, meta)| meta.map(|m| (addr, m))); + if let Some(range) = index_range { + Ok(ret + .filter(|(_, meta)| range.contains(&meta.address_index().index())) + .collect()) + } else { + Ok(ret.collect()) + } + } + fn transaction_data_requests(&self) -> Result, Self::Error> { tracing::debug!("transaction_data_requests"); todo!()