Skip to content

Commit

Permalink
Fix test & set correct timestamp on publish order
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch committed Oct 26, 2023
1 parent e64de17 commit 865701e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ mod tests {

#[test]
fn test_order_deserialize_serialize() {
let sample_order = r#"{"kind":"Sell","status":"Pending","amount":100,"fiat_code":"XXX","fiat_amount":10,"payment_method":"belo","premium":1}"#;
let sample_order = r#"{"kind":"Sell","status":"Pending","amount":100,"fiat_code":"XXX","fiat_amount":10,"payment_method":"belo","premium":1,"created_at":0}"#;
let order = NewOrder::from_json(sample_order).unwrap();
let json_order = order.as_json().unwrap();
assert_eq!(sample_order, json_order);
Expand Down
3 changes: 2 additions & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use log::{error, info};
use mostro_core::order::{Kind as OrderKind, NewOrder, Order, SmallOrder, Status};
use mostro_core::{Action, Content, Message};
use nostr_sdk::prelude::*;
use sqlx::types::chrono::Utc;
use sqlx::SqlitePool;
use sqlx::{Pool, Sqlite};
use std::str::FromStr;
Expand Down Expand Up @@ -105,7 +106,7 @@ pub async fn publish_order(
None,
None,
None,
order.created_at,
Utc::now().timestamp(),
);
let order_string = order.as_json().unwrap();
info!("serialized order: {order_string}");
Expand Down

0 comments on commit 865701e

Please sign in to comment.