Skip to content

Commit ae30b54

Browse files
committed
remove redundant, inconsistent method
1 parent 27eb9aa commit ae30b54

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

zingolib/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6565
- `do_save_to_buffer_sync`
6666
- `fix_spent_at_height`
6767
- `TransactionRecord::net_spent`
68+
- `TransactionRecord::iget_transparent_value_spent()`

zingolib/src/lightclient/deprecated.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl LightClient {
138138

139139
// Get the total transparent value received in this transaction
140140
// Again we see the assumption that utxos are incoming.
141-
let net_transparent_value = total_transparent_received as i64 - wallet_transaction.get_transparent_value_spent() as i64;
141+
let net_transparent_value = total_transparent_received as i64 - wallet_transaction.total_transparent_value_spent as i64;
142142
let address = wallet_transaction.transparent_outputs.iter().map(|utxo| utxo.address.clone()).collect::<Vec<String>>().join(",");
143143
if net_transparent_value > 0 {
144144
if let Some(transaction) = consumer_notes_by_tx.iter_mut().find(|transaction| transaction["txid"] == txid.to_string()) {

zingolib/src/wallet/transaction_record.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,6 @@ impl TransactionRecord {
224224
self.query_sum_value(OutputQuery::any())
225225
}
226226

227-
/// TODO: Add Doc Comment Here!
228-
pub fn get_transparent_value_spent(&self) -> u64 {
229-
self.total_transparent_value_spent
230-
}
231-
232227
/// TODO: Add Doc Comment Here!
233228
#[deprecated(
234229
note = "replaced by `calculate_transaction_fee` method for [`crate::wallet::transaction_records_by_id::TransactionRecordsById`]"
@@ -300,7 +295,7 @@ impl TransactionRecord {
300295
/// TODO: Add Doc Comment Here!
301296
pub fn value_spent_by_pool(&self) -> [u64; 3] {
302297
[
303-
self.get_transparent_value_spent(),
298+
self.total_transparent_value_spent,
304299
self.total_sapling_value_spent,
305300
self.total_orchard_value_spent,
306301
]
@@ -796,7 +791,7 @@ mod tests {
796791
#[test]
797792
pub fn blank_record() {
798793
let new = TransactionRecordBuilder::default().build();
799-
assert_eq!(new.get_transparent_value_spent(), 0);
794+
assert_eq!(new.total_transparent_value_spent, 0);
800795
assert!(!new.is_outgoing_transaction());
801796
assert!(!new.is_incoming_transaction());
802797
// assert_eq!(new.net_spent(), 0);

0 commit comments

Comments
 (0)