Skip to content

Commit

Permalink
run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
arkanoider committed Sep 20, 2023
1 parent 7a4df04 commit a6fb830
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/rate_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::util::{send_dm, update_user_rating_event};
use anyhow::Result;
use log::{error, info};
use mostro_core::order::Order;
use mostro_core::{Action, Content, Message, Rating,NOSTR_REPLACEABLE_EVENT_KIND};
use mostro_core::{Action, Content, Message, Rating, NOSTR_REPLACEABLE_EVENT_KIND};
use nostr_sdk::prelude::*;
use sqlx::{Pool, Sqlite};
use sqlx_crud::Crud;
Expand Down
19 changes: 15 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use crate::{db, flow};
use anyhow::{Context, Result};
use log::{error, info};
use mostro_core::order::{NewOrder, Order, SmallOrder};
use mostro_core::{Action, Content, Kind as OrderKind, Message, Status, NOSTR_REPLACEABLE_EVENT_KIND};
use mostro_core::{
Action, Content, Kind as OrderKind, Message, Status, NOSTR_REPLACEABLE_EVENT_KIND,
};
use nostr_sdk::prelude::*;
use sqlx::SqlitePool;
use sqlx::{Pool, Sqlite};
Expand Down Expand Up @@ -195,7 +197,12 @@ pub async fn update_user_rating_event(
// let reputation = reput
// nip33 kind and d tag
let d_tag = Tag::Generic(TagKind::Custom("d".to_string()), vec![user.to_string()]);
let event = EventBuilder::new(Kind::Custom(NOSTR_REPLACEABLE_EVENT_KIND), reputation, &[d_tag]).to_event(keys)?;
let event = EventBuilder::new(
Kind::Custom(NOSTR_REPLACEABLE_EVENT_KIND),
reputation,
&[d_tag],
)
.to_event(keys)?;
info!("Sending replaceable event: {event:#?}");
// We update the order vote status
if buyer_sent_rate {
Expand Down Expand Up @@ -238,8 +245,12 @@ pub async fn update_order_event(
let order_string = publish_order.as_json()?;
// nip33 kind and d tag
let d_tag = Tag::Generic(TagKind::Custom("d".to_string()), vec![order.id.to_string()]);
let event =
EventBuilder::new(Kind::Custom(NOSTR_REPLACEABLE_EVENT_KIND), &order_string, &[d_tag]).to_event(keys)?;
let event = EventBuilder::new(
Kind::Custom(NOSTR_REPLACEABLE_EVENT_KIND),
&order_string,
&[d_tag],
)
.to_event(keys)?;
let event_id = event.id.to_string();
let status_str = status.to_string();
info!("Sending replaceable event: {event:#?}");
Expand Down

0 comments on commit a6fb830

Please sign in to comment.