diff --git a/zingo-memo/src/lib.rs b/zingo-memo/src/lib.rs index b7bf6cec7..8502f3537 100644 --- a/zingo-memo/src/lib.rs +++ b/zingo-memo/src/lib.rs @@ -31,7 +31,7 @@ pub enum ParsedMemo { /// the list of unified addresses uas: Vec, /// The ephemeral address indexes - ephemeral_address_indexes: Vec, + rejection_address_indexes: Vec, }, } @@ -99,7 +99,7 @@ pub fn parse_zingo_memo(memo: [u8; 511]) -> io::Result { }), 1 => Ok(ParsedMemo::Version1 { uas: Vector::read(&mut reader, |r| read_unified_address_from_raw_encoding(r))?, - ephemeral_address_indexes: Vector::read(&mut reader, |r| CompactSize::read_t(r))?, + rejection_address_indexes: Vector::read(&mut reader, |r| CompactSize::read_t(r))?, }), _ => Err(io::Error::new( io::ErrorKind::InvalidData, diff --git a/zingolib/src/blaze/fetch_taddr_transactions.rs b/zingolib/src/blaze/fetch_taddr_transactions.rs index 08e05218a..9c0fada94 100644 --- a/zingolib/src/blaze/fetch_taddr_transactions.rs +++ b/zingolib/src/blaze/fetch_taddr_transactions.rs @@ -50,7 +50,7 @@ impl FetchTaddrTransactions { .iter() .filter_map(|ua| ua.transparent()) .chain( - wc.transparent_child_ephemeral_addresses() + wc.get_rejection_addresses() .iter() .map(|(taddr, _metadata)| taddr), ) diff --git a/zingolib/src/wallet.rs b/zingolib/src/wallet.rs index 76133036c..983bf7083 100644 --- a/zingolib/src/wallet.rs +++ b/zingolib/src/wallet.rs @@ -383,8 +383,8 @@ impl LightWallet { let transaction_metadata_set = if wc.unified_key_store().is_spending_key() { Arc::new(RwLock::new(TxMap::new_with_witness_trees( wc.transparent_child_addresses().clone(), - wc.transparent_child_ephemeral_addresses().clone(), - wc.ephemeral_ivk().map_err(|e| { + wc.get_rejection_addresses().clone(), + wc.rejection_ivk().map_err(|e| { Error::new( ErrorKind::InvalidData, format!("Error with transparent key: {e}"), diff --git a/zingolib/src/wallet/data.rs b/zingolib/src/wallet/data.rs index 41af97d7a..01b5c1781 100644 --- a/zingolib/src/wallet/data.rs +++ b/zingolib/src/wallet/data.rs @@ -790,8 +790,8 @@ pub mod summaries { Shield, /// The recipient is the creator and is receiving at least 1 note with a TEXT memo MemoToSelf, - /// The recipient is an ephemeral 320 address - Ephemeral320, + /// The recipient is an "ephemeral" 320 address + Rejection, } impl std::fmt::Display for ValueTransferKind { @@ -804,7 +804,7 @@ pub mod summaries { SelfSendValueTransfer::Basic => write!(f, "basic"), SelfSendValueTransfer::Shield => write!(f, "shield"), SelfSendValueTransfer::MemoToSelf => write!(f, "memo-to-self"), - SelfSendValueTransfer::Ephemeral320 => write!(f, "ephemeral-320-tex"), + SelfSendValueTransfer::Rejection => write!(f, "rejection"), }, }, } @@ -1994,15 +1994,15 @@ impl WalletZecPriceInfo { } } -/// Generate a new ephemeral transparent address, +/// Generate a new rejection address, /// for use in a send to a TEX address. -pub fn new_persistent_ephemeral_address( - transparent_child_ephemeral_addresses: &append_only_vec::AppendOnlyVec<( +pub fn new_rejection_address( + rejection_addresses: &append_only_vec::AppendOnlyVec<( TransparentAddress, TransparentAddressMetadata, )>, - transparent_ephemeral_ivk: &zcash_primitives::legacy::keys::EphemeralIvk, + rejection_ivk: &zcash_primitives::legacy::keys::EphemeralIvk, ) -> Result< ( zcash_primitives::legacy::TransparentAddress, @@ -2010,12 +2010,13 @@ pub fn new_persistent_ephemeral_address( ), super::error::KeyError, > { - let (ephemeral_address, metadata) = super::keys::unified::WalletCapability::ephemeral_address( - transparent_ephemeral_ivk, - transparent_child_ephemeral_addresses.len() as u32, - )?; - transparent_child_ephemeral_addresses.push((ephemeral_address, metadata.clone())); - Ok((ephemeral_address, metadata)) + let (rejection_address, metadata) = + super::keys::unified::WalletCapability::get_rejection_address_by_index( + rejection_ivk, + rejection_addresses.len() as u32, + )?; + rejection_addresses.push((rejection_address, metadata.clone())); + Ok((rejection_address, metadata)) } #[test] diff --git a/zingolib/src/wallet/disk.rs b/zingolib/src/wallet/disk.rs index 04a5c6d92..83ec456bc 100644 --- a/zingolib/src/wallet/disk.rs +++ b/zingolib/src/wallet/disk.rs @@ -38,7 +38,7 @@ use super::{ impl LightWallet { /// Changes in version 30: - /// - New WalletCapability version (v4) which implements read/write for ephemeral addresses + /// - New WalletCapability version (v4) which implements read/write for rejection addresses pub const fn serialized_version() -> u64 { 30 } diff --git a/zingolib/src/wallet/keys/unified.rs b/zingolib/src/wallet/keys/unified.rs index 87dccafb7..75a7b96a8 100644 --- a/zingolib/src/wallet/keys/unified.rs +++ b/zingolib/src/wallet/keys/unified.rs @@ -21,10 +21,7 @@ use zcash_client_backend::address::UnifiedAddress; use zcash_client_backend::keys::{Era, UnifiedSpendingKey}; use zcash_client_backend::wallet::TransparentAddressMetadata; use zcash_encoding::{CompactSize, Vector}; -use zcash_keys::{ - encoding::AddressCodec, - keys::{DerivationError, UnifiedFullViewingKey}, -}; +use zcash_keys::keys::{DerivationError, UnifiedFullViewingKey}; use zcash_primitives::consensus::{NetworkConstants, Parameters}; use zcash_primitives::legacy::{ keys::{AccountPubKey, IncomingViewingKey, NonHardenedChildIndex}, @@ -36,7 +33,7 @@ use crate::wallet::error::KeyError; use crate::wallet::traits::{DomainWalletExt, ReadableWriteable, Recipient}; use crate::{ config::{ChainType, ZingoConfig}, - wallet::data::new_persistent_ephemeral_address, + wallet::data::new_rejection_address, }; use super::legacy::{generate_transparent_address_from_legacy_key, legacy_sks_to_usk, Capability}; @@ -234,8 +231,7 @@ pub struct WalletCapability { transparent_child_addresses: Arc>, // TODO: read/write for ephmereral addresses // TODO: Remove this field and exclusively use the TxMap field instead - transparent_child_ephemeral_addresses: - Arc>, + rejection_addresses: Arc>, /// Cache of unified_addresses unified_addresses: append_only_vec::AppendOnlyVec, addresses_write_lock: AtomicBool, @@ -245,7 +241,7 @@ impl Default for WalletCapability { Self { unified_key_store: UnifiedKeyStore::Empty, transparent_child_addresses: Arc::new(AppendOnlyVec::new()), - transparent_child_ephemeral_addresses: Arc::new(AppendOnlyVec::new()), + rejection_addresses: Arc::new(AppendOnlyVec::new()), unified_addresses: AppendOnlyVec::new(), addresses_write_lock: AtomicBool::new(false), } @@ -584,16 +580,9 @@ impl WalletCapability { .collect() } - pub(crate) fn get_ephemeral_taddrs(&self, chain: &crate::config::ChainType) -> HashSet { - self.transparent_child_ephemeral_addresses - .iter() - .map(|(transparent_address, _metadata)| transparent_address.encode(chain)) - .collect() - } - pub(crate) fn get_taddrs(&self, chain: &crate::config::ChainType) -> HashSet { self.get_external_taddrs(chain) - .union(&self.get_ephemeral_taddrs(chain)) + .union(&self.get_rejection_address_set(chain)) .cloned() .collect() } @@ -642,13 +631,13 @@ impl ReadableWriteable for WalletCapability { fn read(mut reader: R, input: ChainType) -> io::Result { let version = Self::get_version(&mut reader)?; let legacy_key: bool; - let ephemeral_addresses_len: u32; + let length_of_rejection_addresses: u32; let wc = match version { // in version 1, only spending keys are stored 1 => { legacy_key = true; - ephemeral_addresses_len = 0; + length_of_rejection_addresses = 0; // Create a temporary USK for address generation to load old wallets // due to missing BIP0032 transparent extended private key data @@ -667,7 +656,7 @@ impl ReadableWriteable for WalletCapability { } 2 => { legacy_key = true; - ephemeral_addresses_len = 0; + length_of_rejection_addresses = 0; let orchard_capability = Capability::< orchard::keys::FullViewingKey, @@ -758,7 +747,7 @@ impl ReadableWriteable for WalletCapability { } 3 => { legacy_key = false; - ephemeral_addresses_len = 0; + length_of_rejection_addresses = 0; Self { unified_key_store: UnifiedKeyStore::read(&mut reader, input)?, @@ -767,7 +756,7 @@ impl ReadableWriteable for WalletCapability { } 4 => { legacy_key = false; - ephemeral_addresses_len = reader.read_u32::()?; + length_of_rejection_addresses = reader.read_u32::()?; Self { unified_key_store: UnifiedKeyStore::read(&mut reader, input)?, @@ -787,10 +776,10 @@ impl ReadableWriteable for WalletCapability { .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; } - for _ in 0..ephemeral_addresses_len { - new_persistent_ephemeral_address( - &wc.transparent_child_ephemeral_addresses, - &wc.ephemeral_ivk() + for _ in 0..length_of_rejection_addresses { + new_rejection_address( + &wc.rejection_addresses, + &wc.rejection_ivk() .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?, ) .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; @@ -801,7 +790,7 @@ impl ReadableWriteable for WalletCapability { fn write(&self, mut writer: W, input: ChainType) -> io::Result<()> { writer.write_u8(Self::VERSION)?; - writer.write_u32::(self.transparent_child_ephemeral_addresses.len() as u32)?; + writer.write_u32::(self.rejection_addresses.len() as u32)?; self.unified_key_store().write(&mut writer, input)?; Vector::write( &mut writer, @@ -908,12 +897,12 @@ impl Fvk for sapling_crypto::zip32::DiversifiableFullViewingKey { } } } -mod ephemeral { - use std::sync::Arc; +mod rejection { + use std::{collections::HashSet, sync::Arc}; use append_only_vec::AppendOnlyVec; use zcash_client_backend::wallet::TransparentAddressMetadata; - use zcash_keys::keys::DerivationError; + use zcash_keys::{encoding::AddressCodec, keys::DerivationError}; use zcash_primitives::legacy::{ keys::{AccountPubKey, NonHardenedChildIndex, TransparentKeyScope}, TransparentAddress, @@ -924,7 +913,7 @@ mod ephemeral { use super::WalletCapability; impl WalletCapability { - pub(crate) fn ephemeral_ivk( + pub(crate) fn rejection_ivk( &self, ) -> Result { AccountPubKey::try_from(self.unified_key_store())? @@ -932,14 +921,14 @@ mod ephemeral { .map_err(DerivationError::Transparent) .map_err(KeyError::KeyDerivationError) } - pub(crate) fn ephemeral_address( - ephemeral_ivk: &zcash_primitives::legacy::keys::EphemeralIvk, - ephemeral_address_index: u32, + pub(crate) fn get_rejection_address_by_index( + rejection_ivk: &zcash_primitives::legacy::keys::EphemeralIvk, + rejection_address_index: u32, ) -> Result<(TransparentAddress, TransparentAddressMetadata), KeyError> { - let address_index = NonHardenedChildIndex::from_index(ephemeral_address_index) + let address_index = NonHardenedChildIndex::from_index(rejection_address_index) .ok_or(KeyError::InvalidNonHardenedChildIndex)?; Ok(( - ephemeral_ivk + rejection_ivk .derive_ephemeral_address(address_index) .map_err(DerivationError::Transparent) .map_err(KeyError::KeyDerivationError)?, @@ -947,10 +936,19 @@ mod ephemeral { )) } /// TODO: Add Doc Comment Here! - pub fn transparent_child_ephemeral_addresses( + pub fn get_rejection_addresses( &self, ) -> &Arc> { - &self.transparent_child_ephemeral_addresses + &self.rejection_addresses + } + pub(crate) fn get_rejection_address_set( + &self, + chain: &crate::config::ChainType, + ) -> HashSet { + self.rejection_addresses + .iter() + .map(|(transparent_address, _metadata)| transparent_address.encode(chain)) + .collect() } } } diff --git a/zingolib/src/wallet/propose.rs b/zingolib/src/wallet/propose.rs index f7b342bd3..c03c5f4eb 100644 --- a/zingolib/src/wallet/propose.rs +++ b/zingolib/src/wallet/propose.rs @@ -95,12 +95,9 @@ impl LightWallet { &self, request: TransactionRequest, ) -> Result { - let num_ephemeral_addresses = self - .transaction_context - .key - .transparent_child_ephemeral_addresses() - .len() as u32; - let memo = change_memo_from_transaction_request(&request, num_ephemeral_addresses); + let number_of_rejection_addresses = + self.transaction_context.key.get_rejection_addresses().len() as u32; + let memo = change_memo_from_transaction_request(&request, number_of_rejection_addresses); let input_selector = build_default_giskit(Some(memo)); let mut tmamt = self diff --git a/zingolib/src/wallet/send.rs b/zingolib/src/wallet/send.rs index 4707f622a..eb802fa30 100644 --- a/zingolib/src/wallet/send.rs +++ b/zingolib/src/wallet/send.rs @@ -189,10 +189,10 @@ impl LightWallet { // TODO: move to a more suitable place pub(crate) fn change_memo_from_transaction_request( request: &TransactionRequest, - mut num_ephemeral_addresses: u32, + mut number_of_rejection_addresses: u32, ) -> MemoBytes { let mut recipient_uas = Vec::new(); - let mut ephemeral_address_indexes = Vec::new(); + let mut rejection_address_indexes = Vec::new(); for payment in request.payments().values() { match payment.recipient_address().kind() { AddressKind::Unified(ua) => { @@ -201,16 +201,16 @@ pub(crate) fn change_memo_from_transaction_request( } } AddressKind::Tex(_) => { - ephemeral_address_indexes.push(num_ephemeral_addresses); + rejection_address_indexes.push(number_of_rejection_addresses); - num_ephemeral_addresses += 1; + number_of_rejection_addresses += 1; } _ => (), } } let uas_bytes = match create_wallet_internal_memo_version_1( recipient_uas.as_slice(), - ephemeral_address_indexes.as_slice(), + rejection_address_indexes.as_slice(), ) { Ok(bytes) => bytes, Err(e) => { diff --git a/zingolib/src/wallet/transaction_context.rs b/zingolib/src/wallet/transaction_context.rs index 1c10ac84a..802398f9c 100644 --- a/zingolib/src/wallet/transaction_context.rs +++ b/zingolib/src/wallet/transaction_context.rs @@ -293,7 +293,7 @@ mod decrypt_transaction { fn identify_rejection_address(&self, spent_utxo: TransparentOutput) -> Option { if self .key - .get_ephemeral_taddrs(&self.config.chain) + .get_rejection_address_set(&self.config.chain) .contains(&spent_utxo.address) { Some(spent_utxo.address) @@ -314,11 +314,10 @@ mod decrypt_transaction { { // We are the authors of the 320 transactions (that we care about), therefore - // we have the transaction that encumbered the (misanmed) "ephemeral" taddr - // with funds. - // We backtrack from the vins of every transaction to check for "ephemeral" addresses + // we have the transaction that encumbered the rejection address with funds. + // We backtrack from the vins of every transaction to check for rejection addresses // (from zingomemo), to determine if a given vin is the source of funds for a "tex" - // address. That is, we know the ephemeral taddrs, we simply need to check if they are + // address. That is, we know the rejection addresses, we simply need to check if they are // the receiver in a given transaction. If the are then, their spend identifies a tex. if let Some(t_bundle) = transaction.transparent_bundle() { for vin in t_bundle.vin.iter() { @@ -629,7 +628,7 @@ mod decrypt_transaction { outgoing_metadatas: &mut Vec, sent_to_tex: bool, ) { - // TODO: Account for ephemeral_taddresses + // TODO: Account for rejection addresses // Collect our t-addresses for easy checking let taddrs_set = self.key.get_taddrs(&self.config.chain); let tx_map = self.transaction_metadata_set.write().await; @@ -652,7 +651,7 @@ mod decrypt_transaction { TransparentAddress::ScriptHash(_taddr_bytes) => { // tex addresses are P2PKH only. If this is a script hash, then we were wrong about // it being a tex. - todo!("This happens if someone mislabels in a zingomemo, or zingolib logic an address as \"ephemeral\".");}, + todo!("This happens if someone mislabels in a zingomemo, or zingolib logic an address as \"rejection\".");}, }, } }) { @@ -685,7 +684,7 @@ mod decrypt_transaction { #[derive(Debug)] pub(crate) enum InvalidMemoError { #[allow(dead_code)] - InvalidEphemeralIndex(KeyError), + InvalidRejectionAddress(KeyError), } impl TransactionContext { async fn handle_uas( @@ -719,28 +718,28 @@ mod decrypt_transaction { &self, zingo_memo_stored_indices: Vec, ) -> Result<(), InvalidMemoError> { - // Get list of ephemeral keys already registered to the capability. + // Get list of rejection keys already registered to the capability. // TODO: This doesn't currently handle out-of-order sync where - // the ephemeral address is discovered (from the memo) **after** the + // the rejection is discovered (from the memo) **after** the // corresponding TEX address has been "passed". - let current_keys = self.key.transparent_child_ephemeral_addresses(); + let current_keys = self.key.get_rejection_addresses(); let total_keys = current_keys.len(); - for ephemeral_address_index in zingo_memo_stored_indices { - if (ephemeral_address_index as usize) < total_keys { + for rejection in zingo_memo_stored_indices { + if (rejection as usize) < total_keys { // The emphemeral key is in the structure at its appropriate location. return Ok(()); } else { // The detected key is derived from a higher index than any previously stored key. // * generate the keys to fill in the "gap". - for _index in (total_keys as u32)..=ephemeral_address_index { - crate::wallet::data::new_persistent_ephemeral_address( + for _index in (total_keys as u32)..=rejection { + crate::wallet::data::new_rejection_address( current_keys, &self .key - .ephemeral_ivk() - .map_err(InvalidMemoError::InvalidEphemeralIndex)?, + .rejection_ivk() + .map_err(InvalidMemoError::InvalidRejectionAddress)?, ) - .map_err(InvalidMemoError::InvalidEphemeralIndex)?; + .map_err(InvalidMemoError::InvalidRejectionAddress)?; } } } @@ -763,10 +762,10 @@ mod decrypt_transaction { ParsedMemo::Version0 { uas } => self.handle_uas(uas, transaction).await, ParsedMemo::Version1 { uas, - ephemeral_address_indexes, + rejection_address_indexes, } => { self.handle_uas(uas, transaction).await; - self.handle_texes(ephemeral_address_indexes).await?; + self.handle_texes(rejection_address_indexes).await?; } other_memo_version => { log::error!( diff --git a/zingolib/src/wallet/tx_map.rs b/zingolib/src/wallet/tx_map.rs index c1709d186..76fbee171 100644 --- a/zingolib/src/wallet/tx_map.rs +++ b/zingolib/src/wallet/tx_map.rs @@ -29,8 +29,8 @@ pub struct TxMap { // as below pub(crate) transparent_child_addresses: Arc>, - // TODO: rename (ephemeral_transparent_addresses?) - pub(crate) transparent_child_ephemeral_addresses: + /// rejection_addresses are called "ephemeral" in LRZ 320 + pub(crate) rejection_addresses: Arc>, } @@ -45,19 +45,16 @@ impl TxMap { transparent_child_addresses: Arc< append_only_vec::AppendOnlyVec<(usize, TransparentAddress)>, >, - transparent_child_ephemeral_addresses: Arc< + rejection_addresses: Arc< append_only_vec::AppendOnlyVec<(TransparentAddress, TransparentAddressMetadata)>, >, - transparent_ephemeral_ivk: EphemeralIvk, + rejection_ivk: EphemeralIvk, ) -> TxMap { Self { transaction_records_by_id: TransactionRecordsById::new(), - spending_data: Some(SpendingData::new( - WitnessTrees::default(), - transparent_ephemeral_ivk, - )), + spending_data: Some(SpendingData::new(WitnessTrees::default(), rejection_ivk)), transparent_child_addresses, - transparent_child_ephemeral_addresses, + rejection_addresses, } } pub(crate) fn new_treeless( @@ -69,7 +66,7 @@ impl TxMap { transaction_records_by_id: TransactionRecordsById::new(), spending_data: None, transparent_child_addresses, - transparent_child_ephemeral_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), + rejection_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), } } /// TODO: Doc-comment! @@ -130,7 +127,7 @@ impl TxMap { .unwrap(), )), transparent_child_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), - transparent_child_ephemeral_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), + rejection_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), } } /// For any unit tests that don't require a WalletCapability, where the addresses come from @@ -139,7 +136,7 @@ impl TxMap { transaction_records_by_id: TransactionRecordsById::new(), spending_data: None, transparent_child_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), - transparent_child_ephemeral_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), + rejection_addresses: Arc::new(append_only_vec::AppendOnlyVec::new()), } } } diff --git a/zingolib/src/wallet/tx_map/read_write.rs b/zingolib/src/wallet/tx_map/read_write.rs index 111378061..d68f201f3 100644 --- a/zingolib/src/wallet/tx_map/read_write.rs +++ b/zingolib/src/wallet/tx_map/read_write.rs @@ -69,12 +69,10 @@ impl TxMap { Ok(Self { transaction_records_by_id: map, spending_data: witness_trees - .zip(wallet_capability.ephemeral_ivk().ok()) + .zip(wallet_capability.rejection_ivk().ok()) .map(|(trees, key)| SpendingData::new(trees, key)), transparent_child_addresses: wallet_capability.transparent_child_addresses().clone(), - transparent_child_ephemeral_addresses: wallet_capability - .transparent_child_ephemeral_addresses() - .clone(), + rejection_addresses: wallet_capability.get_rejection_addresses().clone(), }) } @@ -141,12 +139,10 @@ impl TxMap { Ok(Self { transaction_records_by_id: TransactionRecordsById::from_map(map), spending_data: witness_trees - .zip(wallet_capability.ephemeral_ivk().ok()) + .zip(wallet_capability.rejection_ivk().ok()) .map(|(trees, key)| SpendingData::new(trees, key)), transparent_child_addresses: wallet_capability.transparent_child_addresses().clone(), - transparent_child_ephemeral_addresses: wallet_capability - .transparent_child_ephemeral_addresses() - .clone(), + rejection_addresses: wallet_capability.get_rejection_addresses().clone(), }) } diff --git a/zingolib/src/wallet/tx_map/spending_data.rs b/zingolib/src/wallet/tx_map/spending_data.rs index 12e6753f7..45aae3922 100644 --- a/zingolib/src/wallet/tx_map/spending_data.rs +++ b/zingolib/src/wallet/tx_map/spending_data.rs @@ -14,15 +14,15 @@ pub(crate) struct SpendingData { #[getset(get = "pub(crate)", get_mut = "pub(crate)")] cached_raw_transactions: Vec<(TxId, Vec)>, #[getset(get = "pub(crate)", get_mut = "pub(crate)")] - transparent_ephemeral_ivk: EphemeralIvk, + rejection_ivk: EphemeralIvk, } impl SpendingData { - pub fn new(witness_trees: WitnessTrees, transparent_ephemeral_ivk: EphemeralIvk) -> Self { + pub fn new(witness_trees: WitnessTrees, rejection_ivk: EphemeralIvk) -> Self { SpendingData { witness_trees, cached_raw_transactions: Vec::new(), - transparent_ephemeral_ivk, + rejection_ivk, } } } diff --git a/zingolib/src/wallet/tx_map/trait_walletread.rs b/zingolib/src/wallet/tx_map/trait_walletread.rs index 0fd027809..13ed072b1 100644 --- a/zingolib/src/wallet/tx_map/trait_walletread.rs +++ b/zingolib/src/wallet/tx_map/trait_walletread.rs @@ -343,11 +343,7 @@ impl WalletRead for TxMap { )>, Self::Error, > { - Ok(self - .transparent_child_ephemeral_addresses - .iter() - .cloned() - .collect()) + Ok(self.rejection_addresses.iter().cloned().collect()) } } diff --git a/zingolib/src/wallet/tx_map/trait_walletwrite.rs b/zingolib/src/wallet/tx_map/trait_walletwrite.rs index f35c5481c..0539a67fd 100644 --- a/zingolib/src/wallet/tx_map/trait_walletwrite.rs +++ b/zingolib/src/wallet/tx_map/trait_walletwrite.rs @@ -123,9 +123,9 @@ impl WalletWrite for TxMap { .as_ref() .map(|spending_data| { iter::repeat_with(|| { - crate::wallet::data::new_persistent_ephemeral_address( - &self.transparent_child_ephemeral_addresses, - spending_data.transparent_ephemeral_ivk(), + crate::wallet::data::new_rejection_address( + &self.rejection_addresses, + spending_data.rejection_ivk(), ) .map_err(TxMapTraitError::TexSendError) })