Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arkanoider committed Nov 7, 2024
1 parent cc66d3d commit 959d1e1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
config = "0.14.0"
clap = { version = "4.5.19", features = ["derive"] }
lnurl-rs = "0.8.0"
# openssl = { version = "0.10.66", features = ["vendored"] }
openssl = { version = "0.10.66", features = ["vendored"] }
once_cell = "1.20.2"
8 changes: 2 additions & 6 deletions src/app/take_buy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,8 @@ pub async fn take_buy_action(

// Check market price value in sats - if order was with market price then calculate
if order.amount == 0 {
let (new_sats_amount, fee) = get_market_amount_and_fee(
order.fiat_amount,
&order.fiat_code,
order.premium,
)
.await?;
let (new_sats_amount, fee) =
get_market_amount_and_fee(order.fiat_amount, &order.fiat_code, order.premium).await?;
// Update order with new sats value
order.amount = new_sats_amount;
order.fee = fee;
Expand Down
8 changes: 2 additions & 6 deletions src/app/take_sell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,8 @@ pub async fn take_sell_action(

// Check market price value in sats - if order was with market price then calculate it and send a DM to buyer
if order.amount == 0 {
let (new_sats_amount, fee) = get_market_amount_and_fee(
order.fiat_amount,
&order.fiat_code,
order.premium,
)
.await?;
let (new_sats_amount, fee) =
get_market_amount_and_fee(order.fiat_amount, &order.fiat_code, order.premium).await?;
// Update order with new sats value
order.amount = new_sats_amount;
order.fee = fee;
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ mod tests {
..Default::default()
};
let message = Message::Order(MessageKind::new(
1,
Some(1),
Some(uuid),
Action::TakeSell,
Some(Content::Amount(order.amount)),
Expand Down

0 comments on commit 959d1e1

Please sign in to comment.