diff --git a/zingolib/src/lightclient/deprecated.rs b/zingolib/src/lightclient/deprecated.rs index decda8ed3f..cb9d247df6 100644 --- a/zingolib/src/lightclient/deprecated.rs +++ b/zingolib/src/lightclient/deprecated.rs @@ -59,7 +59,7 @@ impl LightClient { }) } - /// This fn is _only_ called inside a block conditioned on "is_outgoing_transaction" + #[allow(deprecated)] fn append_change_notes( wallet_transaction: &TransactionRecord, received_utxo_value: u64, diff --git a/zingolib/src/wallet/transaction_record.rs b/zingolib/src/wallet/transaction_record.rs index ef4649b7e4..74689ea1bd 100644 --- a/zingolib/src/wallet/transaction_record.rs +++ b/zingolib/src/wallet/transaction_record.rs @@ -56,15 +56,15 @@ pub struct TransactionRecord { /// List of all Utxos by this wallet received in this Tx. Some of these might be change notes pub transparent_outputs: Vec, + /// Total amount of transparent funds that belong to us that were spent by this wallet in this Tx. + pub total_transparent_value_spent: u64, + /// Total value of all the sapling nullifiers that were spent by this wallet in this Tx pub total_sapling_value_spent: u64, /// Total value of all the orchard nullifiers that were spent by this wallet in this Tx pub total_orchard_value_spent: u64, - /// Total amount of transparent funds that belong to us that were spent by this wallet in this Tx. - pub total_transparent_value_spent: u64, - /// All outgoing sends pub outgoing_tx_data: Vec, @@ -203,6 +203,7 @@ impl TransactionRecord { /// TODO: Add Doc Comment Here! // TODO: This is incorrect in the edge case where where we have a send-to-self with // no text memo and 0-value fee + #[allow(deprecated)] #[deprecated(note = "uses unstable deprecated is_change")] pub fn is_outgoing_transaction(&self) -> bool { (!self.outgoing_tx_data.is_empty()) || self.total_value_spent() != 0 @@ -239,6 +240,7 @@ impl TransactionRecord { } /// TODO: Add Doc Comment Here! + #[deprecated(note = "replaced by total_value_input_to_transaction")] pub fn total_value_spent(&self) -> u64 { self.value_spent_by_pool().iter().sum() } @@ -442,8 +444,8 @@ impl TransactionRecord { transparent_outputs: utxos, spent_sapling_nullifiers, spent_orchard_nullifiers, - total_sapling_value_spent, total_transparent_value_spent, + total_sapling_value_spent, total_orchard_value_spent, outgoing_tx_data: outgoing_metadata, price: zec_price, @@ -795,7 +797,6 @@ mod tests { 0 ); assert_eq!(new.total_value_received(), 0); - assert_eq!(new.total_value_spent(), 0); assert_eq!(new.value_outgoing(), 0); let t: [u64; 3] = [0, 0, 0]; assert_eq!(new.value_spent_by_pool(), t); diff --git a/zingolib/src/wallet/transaction_records_by_id.rs b/zingolib/src/wallet/transaction_records_by_id.rs index 32a40af447..942fe2a135 100644 --- a/zingolib/src/wallet/transaction_records_by_id.rs +++ b/zingolib/src/wallet/transaction_records_by_id.rs @@ -379,6 +379,8 @@ impl TransactionRecordsById { } /// TODO: Add Doc Comment Here! + #[allow(deprecated)] + #[deprecated(note = "uses unstable deprecated functions")] pub fn total_funds_spent_in(&self, txid: &TxId) -> u64 { self.get(txid) .map(TransactionRecord::total_value_spent) @@ -389,6 +391,7 @@ impl TransactionRecordsById { // // TODO: When we start working on multi-sig, this could cause issues about hiding sends-to-self /// TODO: Add Doc Comment Here! + #[allow(deprecated)] #[deprecated(note = "uses unstable deprecated functions")] pub fn check_notes_mark_change(&mut self, txid: &TxId) { //TODO: Incorrect with a 0-value fee somehow