diff --git a/src/app/admin_add_solver.rs b/src/app/admin_add_solver.rs index 23f542a6..f2962455 100644 --- a/src/app/admin_add_solver.rs +++ b/src/app/admin_add_solver.rs @@ -33,7 +33,7 @@ pub async fn admin_add_solver_action( // Check if the pubkey is Mostro if event.pubkey.to_bech32()? != mostro_pubkey { // We create a Message - let message = Message::cant_do( None, None, None); + let message = Message::cant_do(None, None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; diff --git a/src/app/admin_settle.rs b/src/app/admin_settle.rs index c6c7a95e..06a8ed31 100644 --- a/src/app/admin_settle.rs +++ b/src/app/admin_settle.rs @@ -43,7 +43,7 @@ pub async fn admin_settle_action( d.update(pool).await?; } // We create a Message - let message = Message::new( Some(order.id), None, Action::AdminSettle, None); + let message = Message::new(Some(order.id), None, Action::AdminSettle, None); let message = message.as_json()?; // Message to admin send_dm(client, my_keys, &event.pubkey, message.clone()).await?; diff --git a/src/app/admin_take_dispute.rs b/src/app/admin_take_dispute.rs index b12f631c..96d47d60 100644 --- a/src/app/admin_take_dispute.rs +++ b/src/app/admin_take_dispute.rs @@ -33,7 +33,7 @@ pub async fn admin_take_dispute_action( // TODO: solvers also can take disputes if event.pubkey.to_bech32()? != mostro_pubkey { // We create a Message - let message = Message::cant_do( None, None, None); + let message = Message::cant_do(None, None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; @@ -43,7 +43,7 @@ pub async fn admin_take_dispute_action( take_dispute(pool, &Status::InProgress, dispute_id, &event.pubkey).await?; // We create a Message for admin - let message = Message::new( None, None, Action::AdminAddSolver, None); + let message = Message::new(None, None, Action::AdminAddSolver, None); let message = message.as_json()?; // Send the message send_dm(client, my_keys, &event.pubkey, message.clone()).await?; diff --git a/src/app/cancel.rs b/src/app/cancel.rs index 93ddc876..5f47d81c 100644 --- a/src/app/cancel.rs +++ b/src/app/cancel.rs @@ -33,7 +33,7 @@ pub async fn cancel_action( // Validates if this user is the order creator if user_pubkey != order.creator_pubkey { // We create a Message - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; } else { @@ -41,7 +41,7 @@ pub async fn cancel_action( // and update on local database the status and new event id update_order_event(pool, client, my_keys, Status::Canceled, &order, None).await?; // We create a Message for cancel - let message = Message::new( Some(order.id), None, Action::Cancel, None); + let message = Message::new(Some(order.id), None, Action::Cancel, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; } @@ -74,7 +74,7 @@ pub async fn cancel_action( Some(ref initiator_pubkey) => { if initiator_pubkey == &user_pubkey { // We create a Message - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; @@ -164,7 +164,7 @@ pub async fn cancel_add_invoice( let seller_pubkey = XOnlyPublicKey::from_bech32(seller_pubkey)?; if buyer_pubkey_bech32 != &user_pubkey { // We create a Message - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; @@ -184,7 +184,7 @@ pub async fn cancel_add_invoice( ) .await?; // We create a Message for cancel - let message = Message::new( Some(order.id), None, Action::Cancel, None); + let message = Message::new(Some(order.id), None, Action::Cancel, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message.clone()).await?; send_dm(client, my_keys, &seller_pubkey, message).await?; @@ -227,7 +227,7 @@ pub async fn cancel_pay_hold_invoice( let seller_pubkey = XOnlyPublicKey::from_bech32(seller_pubkey_bech32)?; if seller_pubkey_bech32 != &user_pubkey { // We create a Message - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; @@ -239,7 +239,7 @@ pub async fn cancel_pay_hold_invoice( // and update on local database the status and new event id update_order_event(pool, client, my_keys, Status::Canceled, order, None).await?; // We create a Message for cancel - let message = Message::new( Some(order.id), None, Action::Cancel, None); + let message = Message::new(Some(order.id), None, Action::Cancel, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message.clone()).await?; send_dm(client, my_keys, &seller_pubkey, message).await?; diff --git a/src/app/dispute.rs b/src/app/dispute.rs index 6e68fcbe..4393e468 100644 --- a/src/app/dispute.rs +++ b/src/app/dispute.rs @@ -48,7 +48,7 @@ pub async fn dispute_action( // Add a check in case of no counterpart found if counterpart.is_empty() { // We create a Message - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; @@ -71,7 +71,7 @@ pub async fn dispute_action( add_dispute(&dispute, pool).await?; // We create a Message for the initiator - let message = Message::new( Some(order.id), None, Action::DisputeInitiatedByYou, None); + let message = Message::new(Some(order.id), None, Action::DisputeInitiatedByYou, None); let message = message.as_json()?; let initiator_pubkey = XOnlyPublicKey::from_bech32(message_sender)?; send_dm(client, my_keys, &initiator_pubkey, message).await?; diff --git a/src/app/fiat_sent.rs b/src/app/fiat_sent.rs index b8ebfc2c..a7736abd 100644 --- a/src/app/fiat_sent.rs +++ b/src/app/fiat_sent.rs @@ -31,7 +31,7 @@ pub async fn fiat_sent_action( // Check if the pubkey is the buyer if Some(event.pubkey.to_bech32()?) != order.buyer_pubkey { // We create a Message - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; diff --git a/src/app/order.rs b/src/app/order.rs index ba24fbda..95a715a9 100644 --- a/src/app/order.rs +++ b/src/app/order.rs @@ -37,7 +37,7 @@ pub async fn order_action( Some(ref pk) => pk, None => { // We create a Message - let message = Message::cant_do( order.id, None, None); + let message = Message::cant_do(order.id, None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; diff --git a/src/app/rate_user.rs b/src/app/rate_user.rs index 37959bba..516b00f4 100644 --- a/src/app/rate_user.rs +++ b/src/app/rate_user.rs @@ -65,7 +65,7 @@ pub async fn update_user_reputation_action( let message_sender = event.pubkey.to_bech32()?; if order.status != "Success" { - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; error!("Order Id {order_id} wrong status"); @@ -89,7 +89,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 - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; diff --git a/src/app/release.rs b/src/app/release.rs index 8a79a74d..8e5d16a9 100644 --- a/src/app/release.rs +++ b/src/app/release.rs @@ -50,7 +50,7 @@ pub async fn release_action( let message = message.as_json()?; send_dm(client, my_keys, &seller_pubkey, message).await?; // We send a message to buyer indicating seller released funds - let message = Message::new( Some(order.id), None, Action::Release, None); + let message = Message::new(Some(order.id), None, Action::Release, None); let message = message.as_json()?; let buyer_pubkey = XOnlyPublicKey::from_bech32(order.buyer_pubkey.as_ref().unwrap())?; send_dm(client, my_keys, &buyer_pubkey, message).await?; @@ -85,7 +85,7 @@ pub async fn release_action( ); // Purchase completed message to buyer let message = - Message::new( Some(order.id), None, Action::PurchaseCompleted, None); + Message::new(Some(order.id), None, Action::PurchaseCompleted, None); let message = message.as_json().unwrap(); send_dm(&client, &my_keys, &buyer_pubkey, message) .await diff --git a/src/app/take_buy.rs b/src/app/take_buy.rs index 0e928448..7bc897b9 100644 --- a/src/app/take_buy.rs +++ b/src/app/take_buy.rs @@ -29,7 +29,7 @@ pub async fn take_buy_action( // We check if the message have a pubkey if msg.get_inner_message_kind().pubkey.is_none() { // We create a Message - let message = Message::cant_do( Some(order.id), None, None); + let message = Message::cant_do(Some(order.id), None, None); let message = message.as_json()?; send_dm(client, my_keys, &event.pubkey, message).await?; @@ -64,7 +64,8 @@ pub async fn take_buy_action( return Ok(()); } // We update the master pubkey - edit_master_seller_pubkey_order(pool, order.id, msg.get_inner_message_kind().pubkey.clone()).await?; + edit_master_seller_pubkey_order(pool, order.id, msg.get_inner_message_kind().pubkey.clone()) + .await?; let seller_pubkey = event.pubkey; // Seller can take pending orders only if order_status != Status::Pending { diff --git a/src/app/take_sell.rs b/src/app/take_sell.rs index 71f61a13..f62ff440 100644 --- a/src/app/take_sell.rs +++ b/src/app/take_sell.rs @@ -119,7 +119,8 @@ pub async fn take_sell_action( return Ok(()); } // We update the master pubkey - edit_master_buyer_pubkey_order(pool, order.id, msg.get_inner_message_kind().pubkey.clone()).await?; + edit_master_buyer_pubkey_order(pool, order.id, msg.get_inner_message_kind().pubkey.clone()) + .await?; let buyer_pubkey_bech32 = buyer_pubkey.to_bech32().ok(); // Add buyer pubkey to order edit_buyer_pubkey_order(pool, order_id, buyer_pubkey_bech32).await?; diff --git a/src/util.rs b/src/util.rs index b22f3267..62924b4f 100644 --- a/src/util.rs +++ b/src/util.rs @@ -331,7 +331,7 @@ pub async fn show_hold_invoice( // We send the hold invoice to the seller send_dm(client, my_keys, seller_pubkey, message).await?; - let message = Message::new_order( Some(order.id), None, Action::WaitingSellerToPay, None); + let message = Message::new_order(Some(order.id), None, Action::WaitingSellerToPay, None); let message = message.as_json()?; // We send a message to buyer to know that seller was requested to pay the invoice @@ -438,11 +438,11 @@ pub async fn rate_counterpart( ) -> Result<()> { // Send dm to counterparts // to buyer - let message_to_buyer = Message::new_rate_user( order.id, None, None); + let message_to_buyer = Message::new_rate_user(order.id, None, None); let message_to_buyer = message_to_buyer.as_json().unwrap(); send_dm(client, my_keys, buyer_pubkey, message_to_buyer).await?; // to seller - let message_to_seller = Message::new_rate_user( order.id, None, None); + let message_to_seller = Message::new_rate_user(order.id, None, None); let message_to_seller = message_to_seller.as_json().unwrap(); send_dm(client, my_keys, seller_pubkey, message_to_seller).await?;