Skip to content

Commit

Permalink
Fixed Bitonic fiat withdrawals
Browse files Browse the repository at this point in the history
They got added as fiat deposits.
  • Loading branch information
bjorn committed Sep 15, 2023
1 parent 932785f commit e2e681b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl Transaction {
pub(crate) fn fiat_withdrawal(timestamp: NaiveDateTime, quantity: f64, currency: &str) -> Self {
Self {
timestamp,
operation: Operation::FiatDeposit(Amount {
operation: Operation::FiatWithdrawal(Amount {
quantity,
currency: currency.to_string(),
}),
Expand Down
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ fn main() -> Result<(), Box<dyn Error>> {
date: transaction.timestamp.date().to_string().into(),
time: transaction.timestamp.time().to_string().into(),
tx_type,
received: received.map(Amount::to_string).unwrap_or_default().into(),
sent: sent.map(Amount::to_string).unwrap_or_default().into(),
fee: transaction.fee.as_ref().map(Amount::to_string).unwrap_or_default().into(),
value: value.map(Amount::to_string).unwrap_or_default().into(),
received: received.map_or_else(String::default, Amount::to_string).into(),
sent: sent.map_or_else(String::default, Amount::to_string).into(),
fee: transaction.fee.as_ref().map_or_else(String::default, Amount::to_string).into(),
value: value.map_or_else(String::default, Amount::to_string).into(),
gain: ((gain * 100.0).round() / 100.0) as f32,
gain_error: gain_error.unwrap_or_default().into(),
description: description.unwrap_or_default().into(),
Expand Down

0 comments on commit e2e681b

Please sign in to comment.