diff --git a/Cargo.lock b/Cargo.lock index d748cda7..7ec5f7e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1961,6 +1961,7 @@ dependencies = [ "mostro-core", "nostr-sdk", "once_cell", + "openssl", "reqwest", "serde", "serde_json", @@ -2222,6 +2223,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.4.0+3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.104" @@ -2230,6 +2240,7 @@ checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index c76828e2..b276152a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" \ No newline at end of file diff --git a/src/app/take_buy.rs b/src/app/take_buy.rs index aaa18350..f806c53b 100644 --- a/src/app/take_buy.rs +++ b/src/app/take_buy.rs @@ -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; diff --git a/src/app/take_sell.rs b/src/app/take_sell.rs index 53af1ea4..9449cabb 100644 --- a/src/app/take_sell.rs +++ b/src/app/take_sell.rs @@ -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; diff --git a/src/util.rs b/src/util.rs index cdb72f97..16d938d7 100644 --- a/src/util.rs +++ b/src/util.rs @@ -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)),