From 535ce42b75dd6176c689c09e9ae39bfe605f07bc Mon Sep 17 00:00:00 2001 From: Lucio Pinese Date: Tue, 22 Oct 2024 17:19:08 +0200 Subject: [PATCH 1/8] testing for bilthon --- Cargo.lock | 14 +------- Cargo.toml | 4 +-- src/app.rs | 11 +++--- src/app/add_invoice.rs | 22 ++++++++++-- src/app/admin_cancel.rs | 2 ++ src/app/admin_settle.rs | 5 ++- src/app/admin_take_dispute.rs | 11 +++++- src/app/cancel.rs | 65 ++++++++++++++++++++++++++++++----- src/app/dispute.rs | 3 ++ src/app/fiat_sent.rs | 3 ++ src/app/order.rs | 29 ++++++++++++++-- src/app/rate_user.rs | 1 + src/app/release.rs | 34 ++++++++++++++---- src/app/take_buy.rs | 9 +++-- src/app/take_sell.rs | 7 ++-- src/flow.rs | 6 +++- src/util.rs | 37 ++++++++++++++++---- 17 files changed, 208 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 550b478c..0d02cc90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1829,7 +1829,6 @@ dependencies = [ "mostro-core", "nostr-sdk", "once_cell", - "openssl", "reqwest", "serde", "serde_json", @@ -1844,8 +1843,7 @@ dependencies = [ [[package]] name = "mostro-core" version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389a75ea2e08eeeb37b54156559d0e988cfe23d365310a2253cf428008bb4271" +source = "git+https://github.com/MostroP2P/mostro-core?branch=bilthon-test#4a5998e6b1bc8b278100173760ef555bd4928784" dependencies = [ "anyhow", "chrono", @@ -2095,15 +2093,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-src" -version = "300.3.2+3.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" -dependencies = [ - "cc", -] - [[package]] name = "openssl-sys" version = "0.9.103" @@ -2112,7 +2101,6 @@ checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", - "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 4a53c07c..60479870 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,11 +38,11 @@ uuid = { version = "1.8.0", features = [ "serde", ] } reqwest = { version = "0.12.1", features = ["json"] } -mostro-core = { version = "0.6.8", features = ["sqlx"] } +mostro-core = { git = "https://github.com/MostroP2P/mostro-core", branch = "bilthon-test", features = ["sqlx"] } tracing = "0.1.40" 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" diff --git a/src/app.rs b/src/app.rs index 3c1c216d..2ba9bb08 100644 --- a/src/app.rs +++ b/src/app.rs @@ -79,6 +79,9 @@ pub async fn run( match message { Ok(msg) => { if msg.get_inner_message_kind().verify() { + + let request_id = msg.get_inner_message_kind().request_id; + if let Some(action) = msg.inner_action() { match action { Action::NewOrder => { @@ -90,14 +93,14 @@ pub async fn run( } Action::TakeSell => { if let Err(e) = - take_sell_action(msg, &event, &my_keys, &pool).await + take_sell_action(msg, &event, &my_keys, &pool, request_id).await { warning_msg(&action, e) } } Action::TakeBuy => { if let Err(e) = - take_buy_action(msg, &event, &my_keys, &pool).await + take_buy_action(msg, &event, &my_keys, &pool, request_id).await { warning_msg(&action, e) } @@ -111,7 +114,7 @@ pub async fn run( } Action::Release => { if let Err(e) = release_action( - msg, &event, &my_keys, &pool, ln_client, + msg, &event, &my_keys, &pool, ln_client,request_id ) .await { @@ -120,7 +123,7 @@ pub async fn run( } Action::Cancel => { if let Err(e) = cancel_action( - msg, &event, &my_keys, &pool, ln_client, + msg, &event, &my_keys, &pool, ln_client,request_id ) .await { diff --git a/src/app/add_invoice.rs b/src/app/add_invoice.rs index 2b517eb6..c728c128 100644 --- a/src/app/add_invoice.rs +++ b/src/app/add_invoice.rs @@ -73,8 +73,14 @@ pub async fn add_invoice_action( { Ok(_) => payment_request, Err(_) => { - send_new_order_msg(Some(order.id), Action::IncorrectInvoiceAmount, None, &event.sender) - .await; + send_new_order_msg( + msg.get_inner_message_kind().request_id, + Some(order.id), + Action::IncorrectInvoiceAmount, + None, + &event.sender, + ) + .await; return Ok(()); } } @@ -91,11 +97,19 @@ pub async fn add_invoice_action( Status::SettledHoldInvoice => { order.payment_attempts = 0; order.clone().update(pool).await?; - send_new_order_msg(Some(order.id), Action::InvoiceUpdated, None, &buyer_pubkey).await; + send_new_order_msg( + msg.get_inner_message_kind().request_id, + Some(order.id), + Action::InvoiceUpdated, + None, + &buyer_pubkey, + ) + .await; return Ok(()); } _ => { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -140,6 +154,7 @@ pub async fn add_invoice_action( // We send a confirmation message to seller send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::BuyerTookOrder, Some(Content::Order(order_data.clone())), @@ -148,6 +163,7 @@ pub async fn add_invoice_action( .await; // We send a message to buyer saying seller paid send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::HoldInvoicePaymentAccepted, Some(Content::Order(order_data)), diff --git a/src/app/admin_cancel.rs b/src/app/admin_cancel.rs index ecaaeb6d..c9a71507 100644 --- a/src/app/admin_cancel.rs +++ b/src/app/admin_cancel.rs @@ -32,6 +32,7 @@ pub async fn admin_cancel_action( match is_assigned_solver(pool, &event.sender.to_string(), order_id).await { Ok(false) => { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order_id), Action::IsNotYourDispute, None, @@ -66,6 +67,7 @@ pub async fn admin_cancel_action( if order.status != Status::Dispute.to_string() { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::NotAllowedByStatus, None, diff --git a/src/app/admin_settle.rs b/src/app/admin_settle.rs index 42717c1c..7a3a163f 100644 --- a/src/app/admin_settle.rs +++ b/src/app/admin_settle.rs @@ -33,6 +33,7 @@ pub async fn admin_settle_action( match is_assigned_solver(pool, &event.sender.to_string(), order_id).await { Ok(false) => { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order_id), Action::IsNotYourDispute, None, @@ -58,7 +59,8 @@ pub async fn admin_settle_action( // Was orde cooperatively cancelled? if order.status == Status::CooperativelyCanceled.to_string() { - let message = MessageKind::new(Some(order_id), Action::CooperativeCancelAccepted, None); + let message = MessageKind::new( msg.get_inner_message_kind().request_id, + Some(order_id), Action::CooperativeCancelAccepted, None); if let Ok(message) = message.as_json() { let _ = send_dm(&event.sender, message).await; } @@ -67,6 +69,7 @@ pub async fn admin_settle_action( if order.status != Status::Dispute.to_string() { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::NotAllowedByStatus, None, diff --git a/src/app/admin_take_dispute.rs b/src/app/admin_take_dispute.rs index c13fa127..d5696975 100644 --- a/src/app/admin_take_dispute.rs +++ b/src/app/admin_take_dispute.rs @@ -55,7 +55,14 @@ pub async fn admin_take_dispute_action( Some(dispute) => dispute, None => { // We create a Message - send_new_order_msg(Some(dispute_id), Action::NotFound, None, &event.sender).await; + send_new_order_msg( + msg.get_inner_message_kind().request_id, + Some(dispute_id), + Action::NotFound, + None, + &event.sender, + ) + .await; return Ok(()); } }; @@ -98,6 +105,7 @@ pub async fn admin_take_dispute_action( // We create a Message for admin let message = Message::new_dispute( + msg.get_inner_message_kind().request_id, Some(dispute_id), Action::AdminTookDispute, Some(Content::Order(new_order)), @@ -108,6 +116,7 @@ pub async fn admin_take_dispute_action( // to them know who will assist them on the dispute let solver_pubkey = Peer::new(event.sender.to_hex()); let msg_to_buyer = Message::new_order( + msg.get_inner_message_kind().request_id, Some(order.id), Action::AdminTookDispute, Some(Content::Peer(solver_pubkey.clone())), diff --git a/src/app/cancel.rs b/src/app/cancel.rs index cb08e2a3..ba39494b 100644 --- a/src/app/cancel.rs +++ b/src/app/cancel.rs @@ -21,6 +21,7 @@ pub async fn cancel_action( my_keys: &Keys, pool: &Pool, ln_client: &mut LndConnector, + request_id : u64, ) -> Result<()> { let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { order_id @@ -41,7 +42,14 @@ pub async fn cancel_action( // Validates if this user is the order creator if user_pubkey != order.creator_pubkey { // We create a Message - send_new_order_msg(Some(order.id), Action::IsNotYourOrder, None, &event.sender).await; + send_new_order_msg( + msg.get_inner_message_kind().request_id, + Some(order.id), + Action::IsNotYourOrder, + None, + &event.sender, + ) + .await; } else { // We publish a new replaceable kind nostr event with the status updated // and update on local database the status and new event id @@ -49,7 +57,14 @@ pub async fn cancel_action( let _ = order_updated.update(pool).await; } // We create a Message for cancel - send_new_order_msg(Some(order.id), Action::Canceled, None, &event.sender).await; + send_new_order_msg( + request_id, + Some(order.id), + Action::Canceled, + None, + &event.sender, + ) + .await; } return Ok(()); @@ -59,13 +74,13 @@ pub async fn cancel_action( && (order.status == Status::WaitingBuyerInvoice.to_string() || order.status == Status::WaitingBuyerInvoice.to_string()) { - cancel_add_invoice(ln_client, &mut order, event, pool, my_keys).await?; + cancel_add_invoice(ln_client, &mut order, event, pool, my_keys, request_id).await?; } if order.kind == OrderKind::Buy.to_string() && order.status == Status::WaitingPayment.to_string() { - cancel_pay_hold_invoice(ln_client, &mut order, event, pool, my_keys).await?; + cancel_pay_hold_invoice(ln_client, &mut order, event, pool, my_keys,request_id).await?; } if order.status == Status::Active.to_string() @@ -110,6 +125,7 @@ pub async fn cancel_action( update_order_event(my_keys, Status::CooperativelyCanceled, &order).await?; // We create a Message for an accepted cooperative cancel and send it to both parties send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::CooperativeCancelAccepted, None, @@ -118,6 +134,7 @@ pub async fn cancel_action( .await; let counterparty_pubkey = PublicKey::from_str(&counterparty_pubkey)?; send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::CooperativeCancelAccepted, None, @@ -133,6 +150,7 @@ pub async fn cancel_action( let order = order.update(pool).await?; // We create a Message to start a cooperative cancel and send it to both parties send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::CooperativeCancelInitiatedByYou, None, @@ -141,6 +159,7 @@ pub async fn cancel_action( .await; let counterparty_pubkey = PublicKey::from_str(&counterparty_pubkey)?; send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::CooperativeCancelInitiatedByPeer, None, @@ -159,6 +178,7 @@ pub async fn cancel_add_invoice( event: &UnwrappedGift, pool: &Pool, my_keys: &Keys, + request_id : u64, ) -> Result<()> { if let Some(hash) = &order.hash { ln_client.cancel_hold_invoice(hash).await?; @@ -184,8 +204,22 @@ pub async fn cancel_add_invoice( // and update on local database the status and new event id update_order_event(my_keys, Status::CooperativelyCanceled, order).await?; // We create a Message for cancel - send_new_order_msg(Some(order.id), Action::Canceled, None, &event.sender).await; - send_new_order_msg(Some(order.id), Action::Canceled, None, &seller_pubkey).await; + send_new_order_msg( + request_id, + Some(order.id), + Action::Canceled, + None, + &event.sender, + ) + .await; + send_new_order_msg( + request_id, + Some(order.id), + Action::Canceled, + None, + &seller_pubkey, + ) + .await; Ok(()) } else { // We re-publish the event with Pending status @@ -211,6 +245,7 @@ pub async fn cancel_pay_hold_invoice( event: &UnwrappedGift, pool: &Pool, my_keys: &Keys, + request_id : u64, ) -> Result<()> { if order.hash.is_some() { // We return funds to seller @@ -238,8 +273,22 @@ pub async fn cancel_pay_hold_invoice( // and update on local database the status and new event id update_order_event(my_keys, Status::Canceled, order).await?; // We create a Message for cancel - send_new_order_msg(Some(order.id), Action::Canceled, None, &event.sender).await; - send_new_order_msg(Some(order.id), Action::Canceled, None, &seller_pubkey).await; + send_new_order_msg( + request_id, + Some(order.id), + Action::Canceled, + None, + &event.sender, + ) + .await; + send_new_order_msg( + request_id, + Some(order.id), + Action::Canceled, + None, + &seller_pubkey, + ) + .await; Ok(()) } else { // We re-publish the event with Pending status diff --git a/src/app/dispute.rs b/src/app/dispute.rs index f8113307..fc64ac4b 100644 --- a/src/app/dispute.rs +++ b/src/app/dispute.rs @@ -41,6 +41,7 @@ pub async fn dispute_action( order } else { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -132,6 +133,7 @@ pub async fn dispute_action( }; send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order_id), Action::DisputeInitiatedByYou, Some(Content::Dispute(dispute.clone().id, initiator_token)), @@ -148,6 +150,7 @@ pub async fn dispute_action( } }; send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order_id), Action::DisputeInitiatedByPeer, Some(Content::Dispute(dispute.clone().id, counterpart_token)), diff --git a/src/app/fiat_sent.rs b/src/app/fiat_sent.rs index 50e635d5..2348789c 100644 --- a/src/app/fiat_sent.rs +++ b/src/app/fiat_sent.rs @@ -31,6 +31,7 @@ pub async fn fiat_sent_action( // Send to user a DM with the error if order.status != Status::Active.to_string() { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -62,6 +63,7 @@ pub async fn fiat_sent_action( // We a message to the seller send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::FiatSentOk, Some(Content::Peer(peer)), @@ -72,6 +74,7 @@ pub async fn fiat_sent_action( let peer = Peer::new(seller_pubkey.to_string()); send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::FiatSentOk, Some(Content::Peer(peer)), diff --git a/src/app/order.rs b/src/app/order.rs index 63ddc483..b8372c1c 100644 --- a/src/app/order.rs +++ b/src/app/order.rs @@ -14,6 +14,7 @@ pub async fn order_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, + request_id:u64, ) -> Result<()> { if let Some(order) = msg.get_inner_message_kind().get_order() { let mostro_settings = Settings::get_mostro(); @@ -26,6 +27,7 @@ pub async fn order_action( Ok(_) => (), Err(_) => { send_new_order_msg( + msg.get_inner_message_kind().request_id, order.id, Action::IncorrectInvoiceAmount, None, @@ -52,7 +54,14 @@ pub async fn order_action( amount_vec.push(min); amount_vec.push(max); } else { - send_new_order_msg(None, Action::InvalidSatsAmount, None, &event.sender).await; + send_new_order_msg( + msg.get_inner_message_kind().request_id, + None, + Action::InvalidSatsAmount, + None, + &event.sender, + ) + .await; return Ok(()); } } @@ -74,14 +83,28 @@ pub async fn order_action( // Check amount is positive - extra safety check if quote < 0 { - send_new_order_msg(None, Action::InvalidSatsAmount, None, &event.sender).await; + send_new_order_msg( + msg.get_inner_message_kind().request_id, + None, + Action::InvalidSatsAmount, + None, + &event.sender, + ) + .await; return Ok(()); } if quote > mostro_settings.max_order_amount as i64 || quote < mostro_settings.min_payment_amount as i64 { - send_new_order_msg(None, Action::OutOfRangeSatsAmount, None, &event.sender).await; + send_new_order_msg( + msg.get_inner_message_kind().request_id, + None, + Action::OutOfRangeSatsAmount, + None, + &event.sender, + ) + .await; return Ok(()); } } diff --git a/src/app/rate_user.rs b/src/app/rate_user.rs index bc726084..5fcc6d17 100644 --- a/src/app/rate_user.rs +++ b/src/app/rate_user.rs @@ -164,6 +164,7 @@ pub async fn update_user_reputation_action( // Send confirmation message to user that rated send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::RateReceived, Some(Content::RatingUser(rating)), diff --git a/src/app/release.rs b/src/app/release.rs index 562d2325..bc554f53 100644 --- a/src/app/release.rs +++ b/src/app/release.rs @@ -22,7 +22,7 @@ use std::str::FromStr; use tokio::sync::mpsc::channel; use tracing::{error, info}; -pub async fn check_failure_retries(order: &Order) -> Result { +pub async fn check_failure_retries(order: &Order, request_id:u64) -> Result { let mut order = order.clone(); // Handle to db here @@ -44,7 +44,14 @@ pub async fn check_failure_retries(order: &Order) -> Result { None => return Err(Error::msg("Missing buyer pubkey")), }; - send_new_order_msg(Some(order.id), Action::PaymentFailed, None, &buyer_pubkey).await; + send_new_order_msg( + request_id, + Some(order.id), + Action::PaymentFailed, + None, + &buyer_pubkey, + ) + .await; // Update order let result = order.update(&pool).await?; @@ -57,6 +64,7 @@ pub async fn release_action( my_keys: &Keys, pool: &Pool, ln_client: &mut LndConnector, + request_id : u64, ) -> Result<()> { // Check if order id is ok let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { @@ -92,6 +100,7 @@ pub async fn release_action( && current_status != Status::Dispute { send_new_order_msg( + request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -113,6 +122,7 @@ pub async fn release_action( // We send a HoldInvoicePaymentSettled message to seller, the client should // indicate *funds released* message to seller send_new_order_msg( + request_id, Some(order_id), Action::HoldInvoicePaymentSettled, None, @@ -125,14 +135,21 @@ pub async fn release_action( Some(buyer) => PublicKey::from_str(buyer.as_str())?, _ => return Err(Error::msg("Missing buyer pubkeys")), }; - send_new_order_msg(Some(order_id), Action::Released, None, &buyer_pubkey).await; + send_new_order_msg( + request_id, + Some(order_id), + Action::Released, + None, + &buyer_pubkey, + ) + .await; - let _ = do_payment(order_updated).await; + let _ = do_payment(order_updated,request_id).await; Ok(()) } -pub async fn do_payment(mut order: Order) -> Result<()> { +pub async fn do_payment(mut order: Order,request_id:u64) -> Result<()> { // Finally we try to pay buyer's invoice let payment_request = match order.buyer_invoice.as_ref() { Some(req) => req.to_string(), @@ -152,7 +169,7 @@ pub async fn do_payment(mut order: Order) -> Result<()> { let payment_task = ln_client_payment.send_payment(&payment_request, amount as i64, tx); if let Err(paymement_result) = payment_task.await { info!("Error during ln payment : {}", paymement_result); - if let Ok(failed_payment) = check_failure_retries(&order).await { + if let Ok(failed_payment) = check_failure_retries(&order, request_id).await { info!( "Order id {} has {} failed payments retries", failed_payment.id, failed_payment.payment_attempts @@ -188,6 +205,7 @@ pub async fn do_payment(mut order: Order) -> Result<()> { &buyer_pubkey, &seller_pubkey, &my_keys, + request_id, ) .await; } @@ -198,7 +216,7 @@ pub async fn do_payment(mut order: Order) -> Result<()> { ); // Mark payment as failed - if let Ok(failed_payment) = check_failure_retries(&order).await { + if let Ok(failed_payment) = check_failure_retries(&order, request_id).await { info!( "Order id {} has {} failed payments retries", failed_payment.id, failed_payment.payment_attempts @@ -220,9 +238,11 @@ async fn payment_success( buyer_pubkey: &PublicKey, seller_pubkey: &PublicKey, my_keys: &Keys, + request_id : u64, ) -> Result<()> { // Purchase completed message to buyer send_new_order_msg( + request_id, Some(order.id), Action::PurchaseCompleted, None, diff --git a/src/app/take_buy.rs b/src/app/take_buy.rs index cc4cbecf..7f36e8b4 100644 --- a/src/app/take_buy.rs +++ b/src/app/take_buy.rs @@ -18,6 +18,7 @@ pub async fn take_buy_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, + request_id : u64, ) -> Result<()> { // Safe unwrap as we verified the message let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { @@ -67,6 +68,7 @@ pub async fn take_buy_action( Status::Pending => {} _ => { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -76,12 +78,13 @@ pub async fn take_buy_action( return Ok(()); } } - + // Get amount request if user requested one for range order - fiat amount will be used below if let Some(am) = get_fiat_amount_requested(&order, &msg) { order.fiat_amount = am; } else { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::OutOfRangeFiatAmount, None, @@ -89,8 +92,8 @@ pub async fn take_buy_action( ) .await; return Ok(()); - } - + } + // Check market price value in sats - if order was with market price then calculate if order.amount == 0 { let (new_sats_amount, fee) = diff --git a/src/app/take_sell.rs b/src/app/take_sell.rs index 078b67ae..1ab7f10f 100644 --- a/src/app/take_sell.rs +++ b/src/app/take_sell.rs @@ -19,6 +19,7 @@ pub async fn take_sell_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, + request_id :u64, ) -> Result<()> { // Safe unwrap as we verified the message let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { @@ -87,6 +88,7 @@ pub async fn take_sell_action( Status::Pending => {} _ => { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -96,12 +98,13 @@ pub async fn take_sell_action( return Ok(()); } } - + // Get amount request if user requested one for range order - fiat amount will be used below if let Some(am) = get_fiat_amount_requested(&order, &msg) { order.fiat_amount = am; } else { send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::OutOfRangeFiatAmount, None, @@ -119,7 +122,7 @@ 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?; + get_market_amount_and_fee(order.fiat_amount, &order.fiat_code, order.premium, request_id).await?; // Update order with new sats value order.amount = new_sats_amount; order.fee = fee; diff --git a/src/flow.rs b/src/flow.rs index e5a5eb3b..9fadde89 100644 --- a/src/flow.rs +++ b/src/flow.rs @@ -7,7 +7,7 @@ use sqlx_crud::Crud; use std::str::FromStr; use tracing::{error, info}; -pub async fn hold_invoice_paid(hash: &str) -> Result<()> { +pub async fn hold_invoice_paid(hash: &str, request_id:u64) -> Result<()> { let pool = crate::db::connect().await?; let order = crate::db::find_order_by_hash(&pool, hash).await?; let my_keys = crate::util::get_keys()?; @@ -61,6 +61,7 @@ pub async fn hold_invoice_paid(hash: &str) -> Result<()> { order_data.status = Some(status); // We send a confirmation message to seller send_new_order_msg( + request_id, Some(order.id), Action::BuyerTookOrder, Some(Content::Order(order_data.clone())), @@ -69,6 +70,7 @@ pub async fn hold_invoice_paid(hash: &str) -> Result<()> { .await; // We send a message to buyer saying seller paid send_new_order_msg( + request_id, Some(order.id), Action::HoldInvoicePaymentAccepted, Some(Content::Order(order_data)), @@ -84,6 +86,7 @@ pub async fn hold_invoice_paid(hash: &str) -> Result<()> { order_data.master_seller_pubkey = None; // We ask to buyer for a new invoice send_new_order_msg( + request_id, Some(order.id), Action::AddInvoice, Some(Content::Order(order_data)), @@ -93,6 +96,7 @@ pub async fn hold_invoice_paid(hash: &str) -> Result<()> { // We send a message to seller we are waiting for buyer invoice send_new_order_msg( + request_id, Some(order.id), Action::WaitingBuyerInvoice, None, diff --git a/src/util.rs b/src/util.rs index 852c466a..7c0e5027 100644 --- a/src/util.rs +++ b/src/util.rs @@ -161,6 +161,7 @@ pub async fn publish_order( new_order: &SmallOrder, initiator_pubkey: &str, ack_pubkey: PublicKey, + request_id: u64, ) -> Result<()> { let mut fee = 0; if new_order.amount > 0 { @@ -221,6 +222,7 @@ pub async fn publish_order( // Send message as ack with small order send_new_order_msg( + request_id, Some(order_id), Action::NewOrder, Some(Content::Order(order)), @@ -313,7 +315,7 @@ pub async fn update_order_event(keys: &Keys, status: Status, order: &Order) -> R status.to_string() ); - if NOSTR_CLIENT.get().unwrap().send_event(event).await.is_err(){ + if NOSTR_CLIENT.get().unwrap().send_event(event).await.is_err() { tracing::warn!("order id : {} is expired", order_updated.id) } @@ -351,6 +353,7 @@ pub async fn show_hold_invoice( buyer_pubkey: &PublicKey, seller_pubkey: &PublicKey, mut order: Order, + request_id: u64, ) -> anyhow::Result<()> { let mut ln_client = lightning::LndConnector::new().await?; // Add fee of seller to hold invoice @@ -387,6 +390,7 @@ pub async fn show_hold_invoice( new_order.status = Some(Status::WaitingPayment); // We create a Message to send the hold invoice to seller send_new_order_msg( + msg.get_inner_message_kind().request_id, Some(order.id), Action::PayInvoice, Some(Content::PaymentRequest( @@ -399,6 +403,7 @@ pub async fn show_hold_invoice( .await; // We send a message to buyer to know that seller was requested to pay the invoice send_new_order_msg( + request_id, Some(order.id), Action::WaitingSellerToPay, None, @@ -406,13 +411,13 @@ pub async fn show_hold_invoice( ) .await; - let _ = invoice_subscribe(hash).await; + let _ = invoice_subscribe(hash, request_id).await; Ok(()) } // Create function to reuse in case of resubscription -pub async fn invoice_subscribe(hash: Vec) -> anyhow::Result<()> { +pub async fn invoice_subscribe(hash: Vec, request_id:u64) -> anyhow::Result<()> { let mut ln_client_invoices = lightning::LndConnector::new().await?; let (tx, mut rx) = channel(100); @@ -432,7 +437,7 @@ pub async fn invoice_subscribe(hash: Vec) -> anyhow::Result<()> { let hash = bytes_to_string(msg.hash.as_ref()); // If this invoice was paid by the seller if msg.state == InvoiceState::Accepted { - if let Err(e) = flow::hold_invoice_paid(&hash).await { + if let Err(e) = flow::hold_invoice_paid(&hash, request_id).await { info!("Invoice flow error {e}"); } else { info!("Invoice with hash {hash} accepted!"); @@ -461,6 +466,7 @@ pub async fn get_market_amount_and_fee( fiat_amount: i64, fiat_code: &str, premium: i64, + request_id:u64, ) -> Result<(i64, i64)> { // Update amount order let new_sats_amount = get_market_quote(&fiat_amount, fiat_code, premium).await?; @@ -497,6 +503,7 @@ pub async fn set_waiting_invoice_status(order: &mut Order, buyer_pubkey: PublicK ); // We create a Message send_new_order_msg( + request_id, Some(order.id), Action::AddInvoice, Some(Content::Order(order_data)), @@ -512,12 +519,27 @@ pub async fn rate_counterpart( buyer_pubkey: &PublicKey, seller_pubkey: &PublicKey, order: &Order, + request_id :u64, ) -> Result<()> { // Send dm to counterparts // to buyer - send_new_order_msg(Some(order.id), Action::Rate, None, buyer_pubkey).await; + send_new_order_msg( + request_id, + Some(order.id), + Action::Rate, + None, + buyer_pubkey, + ) + .await; // to seller - send_new_order_msg(Some(order.id), Action::Rate, None, seller_pubkey).await; + send_new_order_msg( + request_id, + Some(order.id), + Action::Rate, + None, + seller_pubkey, + ) + .await; Ok(()) } @@ -571,13 +593,14 @@ pub async fn send_cant_do_msg( } pub async fn send_new_order_msg( + request_id: u64, order_id: Option, action: Action, content: Option, destination_key: &PublicKey, ) { // Send message to event creator - let message = Message::new_order(order_id, action, content); + let message = Message::new_order(request_id, order_id, action, content); if let Ok(message) = message.as_json() { let _ = send_dm(destination_key, message).await; } From 7e9a7f609ea477a4f757316e4c30fa21d133fb2e Mon Sep 17 00:00:00 2001 From: arkanoider Date: Tue, 22 Oct 2024 22:23:28 +0200 Subject: [PATCH 2/8] request_id introduced --- Cargo.lock | 1142 +++++++++++++++++---------------- src/app.rs | 55 +- src/app/add_invoice.rs | 13 +- src/app/admin_add_solver.rs | 5 +- src/app/admin_cancel.rs | 10 +- src/app/admin_settle.rs | 28 +- src/app/admin_take_dispute.rs | 4 +- src/app/cancel.rs | 14 +- src/app/dispute.rs | 3 +- src/app/fiat_sent.rs | 3 +- src/app/order.rs | 5 +- src/app/rate_user.rs | 5 +- src/app/release.rs | 38 +- src/app/take_buy.rs | 25 +- src/app/take_sell.rs | 33 +- src/flow.rs | 10 +- src/main.rs | 2 +- src/scheduler.rs | 2 +- src/util.rs | 33 +- 19 files changed, 784 insertions(+), 646 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d02cc90..d28961b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,18 +14,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -103,15 +103,16 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] @@ -123,27 +124,27 @@ checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -151,9 +152,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" [[package]] name = "arrayvec" @@ -163,9 +164,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -174,24 +175,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -221,7 +222,7 @@ dependencies = [ "tokio-tungstenite", "url", "wasm-ws", - "webpki-roots 0.26.1", + "webpki-roots 0.26.6", ] [[package]] @@ -253,11 +254,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" @@ -272,7 +279,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.31", "itoa", "matchit", "memchr", @@ -281,7 +288,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", @@ -306,17 +313,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -337,9 +344,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -367,11 +374,11 @@ checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "bip39" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" dependencies = [ - "bitcoin_hashes 0.11.0", + "bitcoin_hashes 0.13.0", "serde", "unicode-normalization", ] @@ -385,7 +392,7 @@ dependencies = [ "bech32 0.10.0-beta", "bitcoin-internals 0.2.0", "bitcoin_hashes 0.13.0", - "hex-conservative 0.1.1", + "hex-conservative 0.1.2", "hex_lit", "secp256k1 0.28.2", "serde", @@ -393,9 +400,9 @@ dependencies = [ [[package]] name = "bitcoin" -version = "0.32.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea507acc1cd80fc084ace38544bbcf7ced7c2aa65b653b102de0ce718df668f6" +checksum = "0032b0e8ead7074cda7fc4f034409607e3f03a6f71d66ade8a307f79b4d99e73" dependencies = [ "base58ck", "bech32 0.11.0", @@ -443,12 +450,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bitcoin_hashes" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" - [[package]] name = "bitcoin_hashes" version = "0.13.0" @@ -456,7 +457,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" dependencies = [ "bitcoin-internals 0.2.0", - "hex-conservative 0.1.1", + "hex-conservative 0.1.2", "serde", ] @@ -479,9 +480,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -533,9 +534,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-tools" @@ -551,9 +552,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cbc" @@ -566,9 +567,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -611,7 +615,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets", ] [[package]] @@ -627,9 +631,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -637,9 +641,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -656,20 +660,20 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "config" @@ -732,15 +736,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -756,9 +760,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] @@ -777,9 +781,9 @@ checksum = "338089f42c427b86394a5ee60ff321da23a5c89c9d89514c829687b26359fcff" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -801,9 +805,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -824,9 +828,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "digest" @@ -882,9 +886,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] @@ -900,9 +904,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -915,9 +919,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -937,9 +941,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fedimint-tonic-lnd" @@ -949,10 +953,10 @@ checksum = "df03ca33b5116de3051c1e233fe341e23b04c4913c7b16042497924559bc2a2e" dependencies = [ "hex", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.31", "hyper-rustls 0.24.2", "prost", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "tokio", "tokio-stream", @@ -961,12 +965,6 @@ dependencies = [ "tower", ] -[[package]] -name = "finl_unicode" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" - [[package]] name = "fixedbitset" version = "0.4.2" @@ -975,9 +973,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -1001,6 +999,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1027,9 +1031,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1042,9 +1046,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1052,15 +1056,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1080,38 +1084,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1146,9 +1150,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -1159,9 +1163,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gloo-timers" @@ -1177,9 +1181,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -1187,7 +1191,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1196,17 +1200,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1227,21 +1231,32 @@ checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + [[package]] name = "hashlink" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1273,9 +1288,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex-conservative" @@ -1336,9 +1351,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -1346,22 +1361,22 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1371,15 +1386,15 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -1395,16 +1410,16 @@ dependencies = [ [[package]] name = "hyper" -version = "1.2.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.3", + "h2 0.4.6", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", @@ -1421,27 +1436,28 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", - "rustls 0.21.10", + "hyper 0.14.31", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.2.0", + "hyper 1.5.0", "hyper-util", - "rustls 0.22.3", + "rustls 0.23.15", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", + "webpki-roots 0.26.6", ] [[package]] @@ -1450,7 +1466,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.31", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -1464,7 +1480,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.2.0", + "hyper 1.5.0", "hyper-util", "native-tls", "tokio", @@ -1474,29 +1490,28 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.2.0", + "http-body 1.0.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1537,12 +1552,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", ] [[package]] @@ -1557,9 +1572,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", "js-sys", @@ -1569,9 +1584,15 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -1590,9 +1611,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -1619,15 +1640,15 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libsqlite3-sys" @@ -1647,7 +1668,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ab9f6ea77e20e3129235e62a2e6bd64ed932363df104e864ee65ccffb54a8f" dependencies = [ "bech32 0.9.1", - "bitcoin 0.32.2", + "bitcoin 0.32.3", "lightning-types", ] @@ -1658,7 +1679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1083b8d9137000edf3bfcb1ff011c0d25e0cdd2feb98cc21d6765e64a494148f" dependencies = [ "bech32 0.9.1", - "bitcoin 0.32.2", + "bitcoin 0.32.3", "hex-conservative 0.2.1", ] @@ -1670,9 +1691,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lnurl-pay" @@ -1694,9 +1715,9 @@ checksum = "2951a7783efa798febff75dfd9df4716c3ddc5bea969f132b282972a36bc7d8f" dependencies = [ "aes", "anyhow", - "base64 0.22.0", + "base64 0.22.1", "bech32 0.11.0", - "bitcoin 0.32.2", + "bitcoin 0.32.3", "cbc", "email_address", "reqwest", @@ -1708,9 +1729,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1718,17 +1739,17 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.15.0", ] [[package]] @@ -1777,9 +1798,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -1795,11 +1816,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -1843,7 +1864,7 @@ dependencies = [ [[package]] name = "mostro-core" version = "0.6.8" -source = "git+https://github.com/MostroP2P/mostro-core?branch=bilthon-test#4a5998e6b1bc8b278100173760ef555bd4928784" +source = "git+https://github.com/MostroP2P/mostro-core?branch=bilthon-test#5217ba692c7e43346189b55fea1ebcf1ac34440e" dependencies = [ "anyhow", "chrono", @@ -1858,17 +1879,16 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1898,9 +1918,9 @@ dependencies = [ [[package]] name = "nostr" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1534cec170e72b57b82323422ac243716d9817d13ed77f3b952eb5133ebef060" +checksum = "f7948938314ee0392f378ab1a5d58b4707f2207550bc410b1629a80a4f28af7d" dependencies = [ "aes", "base64 0.21.7", @@ -1978,9 +1998,9 @@ dependencies = [ [[package]] name = "nostr-signer" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525574dc32fa07d64d04a6c72b534d97455b1ad954c29753c820c834c94e3704" +checksum = "f99449c2077bef43c02c8f9a9386d01c87e7ad8ece70d7de87a2c59771b4c0fe" dependencies = [ "async-utility", "nostr", @@ -2013,9 +2033,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2036,9 +2056,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -2063,11 +2083,11 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -2084,7 +2104,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -2095,9 +2115,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2134,12 +2154,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] @@ -2158,15 +2178,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.7", "smallvec", - "windows-targets 0.48.5", + "windows-targets", ] [[package]] @@ -2182,15 +2202,15 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" [[package]] name = "pbkdf2" @@ -2210,9 +2230,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.8" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -2221,9 +2241,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.8" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -2231,22 +2251,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.8" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] name = "pest_meta" -version = "2.7.8" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -2260,7 +2280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.6.0", ] [[package]] @@ -2275,22 +2295,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -2307,9 +2327,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "poly1305" @@ -2324,25 +2344,28 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "910d41a655dac3b764f1ade94821093d3610248694320cd072303a8eedcf221d" dependencies = [ "proc-macro2", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -2374,7 +2397,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.57", + "syn 2.0.82", "tempfile", ] @@ -2388,7 +2411,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -2400,11 +2423,59 @@ dependencies = [ "prost", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.15", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring 0.17.8", + "rustc-hash", + "rustls 0.23.15", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2450,23 +2521,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.4" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -2480,13 +2551,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.5", ] [[package]] @@ -2497,27 +2568,27 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.4.3", + "h2 0.4.6", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.2.0", - "hyper-rustls 0.26.0", + "hyper 1.5.0", + "hyper-rustls 0.27.3", "hyper-tls", "hyper-util", "ipnet", @@ -2528,25 +2599,26 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.3", - "rustls-pemfile 2.1.2", + "quinn", + "rustls 0.23.15", + "rustls-pemfile 2.2.0", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tokio-socks", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.1", - "winreg", + "webpki-roots 0.26.6", + "windows-registry", ] [[package]] @@ -2586,7 +2658,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "serde", "serde_derive", ] @@ -2603,26 +2675,32 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -2643,9 +2721,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -2655,28 +2733,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" -dependencies = [ - "log", - "ring 0.17.8", - "rustls-pki-types", - "rustls-webpki 0.102.2", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls" -version = "0.23.7" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -2692,19 +2756,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.0", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -2718,9 +2781,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -2729,15 +2792,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -2750,11 +2813,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2829,11 +2892,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -2842,9 +2905,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -2852,9 +2915,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "send_wrapper" @@ -2864,31 +2927,31 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.212" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "ccd4055b7e3937a5c2595e974f5bf1715a23919a595a04b5ad959bdbbb61ab04" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.212" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "726adf8349784fb68a42e6466f49362ae039d9c5333cc6eb131f4d6f94bb9126" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "itoa", "memchr", "ryu", @@ -2897,9 +2960,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -2938,9 +3001,9 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -2987,11 +3050,17 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3013,9 +3082,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3049,11 +3118,10 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ - "itertools", "nom", "unicode_categories", ] @@ -3080,7 +3148,7 @@ dependencies = [ "byteorder", "bytes", "chrono", - "crc 3.0.1", + "crc 3.2.1", "crossbeam-queue", "dotenvy", "either", @@ -3138,7 +3206,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -3176,26 +3244,26 @@ dependencies = [ [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -3210,9 +3278,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.57" +version = "2.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" +checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" dependencies = [ "proc-macro2", "quote", @@ -3225,22 +3293,31 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -3248,34 +3325,35 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -3299,9 +3377,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -3314,15 +3392,15 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", "libc", "mio", - "parking_lot 0.12.1", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", "socket2", @@ -3348,7 +3426,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -3378,18 +3456,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" -dependencies = [ - "rustls 0.22.3", - "rustls-pki-types", + "rustls 0.21.12", "tokio", ] @@ -3399,16 +3466,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.7", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-socks" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" +checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" dependencies = [ "either", "futures-util", @@ -3418,9 +3485,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -3429,39 +3496,38 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "becd34a233e7e31a3dbf7c7241b38320f57393dcae8e7324b0167d21b8e320b0" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.7", + "rustls 0.23.15", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tungstenite", - "webpki-roots 0.26.1", + "webpki-roots 0.26.6", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.8.12" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -3471,20 +3537,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -3502,15 +3568,15 @@ dependencies = [ "axum", "base64 0.21.7", "bytes", - "h2 0.3.25", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.31", "hyper-timeout", "percent-encoding", "pin-project", "prost", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "tokio", "tokio-rustls 0.24.1", @@ -3531,7 +3597,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -3556,15 +3622,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -3586,7 +3652,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -3647,7 +3713,7 @@ dependencies = [ "httparse", "log", "rand", - "rustls 0.23.7", + "rustls 0.23.15", "rustls-pki-types", "sha1 0.10.6", "thiserror", @@ -3662,21 +3728,21 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -3687,11 +3753,17 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode_categories" @@ -3731,7 +3803,7 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-webpki 0.101.7", "serde", "serde_json", @@ -3742,9 +3814,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -3760,15 +3832,15 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "rand", @@ -3779,13 +3851,13 @@ dependencies = [ [[package]] name = "uuid-macro-internal" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9881bea7cbe687e36c9ab3b778c36cd0487402e270304e8b1296d5085303c1a2" +checksum = "6b91f57fe13a38d0ce9e28a03463d8d3c2468ed03d75375110ec71d93b449a08" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] @@ -3802,9 +3874,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "want" @@ -3823,34 +3895,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -3860,9 +3933,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3870,22 +3943,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-ws" @@ -3906,9 +3979,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -3941,9 +4014,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] @@ -3976,160 +4049,130 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets", ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-registry" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "windows-targets 0.48.5", + "windows-result", + "windows-strings", + "windows-targets", ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "windows-result" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" dependencies = [ - "windows-targets 0.52.4", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-strings" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-result", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.52.4" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows-targets", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.4" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] [[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" +name = "windows_aarch64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] -name = "windows_i686_gnu" -version = "0.52.4" +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "yaml-rust" version = "0.4.5" @@ -4141,26 +4184,27 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.82", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/src/app.rs b/src/app.rs index 2ba9bb08..a14fa9bd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -79,42 +79,49 @@ pub async fn run( match message { Ok(msg) => { if msg.get_inner_message_kind().verify() { - let request_id = msg.get_inner_message_kind().request_id; if let Some(action) = msg.inner_action() { match action { Action::NewOrder => { - if let Err(e) = - order_action(msg, &event, &my_keys, &pool).await + if let Err(e) = order_action( + msg, &event, &my_keys, &pool, request_id, + ) + .await { warning_msg(&action, e) } } Action::TakeSell => { - if let Err(e) = - take_sell_action(msg, &event, &my_keys, &pool, request_id).await + if let Err(e) = take_sell_action( + msg, &event, &my_keys, &pool, request_id, + ) + .await { warning_msg(&action, e) } } Action::TakeBuy => { - if let Err(e) = - take_buy_action(msg, &event, &my_keys, &pool, request_id).await + if let Err(e) = take_buy_action( + msg, &event, &my_keys, &pool, request_id, + ) + .await { warning_msg(&action, e) } } Action::FiatSent => { - if let Err(e) = - fiat_sent_action(msg, &event, &my_keys, &pool).await + if let Err(e) = fiat_sent_action( + msg, &event, &my_keys, &pool, request_id, + ) + .await { warning_msg(&action, e) } } Action::Release => { if let Err(e) = release_action( - msg, &event, &my_keys, &pool, ln_client,request_id + msg, &event, &my_keys, &pool, ln_client, request_id, ) .await { @@ -123,7 +130,7 @@ pub async fn run( } Action::Cancel => { if let Err(e) = cancel_action( - msg, &event, &my_keys, &pool, ln_client,request_id + msg, &event, &my_keys, &pool, ln_client, request_id, ) .await { @@ -131,9 +138,10 @@ pub async fn run( } } Action::AddInvoice => { - if let Err(e) = - add_invoice_action(msg, &event, &my_keys, &pool) - .await + if let Err(e) = add_invoice_action( + msg, &event, &my_keys, &pool, request_id, + ) + .await { warning_msg(&action, e) } @@ -146,6 +154,7 @@ pub async fn run( &my_keys, &pool, rate_list.clone(), + request_id, ) .await { @@ -153,15 +162,17 @@ pub async fn run( } } Action::Dispute => { - if let Err(e) = - dispute_action(msg, &event, &my_keys, &pool).await + if let Err(e) = dispute_action( + msg, &event, &my_keys, &pool, request_id, + ) + .await { warning_msg(&action, e) } } Action::AdminCancel => { if let Err(e) = admin_cancel_action( - msg, &event, &my_keys, &pool, ln_client, + msg, &event, &my_keys, &pool, ln_client, request_id, ) .await { @@ -170,7 +181,7 @@ pub async fn run( } Action::AdminSettle => { if let Err(e) = admin_settle_action( - msg, &event, &my_keys, &pool, ln_client, + msg, &event, &my_keys, &pool, ln_client, request_id, ) .await { @@ -179,7 +190,7 @@ pub async fn run( } Action::AdminAddSolver => { if let Err(e) = admin_add_solver_action( - msg, &event, &my_keys, &pool, + msg, &event, &my_keys, &pool, request_id, ) .await { @@ -187,8 +198,10 @@ pub async fn run( } } Action::AdminTakeDispute => { - if let Err(e) = - admin_take_dispute_action(msg, &event, &pool).await + if let Err(e) = admin_take_dispute_action( + msg, &event, &pool, request_id, + ) + .await { warning_msg(&action, e) } diff --git a/src/app/add_invoice.rs b/src/app/add_invoice.rs index c728c128..a14a0d2d 100644 --- a/src/app/add_invoice.rs +++ b/src/app/add_invoice.rs @@ -18,6 +18,7 @@ pub async fn add_invoice_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, + request_id: u64, ) -> Result<()> { let order_msg = msg.get_inner_message_kind(); let mut order = if let Some(order_id) = order_msg.id { @@ -54,7 +55,7 @@ pub async fn add_invoice_action( }; // Only the buyer can add an invoice if buyer_pubkey != event.sender { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } @@ -171,7 +172,15 @@ pub async fn add_invoice_action( ) .await; } else { - show_hold_invoice(my_keys, None, &buyer_pubkey, &seller_pubkey, order).await?; + show_hold_invoice( + my_keys, + None, + &buyer_pubkey, + &seller_pubkey, + order, + msg.get_inner_message_kind().request_id, + ) + .await?; } Ok(()) diff --git a/src/app/admin_add_solver.rs b/src/app/admin_add_solver.rs index e2dccddf..6b05d471 100644 --- a/src/app/admin_add_solver.rs +++ b/src/app/admin_add_solver.rs @@ -14,6 +14,7 @@ pub async fn admin_add_solver_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, + request_id: u64, ) -> Result<()> { let inner_message = msg.get_inner_message_kind(); let content = if let Some(content) = &inner_message.content { @@ -32,7 +33,7 @@ pub async fn admin_add_solver_action( // Check if the pubkey is Mostro if event.sender.to_string() != my_keys.public_key().to_string() { // We create a Message - send_cant_do_msg(None, None, &event.sender).await; + send_cant_do_msg(request_id, None, None, &event.sender).await; return Ok(()); } let public_key = PublicKey::from_bech32(npubkey)?.to_hex(); @@ -43,7 +44,7 @@ pub async fn admin_add_solver_action( Err(ee) => error!("Error creating solver: {:#?}", ee), } // We create a Message for admin - let message = Message::new_dispute(None, Action::AdminAddSolver, None); + let message = Message::new_dispute(request_id, None, Action::AdminAddSolver, None); let message = message.as_json()?; // Send the message send_dm(&event.sender, message).await?; diff --git a/src/app/admin_cancel.rs b/src/app/admin_cancel.rs index c9a71507..8c695733 100644 --- a/src/app/admin_cancel.rs +++ b/src/app/admin_cancel.rs @@ -22,6 +22,7 @@ pub async fn admin_cancel_action( my_keys: &Keys, pool: &Pool, ln_client: &mut LndConnector, + request_id: u64, ) -> Result<()> { let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { order_id @@ -58,7 +59,12 @@ pub async fn admin_cancel_action( // Was order cooperatively cancelled? if order.status == Status::CooperativelyCanceled.to_string() { - let message = MessageKind::new(Some(order_id), Action::CooperativeCancelAccepted, None); + let message = MessageKind::new( + request_id, + Some(order_id), + Action::CooperativeCancelAccepted, + None, + ); if let Ok(message) = message.as_json() { let _ = send_dm(&event.sender, message).await; } @@ -119,7 +125,7 @@ pub async fn admin_cancel_action( let order_updated = update_order_event(my_keys, Status::CanceledByAdmin, &order).await?; order_updated.update(pool).await?; // We create a Message for cancel - let message = Message::new_order(Some(order.id), Action::AdminCanceled, None); + let message = Message::new_order(request_id, Some(order.id), Action::AdminCanceled, None); let message = message.as_json()?; // Message to admin send_dm(&event.sender, message.clone()).await?; diff --git a/src/app/admin_settle.rs b/src/app/admin_settle.rs index 7a3a163f..2500ef8e 100644 --- a/src/app/admin_settle.rs +++ b/src/app/admin_settle.rs @@ -23,6 +23,7 @@ pub async fn admin_settle_action( my_keys: &Keys, pool: &Pool, ln_client: &mut LndConnector, + request_id: u64, ) -> Result<()> { let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { order_id @@ -59,8 +60,12 @@ pub async fn admin_settle_action( // Was orde cooperatively cancelled? if order.status == Status::CooperativelyCanceled.to_string() { - let message = MessageKind::new( msg.get_inner_message_kind().request_id, - Some(order_id), Action::CooperativeCancelAccepted, None); + let message = MessageKind::new( + msg.get_inner_message_kind().request_id, + Some(order_id), + Action::CooperativeCancelAccepted, + None, + ); if let Ok(message) = message.as_json() { let _ = send_dm(&event.sender, message).await; } @@ -79,7 +84,15 @@ pub async fn admin_settle_action( return Ok(()); } - settle_seller_hold_invoice(event, ln_client, Action::AdminSettled, true, &order).await?; + settle_seller_hold_invoice( + event, + ln_client, + Action::AdminSettled, + true, + &order, + request_id, + ) + .await?; let order_updated = update_order_event(my_keys, Status::SettledHoldInvoice, &order).await?; @@ -113,7 +126,12 @@ pub async fn admin_settle_action( NOSTR_CLIENT.get().unwrap().send_event(event).await?; } // We create a Message for settle - let message = Message::new_order(Some(order_updated.id), Action::AdminSettled, None); + let message = Message::new_order( + request_id, + Some(order_updated.id), + Action::AdminSettled, + None, + ); let message = message.as_json()?; // Message to admin send_dm(&event.sender, message.clone()).await?; @@ -124,7 +142,7 @@ pub async fn admin_settle_action( send_dm(&PublicKey::from_str(buyer_pubkey)?, message.clone()).await?; } - let _ = do_payment(order_updated).await; + let _ = do_payment(order_updated, Some(request_id)).await; Ok(()) } diff --git a/src/app/admin_take_dispute.rs b/src/app/admin_take_dispute.rs index d5696975..13cd1833 100644 --- a/src/app/admin_take_dispute.rs +++ b/src/app/admin_take_dispute.rs @@ -42,6 +42,7 @@ pub async fn admin_take_dispute_action( msg: Message, event: &UnwrappedGift, pool: &Pool, + request_id: u64, ) -> Result<()> { // Find dipute id in the message let dispute_id = if let Some(dispute_id) = msg.get_inner_message_kind().id { @@ -71,7 +72,7 @@ pub async fn admin_take_dispute_action( if let Ok(dispute_status) = Status::from_str(&dispute.status) { if !pubkey_event_can_solve(pool, &event.sender, dispute_status).await { // We create a Message - send_cant_do_msg(Some(dispute_id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(dispute_id), None, &event.sender).await; return Ok(()); } } else { @@ -123,6 +124,7 @@ pub async fn admin_take_dispute_action( ); let msg_to_seller = Message::new_order( + request_id, Some(order.id), Action::AdminTookDispute, Some(Content::Peer(solver_pubkey)), diff --git a/src/app/cancel.rs b/src/app/cancel.rs index ba39494b..ca1e21ff 100644 --- a/src/app/cancel.rs +++ b/src/app/cancel.rs @@ -21,7 +21,7 @@ pub async fn cancel_action( my_keys: &Keys, pool: &Pool, ln_client: &mut LndConnector, - request_id : u64, + request_id: u64, ) -> Result<()> { let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { order_id @@ -80,7 +80,7 @@ pub async fn cancel_action( if order.kind == OrderKind::Buy.to_string() && order.status == Status::WaitingPayment.to_string() { - cancel_pay_hold_invoice(ln_client, &mut order, event, pool, my_keys,request_id).await?; + cancel_pay_hold_invoice(ln_client, &mut order, event, pool, my_keys, request_id).await?; } if order.status == Status::Active.to_string() @@ -106,7 +106,7 @@ pub async fn cancel_action( Some(ref initiator_pubkey) => { if initiator_pubkey == &user_pubkey { // We create a Message - send_cant_do_msg(Some(order_id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order_id), None, &event.sender).await; return Ok(()); } else { if let Some(hash) = &order.hash { @@ -178,7 +178,7 @@ pub async fn cancel_add_invoice( event: &UnwrappedGift, pool: &Pool, my_keys: &Keys, - request_id : u64, + request_id: u64, ) -> Result<()> { if let Some(hash) = &order.hash { ln_client.cancel_hold_invoice(hash).await?; @@ -195,7 +195,7 @@ pub async fn cancel_add_invoice( if buyer_pubkey != &user_pubkey { // We create a Message - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } @@ -245,7 +245,7 @@ pub async fn cancel_pay_hold_invoice( event: &UnwrappedGift, pool: &Pool, my_keys: &Keys, - request_id : u64, + request_id: u64, ) -> Result<()> { if order.hash.is_some() { // We return funds to seller @@ -264,7 +264,7 @@ pub async fn cancel_pay_hold_invoice( if seller_pubkey.to_string() != user_pubkey { // We create a Message - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } diff --git a/src/app/dispute.rs b/src/app/dispute.rs index fc64ac4b..6f09502e 100644 --- a/src/app/dispute.rs +++ b/src/app/dispute.rs @@ -21,6 +21,7 @@ pub async fn dispute_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, + request_id: u64, ) -> Result<()> { let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { order_id @@ -85,7 +86,7 @@ pub async fn dispute_action( // Add a check in case of no counterpart found if counterpart.is_empty() { // We create a Message - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); }; diff --git a/src/app/fiat_sent.rs b/src/app/fiat_sent.rs index 2348789c..672de723 100644 --- a/src/app/fiat_sent.rs +++ b/src/app/fiat_sent.rs @@ -15,6 +15,7 @@ pub async fn fiat_sent_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, + request_id: u64, ) -> Result<()> { let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { order_id @@ -42,7 +43,7 @@ pub async fn fiat_sent_action( } // Check if the pubkey is the buyer if Some(event.sender.to_string()) != order.buyer_pubkey { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } diff --git a/src/app/order.rs b/src/app/order.rs index b8372c1c..1f72eaf4 100644 --- a/src/app/order.rs +++ b/src/app/order.rs @@ -14,7 +14,7 @@ pub async fn order_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, - request_id:u64, + request_id: u64, ) -> Result<()> { if let Some(order) = msg.get_inner_message_kind().get_order() { let mostro_settings = Settings::get_mostro(); @@ -46,7 +46,7 @@ pub async fn order_action( // in case of single order do like usual if let (Some(min), Some(max)) = (order.min_amount, order.max_amount) { if min >= max { - send_cant_do_msg(order.id, None, &event.sender).await; + send_cant_do_msg(request_id, order.id, None, &event.sender).await; return Ok(()); } if order.amount == 0 { @@ -115,6 +115,7 @@ pub async fn order_action( order, &event.sender.to_string(), event.sender, + request_id, ) .await?; } diff --git a/src/app/rate_user.rs b/src/app/rate_user.rs index 5fcc6d17..6e741b5a 100644 --- a/src/app/rate_user.rs +++ b/src/app/rate_user.rs @@ -51,6 +51,7 @@ pub async fn update_user_reputation_action( my_keys: &Keys, pool: &Pool, rate_list: Arc>>, + request_id: u64, ) -> Result<()> { let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { order_id @@ -75,7 +76,7 @@ pub async fn update_user_reputation_action( let message_sender = event.sender.to_string(); if order.status != Status::Success.to_string() { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; error!("Order Id {order_id} wrong status"); return Ok(()); } @@ -96,7 +97,7 @@ pub async fn update_user_reputation_action( // Add a check in case of no counterpart found if counterpart.is_empty() { // We create a Message - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); }; diff --git a/src/app/release.rs b/src/app/release.rs index bc554f53..b6d6c244 100644 --- a/src/app/release.rs +++ b/src/app/release.rs @@ -22,7 +22,7 @@ use std::str::FromStr; use tokio::sync::mpsc::channel; use tracing::{error, info}; -pub async fn check_failure_retries(order: &Order, request_id:u64) -> Result { +pub async fn check_failure_retries(order: &Order, request_id: Option) -> Result { let mut order = order.clone(); // Handle to db here @@ -45,7 +45,7 @@ pub async fn check_failure_retries(order: &Order, request_id:u64) -> Result, ln_client: &mut LndConnector, - request_id : u64, + request_id: u64, ) -> Result<()> { // Check if order id is ok let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { @@ -111,11 +111,19 @@ pub async fn release_action( } if &seller_pubkey.to_string() != seller_pubkey_hex { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } - settle_seller_hold_invoice(event, ln_client, Action::Released, false, &order).await?; + settle_seller_hold_invoice( + event, + ln_client, + Action::Released, + false, + &order, + request_id, + ) + .await?; let order_updated = update_order_event(my_keys, Status::SettledHoldInvoice, &order).await?; @@ -144,12 +152,12 @@ pub async fn release_action( ) .await; - let _ = do_payment(order_updated,request_id).await; + let _ = do_payment(order_updated, Some(request_id)).await; Ok(()) } -pub async fn do_payment(mut order: Order,request_id:u64) -> Result<()> { +pub async fn do_payment(mut order: Order, request_id: Option) -> Result<()> { // Finally we try to pay buyer's invoice let payment_request = match order.buyer_invoice.as_ref() { Some(req) => req.to_string(), @@ -169,7 +177,7 @@ pub async fn do_payment(mut order: Order,request_id:u64) -> Result<()> { let payment_task = ln_client_payment.send_payment(&payment_request, amount as i64, tx); if let Err(paymement_result) = payment_task.await { info!("Error during ln payment : {}", paymement_result); - if let Ok(failed_payment) = check_failure_retries(&order, request_id).await { + if let Ok(failed_payment) = check_failure_retries(&order, None).await { info!( "Order id {} has {} failed payments retries", failed_payment.id, failed_payment.payment_attempts @@ -205,7 +213,7 @@ pub async fn do_payment(mut order: Order,request_id:u64) -> Result<()> { &buyer_pubkey, &seller_pubkey, &my_keys, - request_id, + request_id.unwrap_or(1), ) .await; } @@ -216,7 +224,9 @@ pub async fn do_payment(mut order: Order,request_id:u64) -> Result<()> { ); // Mark payment as failed - if let Ok(failed_payment) = check_failure_retries(&order, request_id).await { + if let Ok(failed_payment) = + check_failure_retries(&order, request_id).await + { info!( "Order id {} has {} failed payments retries", failed_payment.id, failed_payment.payment_attempts @@ -238,7 +248,7 @@ async fn payment_success( buyer_pubkey: &PublicKey, seller_pubkey: &PublicKey, my_keys: &Keys, - request_id : u64, + request_id: u64, ) -> Result<()> { // Purchase completed message to buyer send_new_order_msg( @@ -341,8 +351,8 @@ async fn payment_success( Ordering::Less => {} } } else { - send_cant_do_msg(Some(order.id), None, buyer_pubkey).await; - send_cant_do_msg(Some(order.id), None, seller_pubkey).await; + send_cant_do_msg(request_id, Some(order.id), None, buyer_pubkey).await; + send_cant_do_msg(request_id, Some(order.id), None, seller_pubkey).await; } } } @@ -356,7 +366,7 @@ async fn payment_success( let pool = db::connect().await?; if let Ok(order_success) = order_updated.update(&pool).await { // Adding here rate process - rate_counterpart(buyer_pubkey, seller_pubkey, &order_success).await?; + rate_counterpart(buyer_pubkey, seller_pubkey, &order_success, request_id).await?; } } Ok(()) diff --git a/src/app/take_buy.rs b/src/app/take_buy.rs index 7f36e8b4..072d98f2 100644 --- a/src/app/take_buy.rs +++ b/src/app/take_buy.rs @@ -18,7 +18,7 @@ pub async fn take_buy_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, - request_id : u64, + request_id: u64, ) -> Result<()> { // Safe unwrap as we verified the message let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { @@ -36,13 +36,13 @@ pub async fn take_buy_action( }; // Maker can't take own order if order.creator_pubkey == event.sender.to_hex() { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } if order.kind != Kind::Buy.to_string() { error!("Order Id {order_id} wrong kind"); - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } @@ -96,8 +96,13 @@ 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, + request_id, + ) + .await?; // Update order with new sats value order.amount = new_sats_amount; order.fee = fee; @@ -106,6 +111,14 @@ pub async fn take_buy_action( // Timestamp order take time order.taken_at = Timestamp::now().as_u64() as i64; - show_hold_invoice(my_keys, None, &buyer_pubkey, &seller_pubkey, order).await?; + show_hold_invoice( + my_keys, + None, + &buyer_pubkey, + &seller_pubkey, + order, + request_id, + ) + .await?; Ok(()) } diff --git a/src/app/take_sell.rs b/src/app/take_sell.rs index 1ab7f10f..8a2dcd8d 100644 --- a/src/app/take_sell.rs +++ b/src/app/take_sell.rs @@ -19,7 +19,7 @@ pub async fn take_sell_action( event: &UnwrappedGift, my_keys: &Keys, pool: &Pool, - request_id :u64, + request_id: u64, ) -> Result<()> { // Safe unwrap as we verified the message let order_id = if let Some(order_id) = msg.get_inner_message_kind().id { @@ -37,7 +37,7 @@ pub async fn take_sell_action( // Maker can't take own order if order.creator_pubkey == event.sender.to_hex() { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Ok(()); } @@ -67,7 +67,13 @@ pub async fn take_sell_action( { Ok(_) => Some(payment_request), Err(e) => { - send_cant_do_msg(Some(order.id), Some(e.to_string()), &event.sender).await; + send_cant_do_msg( + request_id, + Some(order.id), + Some(e.to_string()), + &event.sender, + ) + .await; error!("{e}"); return Ok(()); } @@ -121,15 +127,20 @@ 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, request_id).await?; + let (new_sats_amount, fee) = get_market_amount_and_fee( + order.fiat_amount, + &order.fiat_code, + order.premium, + request_id, + ) + .await?; // Update order with new sats value order.amount = new_sats_amount; order.fee = fee; } if pr.is_none() { - match set_waiting_invoice_status(&mut order, buyer_pubkey).await { + match set_waiting_invoice_status(&mut order, buyer_pubkey, request_id).await { Ok(_) => { // Update order status if let Ok(order_updated) = @@ -145,7 +156,15 @@ pub async fn take_sell_action( } } } else { - show_hold_invoice(my_keys, pr, &buyer_pubkey, &seller_pubkey, order).await?; + show_hold_invoice( + my_keys, + pr, + &buyer_pubkey, + &seller_pubkey, + order, + request_id, + ) + .await?; } Ok(()) } diff --git a/src/flow.rs b/src/flow.rs index 9fadde89..faf9d9af 100644 --- a/src/flow.rs +++ b/src/flow.rs @@ -7,7 +7,7 @@ use sqlx_crud::Crud; use std::str::FromStr; use tracing::{error, info}; -pub async fn hold_invoice_paid(hash: &str, request_id:u64) -> Result<()> { +pub async fn hold_invoice_paid(hash: &str, request_id: Option) -> Result<()> { let pool = crate::db::connect().await?; let order = crate::db::find_order_by_hash(&pool, hash).await?; let my_keys = crate::util::get_keys()?; @@ -61,7 +61,7 @@ pub async fn hold_invoice_paid(hash: &str, request_id:u64) -> Result<()> { order_data.status = Some(status); // We send a confirmation message to seller send_new_order_msg( - request_id, + request_id.unwrap_or(1), Some(order.id), Action::BuyerTookOrder, Some(Content::Order(order_data.clone())), @@ -70,7 +70,7 @@ pub async fn hold_invoice_paid(hash: &str, request_id:u64) -> Result<()> { .await; // We send a message to buyer saying seller paid send_new_order_msg( - request_id, + request_id.unwrap_or(1), Some(order.id), Action::HoldInvoicePaymentAccepted, Some(Content::Order(order_data)), @@ -86,7 +86,7 @@ pub async fn hold_invoice_paid(hash: &str, request_id:u64) -> Result<()> { order_data.master_seller_pubkey = None; // We ask to buyer for a new invoice send_new_order_msg( - request_id, + request_id.unwrap_or(1), Some(order.id), Action::AddInvoice, Some(Content::Order(order_data)), @@ -96,7 +96,7 @@ pub async fn hold_invoice_paid(hash: &str, request_id:u64) -> Result<()> { // We send a message to seller we are waiting for buyer invoice send_new_order_msg( - request_id, + request_id.unwrap_or(1), Some(order.id), Action::WaitingBuyerInvoice, None, diff --git a/src/main.rs b/src/main.rs index d893be77..9ec6bbc1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,7 +81,7 @@ async fn main() -> Result<()> { for invoice in held_invoices.iter() { if let Some(hash) = &invoice.hash { info!("Resubscribing order id - {}", invoice.id); - if let Err(e) = invoice_subscribe(hash.as_bytes().to_vec()).await { + if let Err(e) = invoice_subscribe(hash.as_bytes().to_vec(), None).await { tracing::error!("Ln node error {e}") } } diff --git a/src/scheduler.rs b/src/scheduler.rs index 48d6761f..35e0a875 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -104,7 +104,7 @@ async fn job_retry_failed_payments() { if let Ok(payment_failed_list) = crate::db::find_failed_payment(&pool).await { for payment_failed in payment_failed_list.into_iter() { if payment_failed.payment_attempts < retries_number { - if let Err(e) = do_payment(payment_failed.clone()).await { + if let Err(e) = do_payment(payment_failed.clone(), None).await { error!("{e}"); } } diff --git a/src/util.rs b/src/util.rs index 7c0e5027..f6ccc109 100644 --- a/src/util.rs +++ b/src/util.rs @@ -390,7 +390,7 @@ pub async fn show_hold_invoice( new_order.status = Some(Status::WaitingPayment); // We create a Message to send the hold invoice to seller send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::PayInvoice, Some(Content::PaymentRequest( @@ -411,13 +411,13 @@ pub async fn show_hold_invoice( ) .await; - let _ = invoice_subscribe(hash, request_id).await; + let _ = invoice_subscribe(hash, Some(request_id)).await; Ok(()) } // Create function to reuse in case of resubscription -pub async fn invoice_subscribe(hash: Vec, request_id:u64) -> anyhow::Result<()> { +pub async fn invoice_subscribe(hash: Vec, request_id: Option) -> anyhow::Result<()> { let mut ln_client_invoices = lightning::LndConnector::new().await?; let (tx, mut rx) = channel(100); @@ -466,7 +466,7 @@ pub async fn get_market_amount_and_fee( fiat_amount: i64, fiat_code: &str, premium: i64, - request_id:u64, + _request_id: u64, ) -> Result<(i64, i64)> { // Update amount order let new_sats_amount = get_market_quote(&fiat_amount, fiat_code, premium).await?; @@ -476,7 +476,11 @@ pub async fn get_market_amount_and_fee( } /// Set order sats amount, this used when a buyer take a sell order -pub async fn set_waiting_invoice_status(order: &mut Order, buyer_pubkey: PublicKey) -> Result { +pub async fn set_waiting_invoice_status( + order: &mut Order, + buyer_pubkey: PublicKey, + request_id: u64, +) -> Result { let kind = OrderKind::from_str(&order.kind).unwrap(); let status = Status::WaitingBuyerInvoice; @@ -519,18 +523,11 @@ pub async fn rate_counterpart( buyer_pubkey: &PublicKey, seller_pubkey: &PublicKey, order: &Order, - request_id :u64, + request_id: u64, ) -> Result<()> { // Send dm to counterparts // to buyer - send_new_order_msg( - request_id, - Some(order.id), - Action::Rate, - None, - buyer_pubkey, - ) - .await; + send_new_order_msg(request_id, Some(order.id), Action::Rate, None, buyer_pubkey).await; // to seller send_new_order_msg( request_id, @@ -552,10 +549,11 @@ pub async fn settle_seller_hold_invoice( action: Action, is_admin: bool, order: &Order, + request_id: u64, ) -> Result<()> { // Check if the pubkey is right if !is_admin && event.sender.to_string() != *order.seller_pubkey.as_ref().unwrap().to_string() { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Err(Error::msg("Not allowed")); } @@ -564,7 +562,7 @@ pub async fn settle_seller_hold_invoice( ln_client.settle_hold_invoice(preimage).await?; info!("{action}: Order Id {}: hold invoice settled", order.id); } else { - send_cant_do_msg(Some(order.id), None, &event.sender).await; + send_cant_do_msg(request_id, Some(order.id), None, &event.sender).await; return Err(Error::msg("No preimage")); } Ok(()) @@ -578,6 +576,7 @@ pub fn bytes_to_string(bytes: &[u8]) -> String { } pub async fn send_cant_do_msg( + request_id: u64, order_id: Option, message: Option, destination_key: &PublicKey, @@ -586,7 +585,7 @@ pub async fn send_cant_do_msg( let content = message.map(Content::TextMessage); // Send message to event creator - let message = Message::cant_do(order_id, content); + let message = Message::cant_do(request_id, order_id, content); if let Ok(message) = message.as_json() { let _ = send_dm(destination_key, message).await; } From fb2499ec363887fd1dffb3f558a284d648b32b03 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Tue, 22 Oct 2024 22:32:10 +0200 Subject: [PATCH 3/8] fix tests --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9ec6bbc1..bdbd4722 100644 --- a/src/main.rs +++ b/src/main.rs @@ -108,7 +108,7 @@ mod tests { #[test] fn test_message_deserialize_serialize() { - let sample_message = r#"{"order":{"version":1,"id":"7dd204d2-d06c-4406-a3d9-4415f4a8b9c9","action":"fiat-sent","content":null}}"#; + let sample_message = r#"{"order":{"version":1,"request_id":1,"id":"7dd204d2-d06c-4406-a3d9-4415f4a8b9c9","action":"fiat-sent","content":null}}"#; let message = Message::from_json(sample_message).unwrap(); assert!(message.verify()); let json_message = message.as_json().unwrap(); @@ -117,7 +117,7 @@ mod tests { #[test] fn test_wrong_message_should_fail() { - let sample_message = r#"{"order":{"version":1,"action":"take-sell","content":{"order":{"kind":"sell","status":"pending","amount":100,"fiat_code":"XXX","fiat_amount":10,"payment_method":"SEPA","premium":1,"payment_request":null,"created_at":1640839235}}}}"#; + let sample_message = r#"{"order":{"version":1,"request_id":1,"action":"take-sell","content":{"order":{"kind":"sell","status":"pending","amount":100,"fiat_code":"XXX","fiat_amount":10,"payment_method":"SEPA","premium":1,"payment_request":null,"created_at":1640839235}}}}"#; let message = Message::from_json(sample_message).unwrap(); assert!(!message.verify()); } From 1bf8729975f023ecf64ce380a12452d092e34af6 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Tue, 22 Oct 2024 23:58:39 +0200 Subject: [PATCH 4/8] fixed cargo.toml --- Cargo.lock | 11 +++++++++++ Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index d28961b6..1ddf1b2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1850,6 +1850,7 @@ dependencies = [ "mostro-core", "nostr-sdk", "once_cell", + "openssl", "reqwest", "serde", "serde_json", @@ -2113,6 +2114,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.3.2+3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.104" @@ -2121,6 +2131,7 @@ checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 60479870..992b15ba 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" From 76f65dc4263de11ad52e1173ae1978fd734dbac9 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Sun, 27 Oct 2024 12:48:00 +0100 Subject: [PATCH 5/8] updated mostro-core --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ddf1b2c..f1f9efff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1864,8 +1864,9 @@ dependencies = [ [[package]] name = "mostro-core" -version = "0.6.8" -source = "git+https://github.com/MostroP2P/mostro-core?branch=bilthon-test#5217ba692c7e43346189b55fea1ebcf1ac34440e" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c615cf67e7952594d7c7a9e65a831284f3a45ac2fc90796dde7626dc5024b266" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 992b15ba..50da4823 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ uuid = { version = "1.8.0", features = [ "serde", ] } reqwest = { version = "0.12.1", features = ["json"] } -mostro-core = { git = "https://github.com/MostroP2P/mostro-core", branch = "bilthon-test", features = ["sqlx"] } +mostro-core = { version = "0.6.9", features = ["sqlx"] } tracing = "0.1.40" tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } config = "0.14.0" From 169a76384c08de647d7b8599cbb8c3b47ba7c01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Calder=C3=B3n?= Date: Wed, 6 Nov 2024 12:59:23 -0300 Subject: [PATCH 6/8] Use request_id from parameter --- src/app/add_invoice.rs | 12 ++++++------ src/app/admin_take_dispute.rs | 6 +++--- src/app/cancel.rs | 10 +++++----- src/app/fiat_sent.rs | 4 ++-- src/app/order.rs | 15 +++++++-------- src/app/take_buy.rs | 4 ++-- src/app/take_sell.rs | 4 ++-- 7 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/app/add_invoice.rs b/src/app/add_invoice.rs index a14a0d2d..b05c3dd1 100644 --- a/src/app/add_invoice.rs +++ b/src/app/add_invoice.rs @@ -75,7 +75,7 @@ pub async fn add_invoice_action( Ok(_) => payment_request, Err(_) => { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::IncorrectInvoiceAmount, None, @@ -99,7 +99,7 @@ pub async fn add_invoice_action( order.payment_attempts = 0; order.clone().update(pool).await?; send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::InvoiceUpdated, None, @@ -110,7 +110,7 @@ pub async fn add_invoice_action( } _ => { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -155,7 +155,7 @@ pub async fn add_invoice_action( // We send a confirmation message to seller send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::BuyerTookOrder, Some(Content::Order(order_data.clone())), @@ -164,7 +164,7 @@ pub async fn add_invoice_action( .await; // We send a message to buyer saying seller paid send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::HoldInvoicePaymentAccepted, Some(Content::Order(order_data)), @@ -178,7 +178,7 @@ pub async fn add_invoice_action( &buyer_pubkey, &seller_pubkey, order, - msg.get_inner_message_kind().request_id, + request_id, ) .await?; } diff --git a/src/app/admin_take_dispute.rs b/src/app/admin_take_dispute.rs index 13cd1833..7b0618cc 100644 --- a/src/app/admin_take_dispute.rs +++ b/src/app/admin_take_dispute.rs @@ -57,7 +57,7 @@ pub async fn admin_take_dispute_action( None => { // We create a Message send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(dispute_id), Action::NotFound, None, @@ -106,7 +106,7 @@ pub async fn admin_take_dispute_action( // We create a Message for admin let message = Message::new_dispute( - msg.get_inner_message_kind().request_id, + request_id, Some(dispute_id), Action::AdminTookDispute, Some(Content::Order(new_order)), @@ -117,7 +117,7 @@ pub async fn admin_take_dispute_action( // to them know who will assist them on the dispute let solver_pubkey = Peer::new(event.sender.to_hex()); let msg_to_buyer = Message::new_order( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::AdminTookDispute, Some(Content::Peer(solver_pubkey.clone())), diff --git a/src/app/cancel.rs b/src/app/cancel.rs index ca1e21ff..154448f7 100644 --- a/src/app/cancel.rs +++ b/src/app/cancel.rs @@ -43,7 +43,7 @@ pub async fn cancel_action( if user_pubkey != order.creator_pubkey { // We create a Message send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::IsNotYourOrder, None, @@ -125,7 +125,7 @@ pub async fn cancel_action( update_order_event(my_keys, Status::CooperativelyCanceled, &order).await?; // We create a Message for an accepted cooperative cancel and send it to both parties send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::CooperativeCancelAccepted, None, @@ -134,7 +134,7 @@ pub async fn cancel_action( .await; let counterparty_pubkey = PublicKey::from_str(&counterparty_pubkey)?; send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::CooperativeCancelAccepted, None, @@ -150,7 +150,7 @@ pub async fn cancel_action( let order = order.update(pool).await?; // We create a Message to start a cooperative cancel and send it to both parties send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::CooperativeCancelInitiatedByYou, None, @@ -159,7 +159,7 @@ pub async fn cancel_action( .await; let counterparty_pubkey = PublicKey::from_str(&counterparty_pubkey)?; send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::CooperativeCancelInitiatedByPeer, None, diff --git a/src/app/fiat_sent.rs b/src/app/fiat_sent.rs index 672de723..274b9111 100644 --- a/src/app/fiat_sent.rs +++ b/src/app/fiat_sent.rs @@ -32,7 +32,7 @@ pub async fn fiat_sent_action( // Send to user a DM with the error if order.status != Status::Active.to_string() { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -64,7 +64,7 @@ pub async fn fiat_sent_action( // We a message to the seller send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::FiatSentOk, Some(Content::Peer(peer)), diff --git a/src/app/order.rs b/src/app/order.rs index 1f72eaf4..3f2ca09d 100644 --- a/src/app/order.rs +++ b/src/app/order.rs @@ -27,7 +27,7 @@ pub async fn order_action( Ok(_) => (), Err(_) => { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, order.id, Action::IncorrectInvoiceAmount, None, @@ -49,13 +49,9 @@ pub async fn order_action( send_cant_do_msg(request_id, order.id, None, &event.sender).await; return Ok(()); } - if order.amount == 0 { - amount_vec.clear(); - amount_vec.push(min); - amount_vec.push(max); - } else { + if order.amount != 0 { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, None, Action::InvalidSatsAmount, None, @@ -64,6 +60,9 @@ pub async fn order_action( .await; return Ok(()); } + amount_vec.clear(); + amount_vec.push(min); + amount_vec.push(max); } for fiat_amount in amount_vec.iter() { @@ -84,7 +83,7 @@ pub async fn order_action( // Check amount is positive - extra safety check if quote < 0 { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, None, Action::InvalidSatsAmount, None, diff --git a/src/app/take_buy.rs b/src/app/take_buy.rs index 072d98f2..530ced3a 100644 --- a/src/app/take_buy.rs +++ b/src/app/take_buy.rs @@ -68,7 +68,7 @@ pub async fn take_buy_action( Status::Pending => {} _ => { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -84,7 +84,7 @@ pub async fn take_buy_action( order.fiat_amount = am; } else { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::OutOfRangeFiatAmount, None, diff --git a/src/app/take_sell.rs b/src/app/take_sell.rs index 8a2dcd8d..6f66cd1b 100644 --- a/src/app/take_sell.rs +++ b/src/app/take_sell.rs @@ -94,7 +94,7 @@ pub async fn take_sell_action( Status::Pending => {} _ => { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::NotAllowedByStatus, None, @@ -110,7 +110,7 @@ pub async fn take_sell_action( order.fiat_amount = am; } else { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, Some(order.id), Action::OutOfRangeFiatAmount, None, From 1689ba922c386950fa2e6e479dbe5b381eb24220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Calder=C3=B3n?= Date: Wed, 6 Nov 2024 14:15:55 -0300 Subject: [PATCH 7/8] Replaced last get_inner_message_kind().request_id --- src/app/order.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/order.rs b/src/app/order.rs index 3f2ca09d..c7cf4be7 100644 --- a/src/app/order.rs +++ b/src/app/order.rs @@ -97,7 +97,7 @@ pub async fn order_action( || quote < mostro_settings.min_payment_amount as i64 { send_new_order_msg( - msg.get_inner_message_kind().request_id, + request_id, None, Action::OutOfRangeSatsAmount, None, From 2459b0e5b8d1d8ad835a28a689a0b4eaafdb5fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Calder=C3=B3n?= Date: Thu, 7 Nov 2024 10:27:56 -0300 Subject: [PATCH 8/8] Fix test --- src/util.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.rs b/src/util.rs index c9328f9e..9057078e 100644 --- a/src/util.rs +++ b/src/util.rs @@ -320,7 +320,7 @@ pub async fn update_order_event(keys: &Keys, status: Status, order: &Order) -> R order_id, status.to_string() ); - + if let Ok(client) = get_nostr_client() { if client.send_event(event).await.is_err() { tracing::warn!("order id : {} is expired", order_updated.id) @@ -741,6 +741,7 @@ mod tests { ..Default::default() }; let message = Message::Order(MessageKind::new( + 1, Some(uuid), Action::TakeSell, Some(Content::Amount(order.amount)),